Date: Sat, 29 Jan 2005 10:29:34 -0800 From: Andrew Clark <andrew.clark@ucsb.edu> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/76825: isc-dhcp3-server port should allow listening on loopback interfaces Message-ID: <E1CuxLi-000A84-3x@oit.ucsb.edu> Resent-Message-ID: <200501291830.j0TIUFdL094762@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 76825 >Category: ports >Synopsis: isc-dhcp3-server port should allow listening on loopback interfaces >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sat Jan 29 18:30:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Andrew Clark >Release: FreeBSD 4.10-STABLE i386 >Organization: University of California, Santa Barbara >Environment: System: FreeBSD oit.ucsb.edu 4.10-STABLE FreeBSD 4.10-STABLE #0: Wed Sep 22 05:43:45 PDT 2004 root@oit.ucsb.edu:/usr/obj/usr/src/sys/OIT i386 isc-dhcp3-server-3.0.1.r14_6 >Description: ISC dhcp3 server does not consider loopback interfaces (among others) as suitable interfaces. Listening on a loopback can be useful. For example - in a jail bound to a loopback. - for advertising a route to support anycast-ish games The FreeBSD port already modifies ISC dhcpd in a similar way for non-broadcast interfaces. >How-To-Repeat: Attempt to start ISC dhcpd on a loopback interface >Fix: For ISC dhcpd to properly listen and answer on a loopback, it appears necessary to have USE_SOCKETS defined in includes/util.h. I'm attaching two diffs. The first against unpatched discover.c, the second against /usr/ports/net/isc-dhcp3-server/files/patch-common::discover.c I'd like to comment that it might be a good idea to allow an option to listen on any active interface. FreeBSD users can be inventive, and we like having enough rope with which to hang ourselves :-) This is a patch against the unpatched (i.e., w/o FreeBSD port patches) ISC dhcpd: --- discover.c.orig Thu Jun 10 10:59:16 2004 +++ discover.c.new Sat Jan 29 10:11:15 2005 @@ -254,7 +254,6 @@ as broadcast). Also skip down interfaces unless we're trying to get a list of configurable interfaces. */ if (((!(ifr.ifr_flags & IFF_BROADCAST) || - ifr.ifr_flags & IFF_LOOPBACK || ifr.ifr_flags & IFF_POINTOPOINT) && !tmp) || (!(ifr.ifr_flags & IFF_UP) && state != DISCOVER_UNCONFIGURED)) This is a patch against /usr/ports/net/isc-dhcp3-server/files/patch-common::discover.c --- patch-common::discover.c Tue Mar 16 12:31:15 2004 +++ patch-common::discover.c.new Sat Jan 29 10:15:54 2005 @@ -138,8 +138,7 @@ - ifr.ifr_flags & IFF_LOOPBACK || - ifr.ifr_flags & IFF_POINTOPOINT) && !tmp) || - (!(ifr.ifr_flags & IFF_UP) && -+ if ((ifa->ifa_flags & IFF_LOOPBACK) || -+ (ifa->ifa_flags & IFF_POINTOPOINT) || ++ if ((ifa->ifa_flags & IFF_POINTOPOINT) || + (!(ifa->ifa_flags & IFF_UP) && state != DISCOVER_UNCONFIGURED)) continue; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1CuxLi-000A84-3x>