DHCP: ARP issue, FR2.x vs FR 3.x

Fajar A. Nugraha list at fajar.net
Fri Jan 13 13:47:27 CET 2012


On Fri, Jan 13, 2012 at 6:44 PM, Fajar A. Nugraha <list at fajar.net> wrote:
> On Fri, Jan 13, 2012 at 5:09 PM, Alan DeKok <aland at deployingradius.com> wrote:

>>  See raddb/sites-available/dhcp.  Look for "src_interface".  It
>> *should* be using that field to update the ARP table.  If you don't set
>> it, it *should* use the "interface" field.  When the code updates the
>> ARP cache, it *should* print an error saying so, and then not send the
>> packet.
>
> Thanks, will try again shortly.

The change seems to be incomplete. Updated up to commit 94ca2f1.

First, there's a build error caused by commit 6021a5e. "Fixing" it is
simple enough.


diff --git a/src/main/dhcpd.c b/src/main/dhcpd.c
index 5dae88d..6424c4c 100644
--- a/src/main/dhcpd.c
+++ b/src/main/dhcpd.c
@@ -484,7 +484,7 @@ static int dhcp_socket_parse(CONF_SECTION *cs,
rad_listen_t *this)
                              &sock->suppress_responses, NULL);
        }

-       if (!sock->src_interface) sock->src_interface = strdup(sock->interface)
+       if (!sock->src_interface) sock->src_interface = strdup(sock->interface);

        cp = cf_pair_find(cs, "src_interface");
        if (cp) {


At least it builds with that. But then trying dhcp with the default
sites-available/dhcp, with minimal changes (lo0 -> lo, comment out
first listen block which is for non-linux) resulted this debug log:

...
server dhcp { # from file /etc/freeradius/sites-enabled/dhcp
 modules {
 } # modules
} # server
WARNING: Server dhcp is empty, and will do nothing!
radiusd: #### Opening IP addresses and Ports ####
listen {
	type = "auth"
	ipaddr = *
	port = 0
}
listen {
	type = "acct"
	ipaddr = *
	port = 0
}
listen {
	type = "auth"
	ipaddr = 127.0.0.1
	port = 18120
}
listen {
	type = "dhcp"
	ipaddr = 255.255.255.255
	port = 6700
	src_ipaddr = 127.0.0.1
}
listen {
	type = "dhcp"
	ipaddr = 127.0.0.1
	port = 6700
Segmentation fault


The "WARNING: Server dhcp is empty, and will do nothing!" is
particulary suspicious.  And gdb doesn't reveal much either

Program received signal SIGSEGV, Segmentation fault.
0xf7cb3db1 in ?? () from /lib/i386-linux-gnu/libc.so.6
(gdb) bt
#0  0xf7cb3db1 in ?? () from /lib/i386-linux-gnu/libc.so.6
#1  0xf7cb3a95 in strdup () from /lib/i386-linux-gnu/libc.so.6
#2  0x0805a77b in ?? ()
#3  0x0805e9a8 in ?? ()
#4  0x0805f165 in listen_init ()
#5  0x0807376f in radius_event_init ()
#6  0x08066f2f in main ()
(gdb)

Retried with previous dhcp config (the one I used eariler) still
display that warning (although this one doesn't segfault), so
something is probably broken in config parsing code (thus "Server dhcp
is empty"), and something else related to src_interface (since the
debug output seems to stop just before that, and the old config which
doesn't use src_interface loads without segfault).

... or it could simply be that my build "fix" is completely incorrect :)

-- 
Fajar




More information about the Freeradius-Devel mailing list