Browse Source

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 16 years ago
parent
commit
8459110abc
1 changed files with 7 additions and 0 deletions
  1. 7 0
      sctp_server.c

+ 7 - 0
sctp_server.c

@@ -610,6 +610,13 @@ static int sctp_init_sock_opt_common(int s, int af)
 			pp.spp_flags=SPP_HB_DISABLE;
 			pp.spp_hbinterval=0;
 		}
+#ifdef __OS_linux
+		if (pp.spp_pathmaxrxt){
+			/* hack to work on linux, pathmaxrxt is set only if
+			   SPP_PMTUD_ENABLE */
+			pp.spp_flags|=SPP_PMTUD_ENABLE;
+		}
+#endif /*__OS_linux */
 		/* if at least one is non-null => we have to set it */
 		if (sctp_setsockopt(s, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, (void*)&pp,
 						sizeof(pp), "setsockopt: SCTP_PEER_ADDR_PARAMS")!=0){