Browse code

sctp: more compatibility changes with old sctp versions

- warn about missing sctp sockopt at compile time too
- fow now ignore sctp adaption layer events (not supported by lksctp
1.0.6 which unfortunately is still widely used)

Andrei Pelinescu-Onciul authored on 07/10/2008 11:23:49
Showing 1 changed files
... ...
@@ -65,7 +65,7 @@ int sctp_check_support()
65 65
 		if (sctp_check_compiled_sockopts(buf, sizeof(buf))!=0){
66 66
 			LOG(L_WARN, "WARNING: sctp: your ser version was compiled"
67 67
 						" without support for the following sctp options: %s"
68
-						" which might cause unforseen problems \n", buf);
68
+						", which might cause unforseen problems \n", buf);
69 69
 			LOG(L_WARN, "WARNING: sctp: please consider recompiling ser with"
70 70
 						" an upgraded sctp library version\n");
71 71
 		}
... ...
@@ -228,6 +228,8 @@ static int sctp_init_sock_opt_common(int s)
228 228
 		sctp_err++;
229 229
 		/* try to continue */
230 230
 	}
231
+#else
232
+#warning no sctp lib support for SCTP_FRAGMENT_INTERLEAVE, consider upgrading
231 233
 #endif /* SCTP_FRAGMENT_INTERLEAVE */
232 234
 	
233 235
 	/* turn off partial delivery: on linux setting SCTP_PARTIAL_DELIVERY_POINT
... ...
@@ -251,6 +253,8 @@ static int sctp_init_sock_opt_common(int s)
251 251
 		sctp_err++;
252 252
 		/* try to continue */
253 253
 	}
254
+#else
255
+#warning no sctp lib support for SCTP_PARTIAL_DELIVERY_POINT, consider upgrading
254 256
 #endif /* SCTP_PARTIAL_DELIVERY_POINT */
255 257
 	
256 258
 	/* nagle / no delay */
... ...
@@ -263,6 +267,8 @@ static int sctp_init_sock_opt_common(int s)
263 263
 		sctp_err++;
264 264
 		/* non critical, try to continue */
265 265
 	}
266
+#else
267
+#warning no sctp lib support for SCTP_NODELAY, consider upgrading
266 268
 #endif /* SCTP_NODELAY */
267 269
 	
268 270
 	/* enable message fragmentation (SCTP_DISABLE_FRAGMENTS)  (on send) */
... ...
@@ -275,6 +281,8 @@ static int sctp_init_sock_opt_common(int s)
275 275
 		sctp_err++;
276 276
 		/* non critical, try to continue */
277 277
 	}
278
+#else
279
+#warning no sctp lib support for SCTP_DISABLE_FRAGMENTS, consider upgrading
278 280
 #endif /* SCTP_DISABLE_FRAGMENTS */
279 281
 	
280 282
 	/* set autoclose */
... ...
@@ -304,7 +312,7 @@ static int sctp_init_sock_opt_common(int s)
304 304
 	es.sctp_peer_error_event=1;
305 305
 	es.sctp_shutdown_event=1;
306 306
 	es.sctp_partial_delivery_event=1;
307
-	es.sctp_adaptation_layer_event=1;
307
+	/* es.sctp_adaptation_layer_event=1; - not supported by lksctp<=1.0.6*/
308 308
 	/* es.sctp_authentication_event=1; -- not supported on linux 2.6.25 */
309 309
 	
310 310
 	/* enable the SCTP_EVENTS */
... ...
@@ -315,6 +323,8 @@ static int sctp_init_sock_opt_common(int s)
315 315
 		sctp_err++;
316 316
 		/* non critical, try to continue */
317 317
 	}
318
+#else
319
+#warning no sctp lib support for SCTP_EVENTS, consider upgrading
318 320
 #endif /* SCTP_EVENTS */
319 321
 	
320 322
 	if (sctp_err){
... ...
@@ -549,9 +559,11 @@ static char* sctp_paddr_change_state2s(unsigned int state)
549 549
 		case SCTP_ADDR_MADE_PRIM:
550 550
 			s="SCTP_ADDR_MADE_PRIM";
551 551
 			break;
552
+	/* not supported by lksctp 1.0.6 
552 553
 		case SCTP_ADDR_CONFIRMED:
553 554
 			s="SCTP_ADDR_CONFIRMED";
554 555
 			break;
556
+	*/
555 557
 		default:
556 558
 			s="UNKNOWN";
557 559
 			break;