DHCP over IPoIB requires the client to always set the BROADCAST flag of DHCPDISCOVER and DHCPREQUEST packets to ensure that server responses are broadcast back to the client so add this is as a supported option. Signed-off-by: Hal Rosenstock --- diff -up dhcp-4.2.1-P1/common/conflex.c.option dhcp-4.2.1-P1/common/conflex.c --- dhcp-4.2.1-P1/common/conflex.c.option 2010-12-15 00:07:46.000000000 +0200 +++ dhcp-4.2.1-P1/common/conflex.c 2011-04-23 18:06:57.189226000 +0300 @@ -808,6 +808,8 @@ intern(char *atom, enum dhcp_token dfv) return BALANCE; if (!strcasecmp (atom + 1, "ound")) return BOUND; + if (!strcasecmp (atom + 1, "ootp-broadcast-always")) + return BOOTP_BROADCAST_ALWAYS; break; case 'c': if (!strcasecmp(atom + 1, "ase")) diff -up dhcp-4.2.1-P1/includes/dhcpd.h.option dhcp-4.2.1-P1/includes/dhcpd.h --- dhcp-4.2.1-P1/includes/dhcpd.h.option 2010-12-03 22:32:14.000000000 +0200 +++ dhcp-4.2.1-P1/includes/dhcpd.h 2011-04-23 18:07:01.861768000 +0300 @@ -1119,6 +1119,9 @@ struct client_config { int do_forward_update; /* If nonzero, and if we have the information we need, update the A record for the address we get. */ + + int bootp_broadcast_always; /* If nonzero, always set the BOOTP_BROADCAST + flag in requests */ }; /* Per-interface state used in the dhcp client... */ diff -up dhcp-4.2.1-P1/client/dhclient.c.option dhcp-4.2.1-P1/client/dhclient.c --- dhcp-4.2.1-P1/client/dhclient.c.option 2011-03-24 23:17:07.000000000 +0200 +++ dhcp-4.2.1-P1/client/dhclient.c 2011-04-23 18:07:07.436204000 +0300 @@ -84,6 +84,7 @@ int wanted_ia_na = -1; /* the absolute int wanted_ia_ta = 0; int wanted_ia_pd = 0; char *mockup_relay = NULL; +int bootp_broadcast_always = 0; void run_stateless(int exit_mode); @@ -304,6 +305,8 @@ main(int argc, char **argv) { } else if (!strcmp(argv[i], "--version")) { log_info("isc-dhclient-%s", PACKAGE_VERSION); exit(0); + } else if (!strcmp(argv[i], "-B")) { + bootp_broadcast_always = 1; } else if (argv[i][0] == '-') { usage(); } else if (interfaces_requested < 0) { @@ -2344,7 +2347,8 @@ void make_discover (client, lease) client -> packet.xid = random (); client -> packet.secs = 0; /* filled in by send_discover. */ - if (can_receive_unicast_unconfigured (client -> interface)) + if ((!(bootp_broadcast_always || client->config->bootp_broadcast_always)) + && can_receive_unicast_unconfigured(client->interface)) client -> packet.flags = 0; else client -> packet.flags = htons (BOOTP_BROADCAST); @@ -2428,7 +2432,9 @@ void make_request (client, lease) } else { memset (&client -> packet.ciaddr, 0, sizeof client -> packet.ciaddr); - if (can_receive_unicast_unconfigured (client -> interface)) + if ((!(bootp_broadcast_always || + client ->config->bootp_broadcast_always)) && + can_receive_unicast_unconfigured (client -> interface)) client -> packet.flags = 0; else client -> packet.flags = htons (BOOTP_BROADCAST); @@ -2490,7 +2496,8 @@ void make_decline (client, lease) client -> packet.hops = 0; client -> packet.xid = client -> xid; client -> packet.secs = 0; /* Filled in by send_request. */ - if (can_receive_unicast_unconfigured (client -> interface)) + if ((!(bootp_broadcast_always || client->config-> bootp_broadcast_always)) + && can_receive_unicast_unconfigured (client->interface)) client -> packet.flags = 0; else client -> packet.flags = htons (BOOTP_BROADCAST); diff -up dhcp-4.2.1-P1/client/clparse.c.option dhcp-4.2.1-P1/client/clparse.c --- dhcp-4.2.1-P1/client/clparse.c.option 2010-09-14 00:15:19.000000000 +0200 +++ dhcp-4.2.1-P1/client/clparse.c 2011-04-23 18:07:11.930832000 +0300 @@ -136,6 +136,7 @@ isc_result_t read_client_conf () /* Requested lease time, used by DHCPv6 (DHCPv4 uses the option cache) */ top_level_config.requested_lease = 7200; + top_level_config.bootp_broadcast_always = 0; group_allocate (&top_level_config.on_receipt, MDL); if (!top_level_config.on_receipt) @@ -303,7 +304,8 @@ void read_client_leases () interface-declaration | LEASE client-lease-statement | ALIAS client-lease-statement | - KEY key-definition */ + KEY key-definition | + BOOTP_BROADCAST_ALWAYS */ void parse_client_statement (cfile, ip, config) struct parse *cfile; @@ -717,6 +719,12 @@ void parse_client_statement (cfile, ip, parse_reject_statement (cfile, config); return; + case BOOTP_BROADCAST_ALWAYS: + token = next_token(&val, (unsigned*)0, cfile); + config -> bootp_broadcast_always = 1; + parse_semi (cfile); + return; + default: lose = 0; stmt = (struct executable_statement *)0; diff -up dhcp-4.2.1-P1/includes/dhctoken.c.option dhcp-4.2.1-P1/includes/dhctoken.h --- dhcp-4.2.1-P1/includes/dhctoken.h.option 2010-02-17 22:33:55.000000000 +0200 +++ dhcp-4.2.1-P1/includes/dhctoken.h 2011-04-23 18:07:17.252304000 +0300 @@ -357,7 +357,8 @@ enum dhcp_token { CONFLICT_DONE = 660, AUTO_PARTNER_DOWN = 661, GETHOSTNAME = 662, - REWIND = 663 + REWIND = 663, + BOOTP_BROADCAST_ALWAYS = 664 }; #define is_identifier(x) ((x) >= FIRST_TOKEN && \