PERFORCE change 125347 for review

Matus Harvan mharvan at FreeBSD.org
Sun Aug 19 07:00:42 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=125347

Change 125347 by mharvan at mharvan_bike-planet on 2007/08/19 14:00:31

	use SO_REUSEPORT in the udp catchall plugin

Affected files ...

.. //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_udp_catchall.c#3 edit

Differences ...

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_udp_catchall.c#3 (text+ko) ====

@@ -241,6 +241,7 @@
 	int fd;
 	int new_fd;
 	struct timeval tv;
+	int on;
 
 	printf("plugin_conn_map()\n");
 	
@@ -269,6 +270,9 @@
 			warn("socket() failed");
 			return;
 		}
+		if (0 != setsockopt(new_fd, SOL_SOCKET, SO_REUSEPORT,
+			     &on, sizeof(on)))
+			warn("setsockopt(SO_REUSEPORT) failed");
 		/* set the source port */
                 if (0 != bind(new_fd, (struct sockaddr *)&data->sa1,
 			      sizeof(struct sockaddr))) {


More information about the p4-projects mailing list