Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Aug 2007 14:00:41 GMT
From:      Matus Harvan <mharvan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125347 for review
Message-ID:  <200708191400.l7JE0f9i036811@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125347

Change 125347 by mharvan@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))) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708191400.l7JE0f9i036811>