diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2012-03-16 00:58:57 +0400 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2012-03-16 00:59:35 +0400 |
commit | 050f4f7739b731d78eaab234999663213e9fb4e2 (patch) | |
tree | ecb2b3dbd7fd4e205491feb3c8600ca1adefb1ef | |
parent | Merge branch 'master' of git+ssh://git.overlays.gentoo.org/proj/sci (diff) | |
download | sci-050f4f7739b731d78eaab234999663213e9fb4e2.tar.gz sci-050f4f7739b731d78eaab234999663213e9fb4e2.tar.bz2 sci-050f4f7739b731d78eaab234999663213e9fb4e2.zip |
[net-misc/dhcp] Import patches from F17
(Portage version: 2.2.0_alpha90/git/Linux x86_64, unsigned Manifest commit)
-rw-r--r-- | net-misc/dhcp/ChangeLog | 7 | ||||
-rw-r--r-- | net-misc/dhcp/dhcp-4.2.3_p1-r1.ebuild | 6 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.0-ib-options.patch | 422 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.2-gpxe-cid.patch | 132 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.2-improved-xid.patch (renamed from net-misc/dhcp/files/dhcp-4.2.0-improved-xid.patch) | 69 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.2-lpf-ib.patch (renamed from net-misc/dhcp/files/dhcp-4.2.0-lpf-ib.patch) | 272 |
6 files changed, 308 insertions, 600 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog index c6dc101fa..0b47c0a32 100644 --- a/net-misc/dhcp/ChangeLog +++ b/net-misc/dhcp/ChangeLog @@ -3,6 +3,13 @@ # $Header: $ 15 Mar 2012; Alexey Shvetsov <alexxy@gentoo.org> + +files/dhcp-4.2.2-gpxe-cid.patch, +files/dhcp-4.2.2-improved-xid.patch, + +files/dhcp-4.2.2-lpf-ib.patch, -files/dhcp-4.2.0-ib-options.patch, + -files/dhcp-4.2.0-improved-xid.patch, -files/dhcp-4.2.0-lpf-ib.patch, + dhcp-4.2.3_p1-r1.ebuild: + [net-misc/dhcp] Import patches from F17 + + 15 Mar 2012; Alexey Shvetsov <alexxy@gentoo.org> files/dhcp-4.2.0-ib-options.patch: [net-misc/dhcp] once again diff --git a/net-misc/dhcp/dhcp-4.2.3_p1-r1.ebuild b/net-misc/dhcp/dhcp-4.2.3_p1-r1.ebuild index 78b8b373a..22d75872d 100644 --- a/net-misc/dhcp/dhcp-4.2.3_p1-r1.ebuild +++ b/net-misc/dhcp/dhcp-4.2.3_p1-r1.ebuild @@ -62,9 +62,9 @@ src_prepare() { # infiniband patches if use infiniband; then - epatch "${FILESDIR}"/${PN}-4.2.0-improved-xid.patch - epatch "${FILESDIR}"/${PN}-4.2.0-lpf-ib.patch - epatch "${FILESDIR}"/${PN}-4.2.0-ib-options.patch + epatch "${FILESDIR}"/${PN}-4.2.2-lpf-ib.patch + epatch "${FILESDIR}"/${PN}-4.2.2-improved-xid.patch + epatch "${FILESDIR}"/${PN}-4.2.2-gpxe-cid.patch fi # Brand the version with Gentoo diff --git a/net-misc/dhcp/files/dhcp-4.2.0-ib-options.patch b/net-misc/dhcp/files/dhcp-4.2.0-ib-options.patch deleted file mode 100644 index a412fbf11..000000000 --- a/net-misc/dhcp/files/dhcp-4.2.0-ib-options.patch +++ /dev/null @@ -1,422 +0,0 @@ -From eb2ec733aa64bf9da9e64364dbbbde3411eaf90a Mon Sep 17 00:00:00 2001 -From: Alexey Shvetsov <alexxy@gentoo.org> -Date: Thu, 15 Mar 2012 23:21:21 +0400 -Subject: [PATCH] ib options - ---- - client/clparse.c | 10 +- - client/dhclient.c | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++- - common/conflex.c | 2 + - includes/dhcpd.h | 3 + - includes/dhctoken.h | 3 +- - 5 files changed, 283 insertions(+), 5 deletions(-) - -diff --git a/client/clparse.c b/client/clparse.c -index 9de4ce2..890647d 100644 ---- a/client/clparse.c -+++ b/client/clparse.c -@@ -146,6 +146,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) -@@ -313,7 +314,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; -@@ -732,6 +734,12 @@ void parse_client_statement (cfile, ip, config) - 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 --git a/client/dhclient.c b/client/dhclient.c -index 138b563..a853bbc 100644 ---- a/client/dhclient.c -+++ b/client/dhclient.c -@@ -39,6 +39,12 @@ - #include <limits.h> - #include <dns/result.h> - -+/* -+ * Defined in stdio.h when _GNU_SOURCE is set, but we don't want to define -+ * that when building ISC code. -+ */ -+extern int asprintf(char **strp, const char *fmt, ...); -+ - TIME default_lease_time = 43200; /* 12 hours... */ - TIME max_lease_time = 86400; /* 24 hours... */ - -@@ -87,6 +93,9 @@ int wanted_ia_na = -1; /* the absolute value is the real one. */ - int wanted_ia_ta = 0; - int wanted_ia_pd = 0; - char *mockup_relay = NULL; -+int bootp_broadcast_always = 0; -+ -+extern u_int32_t default_requested_options[]; - - void run_stateless(int exit_mode); - -@@ -146,6 +155,15 @@ main(int argc, char **argv) { - int local_family_set = 0; - #endif /* DHCPv6 */ - char *s; -+ char *dhcp_client_identifier_arg = NULL; -+ char *dhcp_host_name_arg = NULL; -+ char *dhcp_fqdn_arg = NULL; -+ char *dhcp_vendor_class_identifier_arg = NULL; -+ char *dhclient_request_options = NULL; -+ -+ int timeout_arg = 0; -+ char *arg_conf = NULL; -+ int arg_conf_len = 0; - - /* Initialize client globals. */ - memset(&default_duid, 0, sizeof(default_duid)); -@@ -333,6 +351,88 @@ 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], "-I")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) { -+ log_error("-I option dhcp-client-identifier string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1); -+ exit(1); -+ } -+ -+ dhcp_client_identifier_arg = argv[i]; -+ } else if (!strcmp(argv[i], "-B")) { -+ bootp_broadcast_always = 1; -+ } else if (!strcmp(argv[i], "-H")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) { -+ log_error("-H option host-name string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1); -+ exit(1); -+ } -+ -+ if (dhcp_host_name_arg != NULL) { -+ log_error("The -H <host-name> and -F <fqdn> arguments are mutually exclusive"); -+ exit(1); -+ } -+ -+ dhcp_host_name_arg = argv[i]; -+ } else if (!strcmp(argv[i], "-F")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) { -+ log_error("-F option fqdn.fqdn string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1); -+ exit(1); -+ } -+ -+ if (dhcp_fqdn_arg != NULL) { -+ log_error("Only one -F <fqdn> argument can be specified"); -+ exit(1); -+ } -+ -+ if (dhcp_host_name_arg != NULL) { -+ log_error("The -F <fqdn> and -H <host-name> arguments are mutually exclusive"); -+ exit(1); -+ } -+ -+ dhcp_fqdn_arg = argv[i]; -+ } else if (!strcmp(argv[i], "-timeout")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ if ((timeout_arg = atoi(argv[i])) <= 0) { -+ log_error("-T timeout option must be > 0 - bad value: %s",argv[i]); -+ exit(1); -+ } -+ } else if (!strcmp(argv[i], "-V")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ if (strlen(argv[i]) >= DHCP_MAX_OPTION_LEN) { -+ log_error("-V option vendor-class-identifier string \"%s\" is too long - maximum length is: %d", argv[i], DHCP_MAX_OPTION_LEN-1); -+ exit(1); -+ } -+ -+ dhcp_vendor_class_identifier_arg = argv[i]; -+ } else if (!strcmp(argv[i], "-R")) { -+ if ((++i == argc) || (argv[i] == NULL) || (*(argv[i])=='\0')) { -+ usage(); -+ exit(1); -+ } -+ -+ dhclient_request_options = argv[i]; - } else if (argv[i][0] == '-') { - usage(); - } else if (interfaces_requested < 0) { -@@ -507,6 +607,166 @@ main(int argc, char **argv) { - /* Parse the dhclient.conf file. */ - read_client_conf(); - -+ /* Parse any extra command line configuration arguments: */ -+ if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) { -+ arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -I option dhcp-client-identifier"); -+ } -+ -+ if ((dhcp_host_name_arg != NULL) && (*dhcp_host_name_arg != '\0')) { -+ if (arg_conf == 0) { -+ arg_conf_len = asprintf(&arg_conf, "send host-name \"%s\";", dhcp_host_name_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -H option host-name"); -+ } else { -+ char *last_arg_conf = arg_conf; -+ arg_conf = NULL; -+ arg_conf_len = asprintf(&arg_conf, "%s\nsend host-name \"%s\";", last_arg_conf, dhcp_host_name_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -H option host-name"); -+ -+ free(last_arg_conf); -+ } -+ } -+ -+ if ((dhcp_fqdn_arg != NULL) && (*dhcp_fqdn_arg != '\0')) { -+ if (arg_conf == 0) { -+ arg_conf_len = asprintf(&arg_conf, "send fqdn.fqdn \"%s\";", dhcp_fqdn_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -F option fqdn.fqdn"); -+ } else { -+ char *last_arg_conf = arg_conf; -+ arg_conf = NULL; -+ arg_conf_len = asprintf(&arg_conf, "%s\nsend fqdn.fqdn \"%s\";", last_arg_conf, dhcp_fqdn_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -F option fqdn.fqdn"); -+ -+ free(last_arg_conf); -+ } -+ } -+ -+ if (timeout_arg) { -+ if (arg_conf == 0) { -+ arg_conf_len = asprintf(&arg_conf, "timeout %d;", timeout_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to process -timeout timeout argument"); -+ } else { -+ char *last_arg_conf = arg_conf; -+ arg_conf = NULL; -+ arg_conf_len = asprintf(&arg_conf, "%s\ntimeout %d;", last_arg_conf, timeout_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len == 0)) -+ log_fatal("Unable to process -timeout timeout argument"); -+ -+ free(last_arg_conf); -+ } -+ } -+ -+ if ((dhcp_vendor_class_identifier_arg != NULL) && (*dhcp_vendor_class_identifier_arg != '\0')) { -+ if (arg_conf == 0) { -+ arg_conf_len = asprintf(&arg_conf, "send vendor-class-identifier \"%s\";", dhcp_vendor_class_identifier_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -V option vendor-class-identifier"); -+ } else { -+ char *last_arg_conf = arg_conf; -+ arg_conf = NULL; -+ arg_conf_len = asprintf(&arg_conf, "%s\nsend vendor-class-identifier \"%s\";", last_arg_conf, dhcp_vendor_class_identifier_arg); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to send -V option vendor-class-identifier"); -+ -+ free(last_arg_conf); -+ } -+ } -+ -+ if (dhclient_request_options != NULL) { -+ if (arg_conf == 0) { -+ arg_conf_len = asprintf(&arg_conf, "request %s;", dhclient_request_options); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to parse -R <request options list> argument"); -+ } else { -+ char *last_arg_conf = arg_conf; -+ arg_conf = NULL; -+ arg_conf_len = asprintf(&arg_conf, "%s\nrequest %s;", last_arg_conf, dhclient_request_options); -+ -+ if ((arg_conf == 0) || (arg_conf_len <= 0)) -+ log_fatal("Unable to parse -R <request options list> argument"); -+ -+ free(last_arg_conf); -+ } -+ } -+ -+ if (arg_conf) { -+ if (arg_conf_len == 0) -+ if ((arg_conf_len = strlen(arg_conf)) == 0) -+ /* huh ? cannot happen ! */ -+ log_fatal("Unable to process -I/-H/-F/-timeout/-V/-R configuration arguments"); -+ -+ /* parse the extra dhclient.conf configuration arguments -+ * into top level config: */ -+ struct parse *cfile = (struct parse *)0; -+ const char *val = NULL; -+ int token; -+ -+ status = new_parse(&cfile, -1, arg_conf, arg_conf_len, "extra dhclient -I/-H/-F/-timeout/-V/-R configuration arguments", 0); -+ -+ if ((status != ISC_R_SUCCESS) || (cfile -> warnings_occurred)) -+ log_fatal("Cannot parse -I/-H/-F/-timeout/-V/-R configuration arguments !"); -+ /* more detailed parse failures will be logged */ -+ -+ do { -+ token = peek_token(&val, (unsigned *)0, cfile); -+ if (token == END_OF_FILE) -+ break; -+ -+ parse_client_statement(cfile, (struct interface_info *)0, &top_level_config); -+ } while (1); -+ -+ if (cfile -> warnings_occurred) -+ log_fatal("Cannot parse -I/-H/-F/-timeout/-V/-R configuration arguments !"); -+ end_parse(&cfile); -+ -+ if (timeout_arg) { -+ /* we just set the toplevel timeout, but per-client -+ * timeouts may still be at defaults. Also, it makes no -+ * sense having the reboot_timeout or backoff_cutoff -+ * greater than the timeout: -+ */ -+ if ((top_level_config.backoff_cutoff == 15) && (top_level_config.backoff_cutoff > (timeout_arg / 2))) -+ top_level_config.backoff_cutoff = (((unsigned long)(timeout_arg / 2)) == 0) ? timeout_arg : (unsigned long)(timeout_arg / 2); -+ -+ for (ip=interfaces; ip; ip = ip->next) { -+ if (ip->client->config->timeout == 60) -+ ip->client->config->timeout = timeout_arg; -+ -+ if ((ip->client->config->reboot_timeout == 10) && (ip->client->config->reboot_timeout > ip->client->config->timeout)) -+ ip->client->config->reboot_timeout = ip->client->config->timeout; -+ if ((ip->client->config->backoff_cutoff == 15) && (ip->client->config->backoff_cutoff > top_level_config.backoff_cutoff)) -+ ip->client->config->backoff_cutoff = top_level_config.backoff_cutoff; -+ } -+ } -+ -+ if ((dhclient_request_options != 0) && (top_level_config.requested_options != (void *) default_requested_options)) { -+ for (ip=interfaces; ip; ip = ip->next) { -+ if (ip->client->config->requested_options == (void *) default_requested_options) -+ ip->client->config->requested_options = top_level_config.requested_options; -+ } -+ } -+ -+ free(arg_conf); -+ arg_conf = NULL; -+ arg_conf_len = 0; -+ } -+ - /* Parse the lease database. */ - read_client_leases(); - -@@ -2468,7 +2728,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); -@@ -2552,7 +2813,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); -@@ -2614,7 +2877,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 --git a/common/conflex.c b/common/conflex.c -index 9c9ed66..028e69c 100644 ---- a/common/conflex.c -+++ b/common/conflex.c -@@ -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 --git a/includes/dhcpd.h b/includes/dhcpd.h -index 5a137e6..7da8b76 100644 ---- a/includes/dhcpd.h -+++ b/includes/dhcpd.h -@@ -1147,6 +1147,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 --git a/includes/dhctoken.h b/includes/dhctoken.h -index 9911d70..3fdda93 100644 ---- a/includes/dhctoken.h -+++ b/includes/dhctoken.h -@@ -363,7 +363,8 @@ enum dhcp_token { - INITIAL_DELAY = 664, - GETHOSTBYNAME = 665, - PRIMARY6 = 666, -- SECONDARY6 = 667 -+ SECONDARY6 = 667, -+ BOOTP_BROADCAST_ALWAYS = 668 - }; - - #define is_identifier(x) ((x) >= FIRST_TOKEN && \ --- -1.7.9.3 - diff --git a/net-misc/dhcp/files/dhcp-4.2.2-gpxe-cid.patch b/net-misc/dhcp/files/dhcp-4.2.2-gpxe-cid.patch new file mode 100644 index 000000000..c0be4c239 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.2.2-gpxe-cid.patch @@ -0,0 +1,132 @@ +diff -up dhcp-4.2.2/client/dhclient.c.gpxe-cid dhcp-4.2.2/client/dhclient.c +--- dhcp-4.2.2/client/dhclient.c.gpxe-cid 2011-09-16 18:23:20.190453902 +0200 ++++ dhcp-4.2.2/client/dhclient.c 2011-09-16 18:27:15.568463599 +0200 +@@ -58,6 +58,13 @@ const char *path_dhclient_pid = NULL; + static char path_dhclient_script_array[] = _PATH_DHCLIENT_SCRIPT; + char *path_dhclient_script = path_dhclient_script_array; + ++/* Default Prefix */ ++static unsigned char default_prefix[12] = { ++ 0xff, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x02, 0x00, ++ 0x00, 0x02, 0xc9, 0x00 ++}; ++ + /* False (default) => we write and use a pid file */ + isc_boolean_t no_pid_file = ISC_FALSE; + +@@ -1250,6 +1257,12 @@ int find_subnet (struct subnet **sp, + static void setup_ib_interface(struct interface_info *ip) + { + struct group *g; ++ struct hardware *hw = &ip->hw_address; ++ char client_id[64]; ++ char *arg_conf = NULL; ++ int arg_conf_len = 0; ++ isc_result_t status; ++ struct parse *cfile = (struct parse *)0; + + /* Set the broadcast flag */ + ip->client->config->bootp_broadcast_always = 1; +@@ -1266,8 +1279,39 @@ static void setup_ib_interface(struct in + } + } + +- /* No client ID specified */ +- log_fatal("dhcp-client-identifier must be specified for InfiniBand"); ++ /* ++ * No client ID specified, make up one based on a default ++ * "prefix" and the port GUID. ++ * ++ * NOTE: This is compatible with what gpxe does. ++ */ ++ sprintf(client_id, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", ++ default_prefix[0], default_prefix[1], default_prefix[2], ++ default_prefix[3], default_prefix[4], default_prefix[5], ++ default_prefix[6], default_prefix[7], default_prefix[8], ++ default_prefix[9], default_prefix[10], default_prefix[11], ++ hw->hbuf[1], hw->hbuf[2], hw->hbuf[3], hw->hbuf[4], ++ hw->hbuf[5], hw->hbuf[6], hw->hbuf[7], hw->hbuf[8]); ++ ++ arg_conf_len = asprintf(&arg_conf, ++ "send dhcp-client-identifier %s;", ++ client_id); ++ ++ if ((arg_conf == 0) || (arg_conf_len <= 0)) ++ log_fatal("Unable to send option dhcp-client-identifier"); ++ ++ status = new_parse(&cfile, -1, arg_conf, arg_conf_len, ++ "Automatic Infiniband client identifier", 0); ++ ++ if ((status != ISC_R_SUCCESS) || (cfile->warnings_occurred)) ++ log_fatal("Failed to parse Infiniband client identifier"); ++ ++ parse_client_statement(cfile, NULL, ip->client->config); ++ ++ if (cfile->warnings_occurred) ++ log_fatal("Failed to parse Infiniband client identifier"); ++ ++ end_parse(&cfile); + } + + /* Individual States: +diff -up dhcp-4.2.2/common/lpf.c.gpxe-cid dhcp-4.2.2/common/lpf.c +--- dhcp-4.2.2/common/lpf.c.gpxe-cid 2011-09-16 18:23:20.183453996 +0200 ++++ dhcp-4.2.2/common/lpf.c 2011-09-16 18:25:28.235804421 +0200 +@@ -591,6 +591,37 @@ void maybe_setup_fallback () + } + } + ++static unsigned char * get_ib_hw_addr(char * name) ++{ ++ struct ifaddrs *ifaddrs; ++ struct ifaddrs *ifa; ++ struct sockaddr_ll *sll = NULL; ++ static unsigned char hw_addr[8]; ++ ++ if (getifaddrs(&ifaddrs) == -1) ++ return NULL; ++ ++ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { ++ if (ifa->ifa_addr == NULL) ++ continue; ++ if (ifa->ifa_addr->sa_family != AF_PACKET) ++ continue; ++ if (ifa->ifa_flags & IFF_LOOPBACK) ++ continue; ++ if (strcmp(ifa->ifa_name, name) == 0) { ++ sll = (struct sockaddr_ll *)(void *)ifa->ifa_addr; ++ break; ++ } ++ } ++ if (sll == NULL) { ++ freeifaddrs(ifaddrs); ++ return NULL; ++ } ++ memcpy(hw_addr, &sll->sll_addr[sll->sll_halen - 8], 8); ++ freeifaddrs(ifaddrs); ++ return (unsigned char *)&hw_addr; ++} ++ + void + get_hw_addr(struct interface_info *info) + { +@@ -599,6 +630,7 @@ get_hw_addr(struct interface_info *info) + struct ifaddrs *ifaddrs; + struct ifaddrs *ifa; + struct sockaddr_ll *sll = NULL; ++ unsigned char *hw_addr; + + if (getifaddrs(&ifaddrs) == -1) + log_fatal("Failed to get interfaces"); +@@ -660,6 +692,10 @@ get_hw_addr(struct interface_info *info) + + hw->hlen = 1; + hw->hbuf[0] = HTYPE_INFINIBAND; ++ hw_addr = get_ib_hw_addr(name); ++ if (!hw_addr) ++ log_fatal("Failed getting %s hw addr", name); ++ memcpy (&hw->hbuf [1], hw_addr, 8); + break; + #if defined(ARPHRD_PPP) + case ARPHRD_PPP: diff --git a/net-misc/dhcp/files/dhcp-4.2.0-improved-xid.patch b/net-misc/dhcp/files/dhcp-4.2.2-improved-xid.patch index 1fd4dbec0..f49fc7845 100644 --- a/net-misc/dhcp/files/dhcp-4.2.0-improved-xid.patch +++ b/net-misc/dhcp/files/dhcp-4.2.2-improved-xid.patch @@ -1,17 +1,7 @@ -From 37a9ded0038fe29f26377c40e080634534d97d0e Mon Sep 17 00:00:00 2001 -From: Alexey Shvetsov <alexxy@gentoo.org> -Date: Thu, 15 Mar 2012 22:54:15 +0400 -Subject: [PATCH 1/3] improved xid - ---- - client/dhclient.c | 62 +++++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 51 insertions(+), 11 deletions(-) - -diff --git a/client/dhclient.c b/client/dhclient.c -index 48707d1..f72e0da 100644 ---- a/client/dhclient.c -+++ b/client/dhclient.c -@@ -540,6 +540,26 @@ main(int argc, char **argv) { +diff -up dhcp-4.2.2/client/dhclient.c.improved-xid dhcp-4.2.2/client/dhclient.c +--- dhcp-4.2.2/client/dhclient.c.improved-xid 2011-09-16 18:18:00.649730661 +0200 ++++ dhcp-4.2.2/client/dhclient.c 2011-09-16 18:22:36.815035513 +0200 +@@ -898,6 +898,26 @@ main(int argc, char **argv) { } } @@ -38,7 +28,7 @@ index 48707d1..f72e0da 100644 /* At this point, all the interfaces that the script thinks are relevant should be running, so now we once again call discover_interfaces(), and this time ask it to actually set -@@ -554,14 +574,34 @@ main(int argc, char **argv) { +@@ -912,14 +932,36 @@ main(int argc, char **argv) { Not much entropy, but we're booting, so we're not likely to find anything better. */ seed = 0; @@ -46,7 +36,7 @@ index 48707d1..f72e0da 100644 for (ip = interfaces; ip; ip = ip->next) { int junk; + if ( ip -> hw_address.hlen <= sizeof seed ) -+ continue; ++ continue; memcpy(&junk, &ip->hw_address.hbuf[ip->hw_address.hlen - sizeof seed], sizeof seed); @@ -56,25 +46,27 @@ index 48707d1..f72e0da 100644 - srandom(seed + cur_time + (unsigned)getpid()); + if ( seed_flag == 0 ) { + if ( backup_seed != 0 ) { -+ seed = backup_seed; -+ log_info ("xid: rand init seed (0x%x) built using all" -+ " available interfaces",seed); -+ } else { -+ seed = cur_time^((unsigned) gethostid()) ; -+ log_info ("xid: warning: no netdev with useable HWADDR found" -+ " for seed's uniqueness enforcement"); -+ log_info ("xid: rand init seed (0x%x) built using gethostid", -+ seed); ++ seed = backup_seed; ++ log_info ("xid: rand init seed (0x%x) built using all" ++ " available interfaces",seed); ++ } ++ else { ++ seed = cur_time^((unsigned) gethostid()) ; ++ log_info ("xid: warning: no netdev with useable HWADDR found" ++ " for seed's uniqueness enforcement"); ++ log_info ("xid: rand init seed (0x%x) built using gethostid", ++ seed); + } -+ /* we only use seed and no current time as a broadcast reply */ -+ /* will certainly be used by the hwaddrless interface */ ++ /* we only use seed and no current time as a broadcast reply */ ++ /* will certainly be used by the hwaddrless interface */ + srandom(seed); -+ } else -+ srandom(seed + cur_time + (unsigned)getpid()); ++ } ++ else ++ srandom(seed + cur_time + (unsigned)getpid()); - /* Start a configuration state machine for each interface. */ - #ifdef DHCPv6 -@@ -1053,7 +1093,7 @@ void dhcpack (packet) + /* Setup specific Infiniband options */ + for (ip = interfaces; ip; ip = ip->next) { +@@ -1457,7 +1499,7 @@ void dhcpack (packet) return; } @@ -83,7 +75,7 @@ index 48707d1..f72e0da 100644 lease = packet_to_lease (packet, client); if (!lease) { -@@ -1769,7 +1809,7 @@ void dhcpnak (packet) +@@ -2174,7 +2216,7 @@ void dhcpnak (packet) return; } @@ -92,7 +84,7 @@ index 48707d1..f72e0da 100644 if (!client -> active) { #if defined (DEBUG) -@@ -1895,10 +1935,10 @@ void send_discover (cpp) +@@ -2300,10 +2342,10 @@ void send_discover (cpp) client -> packet.secs = htons (65535); client -> secs = client -> packet.secs; @@ -105,7 +97,7 @@ index 48707d1..f72e0da 100644 /* Send out a packet. */ result = send_packet (client -> interface, (struct packet *)0, -@@ -2162,10 +2202,10 @@ void send_request (cpp) +@@ -2584,10 +2626,10 @@ void send_request (cpp) client -> packet.secs = htons (65535); } @@ -118,7 +110,7 @@ index 48707d1..f72e0da 100644 if (destination.sin_addr.s_addr != INADDR_BROADCAST && fallback_interface) -@@ -2196,10 +2236,10 @@ void send_decline (cpp) +@@ -2618,10 +2660,10 @@ void send_decline (cpp) int result; @@ -131,7 +123,7 @@ index 48707d1..f72e0da 100644 /* Send out a packet. */ result = send_packet (client -> interface, (struct packet *)0, -@@ -2239,10 +2279,10 @@ void send_release (cpp) +@@ -2661,10 +2703,10 @@ void send_release (cpp) return; } @@ -144,6 +136,3 @@ index 48707d1..f72e0da 100644 if (fallback_interface) result = send_packet (fallback_interface, --- -1.7.9.3 - diff --git a/net-misc/dhcp/files/dhcp-4.2.0-lpf-ib.patch b/net-misc/dhcp/files/dhcp-4.2.2-lpf-ib.patch index ac5fa837f..4034028b8 100644 --- a/net-misc/dhcp/files/dhcp-4.2.0-lpf-ib.patch +++ b/net-misc/dhcp/files/dhcp-4.2.2-lpf-ib.patch @@ -1,26 +1,34 @@ -From fbc0a6667fe7ca44a5185b00be2c0cbfae10d61d Mon Sep 17 00:00:00 2001 -From: Alexey Shvetsov <alexxy@gentoo.org> -Date: Thu, 15 Mar 2012 23:18:21 +0400 -Subject: [PATCH 2/3] lpf ib - ---- - client/dhclient.c | 31 ++++++++ - common/bpf.c | 39 +++++++++- - common/dlpi.c | 4 +- - common/lpf.c | 225 ++++++++++++++++++++++++++++++++++++++++++++--------- - common/socket.c | 4 +- - includes/dhcp.h | 1 + - includes/dhcpd.h | 3 +- - 7 files changed, 266 insertions(+), 41 deletions(-) - -diff --git a/client/dhclient.c b/client/dhclient.c -index f72e0da..138b563 100644 ---- a/client/dhclient.c -+++ b/client/dhclient.c -@@ -100,6 +100,29 @@ static int check_domain_name_list(const char *ptr, size_t len, int dots); +diff -up dhcp-4.2.2/client/dhclient.c.lpf-ib dhcp-4.2.2/client/dhclient.c +--- dhcp-4.2.2/client/dhclient.c.lpf-ib 2011-09-19 11:24:08.693775799 +0200 ++++ dhcp-4.2.2/client/dhclient.c 2011-09-19 11:24:08.703775541 +0200 +@@ -113,6 +113,8 @@ static int check_domain_name_list(const static int check_option_values(struct universe *universe, unsigned int opt, const char *ptr, size_t len); ++static void setup_ib_interface(struct interface_info *ip); ++ + int + main(int argc, char **argv) { + int fd; +@@ -919,6 +921,14 @@ main(int argc, char **argv) { + } + srandom(seed + cur_time + (unsigned)getpid()); + ++ /* Setup specific Infiniband options */ ++ for (ip = interfaces; ip; ip = ip->next) { ++ if (ip->client && ++ (ip->hw_address.hbuf[0] == HTYPE_INFINIBAND)) { ++ setup_ib_interface(ip); ++ } ++ } ++ + /* Start a configuration state machine for each interface. */ + #ifdef DHCPv6 + if (local_family == AF_INET6) { +@@ -1195,6 +1205,29 @@ int find_subnet (struct subnet **sp, + return 0; + } + +static void setup_ib_interface(struct interface_info *ip) +{ + struct group *g; @@ -44,37 +52,12 @@ index f72e0da..138b563 100644 + log_fatal("dhcp-client-identifier must be specified for InfiniBand"); +} + - int - main(int argc, char **argv) { - int fd; -@@ -603,6 +626,14 @@ main(int argc, char **argv) { - } else - srandom(seed + cur_time + (unsigned)getpid()); - -+ /* Setup specific Infiniband options */ -+ for (ip = interfaces; ip; ip = ip->next) { -+ if (ip->client && -+ (ip->hw_address.hbuf[0] == HTYPE_INFINIBAND)) { -+ setup_ib_interface(ip); -+ } -+ } -+ - /* Start a configuration state machine for each interface. */ - #ifdef DHCPv6 - if (local_family == AF_INET6) { -diff --git a/common/bpf.c b/common/bpf.c -index b0ef657..90289ec 100644 ---- a/common/bpf.c -+++ b/common/bpf.c -@@ -116,7 +116,7 @@ int if_register_bpf (info) - log_fatal ("Can't attach interface %s to bpf device %s: %m", - info -> name, filename); - -- get_hw_addr(info->name, &info->hw_address); -+ get_hw_addr(info); - - return sock; - } + /* Individual States: + * + * Each routine is called from the dhclient_state_machine() in one of +diff -up dhcp-4.2.2/common/bpf.c.lpf-ib dhcp-4.2.2/common/bpf.c +--- dhcp-4.2.2/common/bpf.c.lpf-ib 2011-09-19 11:24:08.694775773 +0200 ++++ dhcp-4.2.2/common/bpf.c 2011-09-19 11:24:08.704775516 +0200 @@ -198,11 +198,44 @@ struct bpf_insn dhcp_bpf_filter [] = { BPF_STMT(BPF_RET+BPF_K, 0), }; @@ -120,42 +103,18 @@ index b0ef657..90289ec 100644 #if defined (HAVE_TR_SUPPORT) struct bpf_insn dhcp_bpf_tr_filter [] = { /* accept all token ring packets due to variable length header */ -@@ -552,7 +585,9 @@ void maybe_setup_fallback () - } - - void --get_hw_addr(const char *name, struct hardware *hw) { -+get_hw_addr(struct interface_info *info) { -+ struct hardware *hw = &info->hw_address; -+ char *name = info->name; - struct ifaddrs *ifa; - struct ifaddrs *p; - struct sockaddr_dl *sa; -diff --git a/common/dlpi.c b/common/dlpi.c -index 8f2c73d..619271f 100644 ---- a/common/dlpi.c -+++ b/common/dlpi.c -@@ -1332,7 +1332,9 @@ void maybe_setup_fallback () - #endif /* USE_DLPI_SEND */ - - void --get_hw_addr(const char *name, struct hardware *hw) { -+get_hw_addr(struct interface_info *info) { -+ struct hardware *hw = &info->hw_address; -+ char *name = info->name; - int sock, unit; - long buf[DLPI_MAXDLBUF]; - union DL_primitives *dlp; -diff --git a/common/lpf.c b/common/lpf.c -index 16eecc9..488df88 100644 ---- a/common/lpf.c -+++ b/common/lpf.c -@@ -41,10 +41,20 @@ +diff -up dhcp-4.2.2/common/lpf.c.lpf-ib dhcp-4.2.2/common/lpf.c +--- dhcp-4.2.2/common/lpf.c.lpf-ib 2011-09-19 11:24:08.694775773 +0200 ++++ dhcp-4.2.2/common/lpf.c 2011-09-19 11:26:15.107109935 +0200 +@@ -42,6 +42,7 @@ #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" #include <net/if.h> +#include <ifaddrs.h> + #ifndef PACKET_AUXDATA + #define PACKET_AUXDATA 8 +@@ -59,6 +60,15 @@ struct tpacket_auxdata /* Reinitializes the specified interface after an address change. This is not required for packet-filter APIs. */ @@ -171,24 +130,23 @@ index 16eecc9..488df88 100644 #ifdef USE_LPF_SEND void if_reinitialize_send (info) struct interface_info *info; -@@ -67,11 +77,22 @@ int if_register_lpf (info) - struct interface_info *info; - { - int sock; +@@ -86,10 +96,21 @@ int if_register_lpf (info) + struct sockaddr common; + } sa; + struct ifreq ifr; + int type; + int protocol; - struct sockaddr sa; /* Make an LPF socket. */ -- if ((sock = socket(PF_PACKET, SOCK_PACKET, +- if ((sock = socket(PF_PACKET, SOCK_RAW, - htons((short)ETH_P_ALL))) < 0) { + get_hw_addr(info); + + if (info->hw_address.hbuf[0] == HTYPE_INFINIBAND) { -+ type = SOCK_DGRAM; ++ type = SOCK_DGRAM; + protocol = ETHERTYPE_IP; + } else { -+ type = SOCK_RAW; ++ type = SOCK_RAW; + protocol = ETH_P_ALL; + } + @@ -196,15 +154,15 @@ index 16eecc9..488df88 100644 if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || errno == EAFNOSUPPORT || errno == EINVAL) { -@@ -88,6 +109,7 @@ int if_register_lpf (info) +@@ -112,6 +133,7 @@ int if_register_lpf (info) /* Bind to the interface name */ memset (&sa, 0, sizeof sa); - sa.sa_family = AF_PACKET; + sa.ll.sll_family = AF_PACKET; + sa.ll.sll_protocol = htons(protocol); - strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); - if (bind (sock, &sa, sizeof sa)) { + sa.ll.sll_ifindex = ifr.ifr_ifindex; + if (bind (sock, &sa.common, sizeof sa)) { if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || -@@ -103,8 +125,6 @@ int if_register_lpf (info) +@@ -127,8 +149,6 @@ int if_register_lpf (info) log_fatal ("Bind socket to interface: %m"); } @@ -213,7 +171,7 @@ index 16eecc9..488df88 100644 return sock; } #endif /* USE_LPF_SEND || USE_LPF_RECEIVE */ -@@ -159,6 +179,8 @@ void if_deregister_send (info) +@@ -183,6 +203,8 @@ void if_deregister_send (info) in bpf includes... */ extern struct sock_filter dhcp_bpf_filter []; extern int dhcp_bpf_filter_len; @@ -222,7 +180,26 @@ index 16eecc9..488df88 100644 #if defined (HAVE_TR_SUPPORT) extern struct sock_filter dhcp_bpf_tr_filter []; -@@ -217,15 +239,28 @@ static void lpf_gen_filter_setup (info) +@@ -200,11 +222,13 @@ void if_register_receive (info) + /* Open a LPF device and hang it on this interface... */ + info -> rfdesc = if_register_lpf (info); + +- val = 1; +- if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA, &val, +- sizeof val) < 0) { +- if (errno != ENOPROTOOPT) +- log_fatal ("Failed to set auxiliary packet data: %m"); ++ if (info->hw_address.hbuf[0] != HTYPE_INFINIBAND) { ++ val = 1; ++ if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA, ++ &val, sizeof val) < 0) { ++ if (errno != ENOPROTOOPT) ++ log_fatal ("Failed to set auxiliary packet data: %m"); ++ } + } + + #if defined (HAVE_TR_SUPPORT) +@@ -250,15 +274,28 @@ static void lpf_gen_filter_setup (info) memset(&p, 0, sizeof(p)); @@ -260,7 +237,7 @@ index 16eecc9..488df88 100644 if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p, sizeof p) < 0) { -@@ -282,6 +317,54 @@ static void lpf_tr_filter_setup (info) +@@ -315,6 +352,54 @@ static void lpf_tr_filter_setup (info) #endif /* USE_LPF_RECEIVE */ #ifdef USE_LPF_SEND @@ -315,7 +292,7 @@ index 16eecc9..488df88 100644 ssize_t send_packet (interface, packet, raw, len, from, to, hto) struct interface_info *interface; struct packet *packet; -@@ -303,6 +386,11 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) +@@ -335,6 +420,11 @@ ssize_t send_packet (interface, packet, return send_fallback (interface, packet, raw, len, from, to, hto); @@ -327,7 +304,7 @@ index 16eecc9..488df88 100644 if (hto == NULL && interface->anycast_mac_addr.hlen) hto = &interface->anycast_mac_addr; -@@ -334,6 +422,46 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) +@@ -356,6 +446,42 @@ ssize_t send_packet (interface, packet, #endif /* USE_LPF_SEND */ #ifdef USE_LPF_RECEIVE @@ -346,10 +323,6 @@ index 16eecc9..488df88 100644 + + length = read(interface->rfdesc, ibuf, sizeof(ibuf)); + -+ if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) { -+ return receive_packet_ib(interface, buf, len, from, hfrom); -+ } -+ + if (length <= 0) + return length; + @@ -374,7 +347,18 @@ index 16eecc9..488df88 100644 ssize_t receive_packet (interface, buf, len, from, hfrom) struct interface_info *interface; unsigned char *buf; -@@ -419,33 +547,42 @@ void maybe_setup_fallback () +@@ -382,6 +508,10 @@ ssize_t receive_packet (interface, buf, + }; + struct cmsghdr *cmsg; + ++ if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) { ++ return receive_packet_ib(interface, buf, len, from, hfrom); ++ } ++ + length = recvmsg (interface -> rfdesc, &msg, 0); + if (length <= 0) + return length; +@@ -462,33 +592,44 @@ void maybe_setup_fallback () } void @@ -395,12 +379,15 @@ index 16eecc9..488df88 100644 - } + if (getifaddrs(&ifaddrs) == -1) + log_fatal("Failed to get interfaces"); -+ -+ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { - sock = socket(AF_INET, SOCK_DGRAM, 0); - if (sock < 0) { - log_fatal("Can't create socket for \"%s\": %m", name); ++ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { ++ ++ if (ifa->ifa_addr == NULL) ++ continue; ++ + if (ifa->ifa_addr->sa_family != AF_PACKET) + continue; + @@ -421,7 +408,6 @@ index 16eecc9..488df88 100644 + if (sll == NULL) { + freeifaddrs(ifaddrs); + log_fatal("Failed to get HW address for %s\n", name); -+ } - sa = &tmp.ifr_hwaddr; @@ -435,7 +421,7 @@ index 16eecc9..488df88 100644 break; case ARPHRD_IEEE802: #ifdef ARPHRD_IEEE802_TR -@@ -453,18 +590,36 @@ get_hw_addr(const char *name, struct hardware *hw) { +@@ -496,18 +637,35 @@ get_hw_addr(const char *name, struct har #endif /* ARPHRD_IEEE802_TR */ hw->hlen = 7; hw->hbuf[0] = HTYPE_IEEE802; @@ -465,6 +451,19 @@ index 16eecc9..488df88 100644 + hw->hlen = 1; + hw->hbuf[0] = HTYPE_INFINIBAND; break; + #if defined(ARPHRD_PPP) + case ARPHRD_PPP: + if (local_family != AF_INET6) +- log_fatal("Unsupported device type %d for \"%s\"", +- sa->sa_family, name); ++ log_fatal("Unsupported device type %ld for \"%s\"", ++ (long int)sll->sll_family, name); + hw->hlen = 0; + hw->hbuf[0] = HTYPE_RESERVED; + /* 0xdeadbeef should never occur on the wire, +@@ -520,10 +678,11 @@ get_hw_addr(const char *name, struct har + break; + #endif default: + freeifaddrs(ifaddrs); log_fatal("Unsupported device type %ld for \"%s\"", @@ -476,10 +475,9 @@ index 16eecc9..488df88 100644 + freeifaddrs(ifaddrs); } #endif -diff --git a/common/socket.c b/common/socket.c -index a48404b..3fe8b75 100644 ---- a/common/socket.c -+++ b/common/socket.c +diff -up dhcp-4.2.2/common/socket.c.lpf-ib dhcp-4.2.2/common/socket.c +--- dhcp-4.2.2/common/socket.c.lpf-ib 2011-06-27 18:18:20.000000000 +0200 ++++ dhcp-4.2.2/common/socket.c 2011-09-19 11:24:08.705775490 +0200 @@ -324,7 +324,7 @@ void if_register_send (info) info->wfdesc = if_register_socket(info, AF_INET, 0); /* If this is a normal IPv4 address, get the hardware address. */ @@ -489,7 +487,16 @@ index a48404b..3fe8b75 100644 #if defined (USE_SOCKET_FALLBACK) /* Fallback only registers for send, but may need to receive as well. */ -@@ -497,7 +497,7 @@ if_register6(struct interface_info *info, int do_multicast) { +@@ -387,7 +387,7 @@ void if_register_receive (info) + #endif /* IP_PKTINFO... */ + /* If this is a normal IPv4 address, get the hardware address. */ + if (strcmp(info->name, "fallback") != 0) +- get_hw_addr(info->name, &info->hw_address); ++ get_hw_addr(info); + + if (!quiet_interface_discovery) + log_info ("Listening on Socket/%s%s%s", +@@ -497,7 +497,7 @@ if_register6(struct interface_info *info if (req_multi) if_register_multicast(info); @@ -498,23 +505,10 @@ index a48404b..3fe8b75 100644 if (!quiet_interface_discovery) { if (info->shared_network != NULL) { -diff --git a/includes/dhcp.h b/includes/dhcp.h -index 1af2adf..722c661 100644 ---- a/includes/dhcp.h -+++ b/includes/dhcp.h -@@ -79,6 +79,7 @@ struct dhcp_packet { - #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ - #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ - #define HTYPE_FDDI 8 /* FDDI... */ -+#define HTYPE_INFINIBAND 32 /* Infiniband IPoIB */ - - /* Magic cookie validating dhcp options field (and bootp vendor - extensions field). */ -diff --git a/includes/dhcpd.h b/includes/dhcpd.h -index 863a149..5a137e6 100644 ---- a/includes/dhcpd.h -+++ b/includes/dhcpd.h -@@ -1239,6 +1239,7 @@ struct interface_info { +diff -up dhcp-4.2.2/includes/dhcpd.h.lpf-ib dhcp-4.2.2/includes/dhcpd.h +--- dhcp-4.2.2/includes/dhcpd.h.lpf-ib 2011-09-19 11:24:08.696775721 +0200 ++++ dhcp-4.2.2/includes/dhcpd.h 2011-09-19 11:24:08.707775438 +0200 +@@ -1243,6 +1243,7 @@ struct interface_info { struct shared_network *shared_network; /* Networks connected to this interface. */ struct hardware hw_address; /* Its physical address. */ @@ -522,7 +516,7 @@ index 863a149..5a137e6 100644 struct in_addr *addresses; /* Addresses associated with this * interface. */ -@@ -2355,7 +2356,7 @@ void print_dns_status (int, struct dhcp_ddns_cb *, isc_result_t); +@@ -2356,7 +2357,7 @@ void print_dns_status (int, struct dhcp_ #endif const char *print_time(TIME); @@ -531,6 +525,14 @@ index 863a149..5a137e6 100644 /* socket.c */ #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \ --- -1.7.9.3 - +diff -up dhcp-4.2.2/includes/dhcp.h.lpf-ib dhcp-4.2.2/includes/dhcp.h +--- dhcp-4.2.2/includes/dhcp.h.lpf-ib 2011-09-19 11:24:08.696775721 +0200 ++++ dhcp-4.2.2/includes/dhcp.h 2011-09-19 11:24:08.707775438 +0200 +@@ -79,6 +79,7 @@ struct dhcp_packet { + #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ + #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ + #define HTYPE_FDDI 8 /* FDDI... */ ++#define HTYPE_INFINIBAND 32 /* Infiniband IPoIB */ + + #define HTYPE_RESERVED 0 /* RFC 5494 */ + |