Browse code

sctp: SO_REUSEADDR on the sctp sockets

Reported-by: Michal Matyska, michal.matyska at iptel org

Andrei Pelinescu-Onciul authored on 12/12/2008 23:25:39
Showing 1 changed files
... ...
@@ -216,6 +216,15 @@ static int sctp_init_sock_opt_common(int s)
216 216
 		}
217 217
 	}
218 218
 	
219
+	/* set reuseaddr */
220
+	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
221
+						(void*)&optval, sizeof(optval))==-1){
222
+			LOG(L_ERR, "ERROR: sctp_init_sock_opt_common: setsockopt:"
223
+						" SO_REUSEADDR (%d): %s\n", optval, strerror(errno));
224
+			/* continue, non-critical */
225
+	}
226
+
227
+	
219 228
 	/* disable fragments interleave (SCTP_FRAGMENT_INTERLEAVE) --
220 229
 	 * we don't want partial delivery, so fragment interleave must be off too
221 230
 	 */