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 253
 		sctp_err++;
252 254
 		/* try to continue */
253 255
 	}
256
+#else
257
+#warning no sctp lib support for SCTP_PARTIAL_DELIVERY_POINT, consider upgrading
254 258
 #endif /* SCTP_PARTIAL_DELIVERY_POINT */
255 259
 	
256 260
 	/* nagle / no delay */
... ...
@@ -263,6 +267,8 @@ static int sctp_init_sock_opt_common(int s)
263 267
 		sctp_err++;
264 268
 		/* non critical, try to continue */
265 269
 	}
270
+#else
271
+#warning no sctp lib support for SCTP_NODELAY, consider upgrading
266 272
 #endif /* SCTP_NODELAY */
267 273
 	
268 274
 	/* enable message fragmentation (SCTP_DISABLE_FRAGMENTS)  (on send) */
... ...
@@ -275,6 +281,8 @@ static int sctp_init_sock_opt_common(int s)
275 281
 		sctp_err++;
276 282
 		/* non critical, try to continue */
277 283
 	}
284
+#else
285
+#warning no sctp lib support for SCTP_DISABLE_FRAGMENTS, consider upgrading
278 286
 #endif /* SCTP_DISABLE_FRAGMENTS */
279 287
 	
280 288
 	/* set autoclose */
... ...
@@ -304,7 +312,7 @@ static int sctp_init_sock_opt_common(int s)
304 312
 	es.sctp_peer_error_event=1;
305 313
 	es.sctp_shutdown_event=1;
306 314
 	es.sctp_partial_delivery_event=1;
307
-	es.sctp_adaptation_layer_event=1;
315
+	/* es.sctp_adaptation_layer_event=1; - not supported by lksctp<=1.0.6*/
308 316
 	/* es.sctp_authentication_event=1; -- not supported on linux 2.6.25 */
309 317
 	
310 318
 	/* enable the SCTP_EVENTS */
... ...
@@ -315,6 +323,8 @@ static int sctp_init_sock_opt_common(int s)
315 323
 		sctp_err++;
316 324
 		/* non critical, try to continue */
317 325
 	}
326
+#else
327
+#warning no sctp lib support for SCTP_EVENTS, consider upgrading
318 328
 #endif /* SCTP_EVENTS */
319 329
 	
320 330
 	if (sctp_err){
... ...
@@ -549,9 +559,11 @@ static char* sctp_paddr_change_state2s(unsigned int state)
549 559
 		case SCTP_ADDR_MADE_PRIM:
550 560
 			s="SCTP_ADDR_MADE_PRIM";
551 561
 			break;
562
+	/* not supported by lksctp 1.0.6 
552 563
 		case SCTP_ADDR_CONFIRMED:
553 564
 			s="SCTP_ADDR_CONFIRMED";
554 565
 			break;
566
+	*/
555 567
 		default:
556 568
 			s="UNKNOWN";
557 569
 			break;