* [uml-devel] [PATCH] make port channel use setsockopt SO_REUSEADDR
@ 2004-07-06 11:09 Michael Clark
2004-07-13 19:05 ` Jeff Dike
0 siblings, 1 reply; 3+ messages in thread
From: Michael Clark @ 2004-07-06 11:09 UTC (permalink / raw)
To: UML Devel
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
Hi All,
Small patch to make port channels allow reuse of local addresses.
Useful in the case where you restart a UML from a script and you
don't want to have to allocate a new port number each time.
~mc
[-- Attachment #2: uml-port-reuseaddr.patch --]
[-- Type: text/x-patch, Size: 575 bytes --]
--- linux-2.6.7-uml/arch/um/drivers/port_user.c.orig 2004-07-06 18:48:45.000000000 +0800
+++ linux-2.6.7-uml/arch/um/drivers/port_user.c 2004-07-06 18:51:11.000000000 +0800
@@ -118,12 +118,16 @@
int port_listen_fd(int port)
{
struct sockaddr_in addr;
- int fd, err;
+ int fd, err, arg;
fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1)
return(-errno);
+ arg = 1;
+ if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0)
+ return(-errno);
+
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [uml-devel] [PATCH] make port channel use setsockopt SO_REUSEADDR
2004-07-06 11:09 [uml-devel] [PATCH] make port channel use setsockopt SO_REUSEADDR Michael Clark
@ 2004-07-13 19:05 ` Jeff Dike
2004-07-14 0:11 ` Michael Clark
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Dike @ 2004-07-13 19:05 UTC (permalink / raw)
To: Michael Clark; +Cc: UML Devel
michael@metaparadigm.com said:
> Small patch to make port channels allow reuse of local addresses.
> Useful in the case where you restart a UML from a script and you don't
> want to have to allocate a new port number each time.
Applied, except I fixed the error case slightly.
Jeff
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [uml-devel] [PATCH] make port channel use setsockopt SO_REUSEADDR
2004-07-13 19:05 ` Jeff Dike
@ 2004-07-14 0:11 ` Michael Clark
0 siblings, 0 replies; 3+ messages in thread
From: Michael Clark @ 2004-07-14 0:11 UTC (permalink / raw)
To: Jeff Dike; +Cc: UML Devel
On 07/14/04 03:05, Jeff Dike wrote:
> michael@metaparadigm.com said:
>
>>Small patch to make port channels allow reuse of local addresses.
>>Useful in the case where you restart a UML from a script and you don't
>>want to have to allocate a new port number each time.
>
>
> Applied, except I fixed the error case slightly.
Ooops, yes, my bad. leaking fd.
Thanks,
~mc
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-07-14 0:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-06 11:09 [uml-devel] [PATCH] make port channel use setsockopt SO_REUSEADDR Michael Clark
2004-07-13 19:05 ` Jeff Dike
2004-07-14 0:11 ` Michael Clark
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.