From owner-freebsd-bugs Thu May 28 04:55:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA27836 for freebsd-bugs-outgoing; Thu, 28 May 1998 04:55:41 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA27826 for ; Thu, 28 May 1998 04:55:39 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id EAA21797; Thu, 28 May 1998 04:50:00 -0700 (PDT) Date: Thu, 28 May 1998 04:50:00 -0700 (PDT) Message-Id: <199805281150.EAA21797@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: njs3@doc.ic.ac.uk (Niall Smart) Subject: Re: kern/6774: bind(3)/libc improvement Reply-To: njs3@doc.ic.ac.uk (Niall Smart) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/6774; it has been noted by GNATS. From: njs3@doc.ic.ac.uk (Niall Smart) To: bicknell@ufp.org, FreeBSD-gnats-submit@freebsd.org Cc: Subject: Re: kern/6774: bind(3)/libc improvement Date: Thu, 28 May 1998 12:51:11 +0100 On May 27, 5:39pm, Leo Bicknell wrote: } Subject: kern/6774: bind(3)/libc improvement > > >Synopsis: bind(3)/libc improvement > Many programs bind to "wildcard" addresses for the purposes of > getting a local IP address/port assigment. This works fine when a > machine has a single interface, but for machines with multiple physical > or logical (alias) interfaces this is not always appropriate. For > instance, on a machine with 10 aliases the "telnet" service, as managed > by inetd(8) will respond to all 10 addresses. > > What I propose is an enviornment variable, "LOCAL_BIND" which > would be used by the bind(3) code. If this does not exist, the > traditional behavior would occur. On the other hand, if it was set to > an IP address on the local system a "bind" call to the wildcard address > would go to that address, and that address only. A further extension > would be to have a list of acceptable addresses. I'm inclined to just say "what a gross hack". :) If a program should have the ability to bind to specific addresses then the author of the code should provide that functionality through command line arguments or configuration files. There is currently no problem with the bind(2) interface, the problem is in the programs which use it, and therefore it's their behaviour which should be changed, not bind(2)'s Also, were you aware that even if a process has bound to a specific interface, it can still receive packets recieved on other interfaces destined for that interface? > This would allow things like an outbound telnet connection > from a particular address forced by the user, or having a program like > inetd listen only to some addresses without chaning the code of these > user applications. Modifying inetd so it only binds to specific interfaces is probably a good idea. Niall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message