Browse code

sctp: linux kernel obsolete api bug workaround

set SPP_PMTUD_ENABLE when changing pathmaxrxt on linux. This was
required on older versions of the api draft (<=14, most likely a
draft bug) and is still required on linux.

Reported-by: Libor Chocholaty libor at iptel org

Andrei Pelinescu-Onciul authored on 05/10/2009 14:15:30
Showing 1 changed files
... ...
@@ -610,6 +610,13 @@ static int sctp_init_sock_opt_common(int s, int af)
610 610
 			pp.spp_flags=SPP_HB_DISABLE;
611 611
 			pp.spp_hbinterval=0;
612 612
 		}
613
+#ifdef __OS_linux
614
+		if (pp.spp_pathmaxrxt){
615
+			/* hack to work on linux, pathmaxrxt is set only if
616
+			   SPP_PMTUD_ENABLE */
617
+			pp.spp_flags|=SPP_PMTUD_ENABLE;
618
+		}
619
+#endif /*__OS_linux */
613 620
 		/* if at least one is non-null => we have to set it */
614 621
 		if (sctp_setsockopt(s, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, (void*)&pp,
615 622
 						sizeof(pp), "setsockopt: SCTP_PEER_ADDR_PARAMS")!=0){