From 71bbe2c0272130e5e7b796f4d30290a1ddb4d2db5e0af02f08d8929ca54b4480 Mon Sep 17 00:00:00 2001 From: Philipp Thomas Date: Wed, 10 Dec 2014 13:04:15 +0000 Subject: [PATCH] - Modify 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch as detailed in bnc#870535 instead of adding yet another patch. OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=142 --- 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch | 78 ++++++++++---------- dhcp.changes | 6 ++ 2 files changed, 45 insertions(+), 39 deletions(-) diff --git a/0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch b/0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch index bf54368..720c545 100644 --- a/0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch +++ b/0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch @@ -4,18 +4,18 @@ Date: Tue, 25 Mar 2014 23:15:58 +0200 Subject: [PATCH 1/2] dhcp 4.2.6 lpf ip over ib support --- - client/dhclient.c | 31 +++++++ - common/bpf.c | 33 ++++++++ - common/lpf.c | 236 +++++++++++++++++++++++++++++++++++++++++++++--------- - common/socket.c | 8 +- - includes/dhcpd.h | 3 +- - 5 files changed, 266 insertions(+), 45 deletions(-) + client/dhclient.c | 31 +++++++ + common/bpf.c | 33 +++++++ + common/lpf.c | 239 ++++++++++++++++++++++++++++++++++++++++++++---------- + common/socket.c | 8 - + includes/dhcpd.h | 3 + 5 files changed, 269 insertions(+), 45 deletions(-) -diff --git a/client/dhclient.c b/client/dhclient.c -index 8af0a42..f7dfbef 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); +Index: dhcp-4.2.6/client/dhclient.c +=================================================================== +--- dhcp-4.2.6.orig/client/dhclient.c 2014-12-10 13:24:48.679081338 +0100 ++++ dhcp-4.2.6/client/dhclient.c 2014-12-10 13:25:34.226013202 +0100 +@@ -100,6 +100,29 @@ static int check_domain_name_list(const static int check_option_values(struct universe *universe, unsigned int opt, const char *ptr, size_t len); @@ -60,10 +60,10 @@ index 8af0a42..f7dfbef 100644 /* 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 076d9bc..124281b 100644 ---- a/common/bpf.c -+++ b/common/bpf.c +Index: dhcp-4.2.6/common/bpf.c +=================================================================== +--- dhcp-4.2.6.orig/common/bpf.c 2014-12-10 13:24:48.664081690 +0100 ++++ dhcp-4.2.6/common/bpf.c 2014-12-10 13:24:48.703080775 +0100 @@ -198,11 +198,44 @@ struct bpf_insn dhcp_bpf_filter [] = { BPF_STMT(BPF_RET+BPF_K, 0), }; @@ -109,10 +109,10 @@ index 076d9bc..124281b 100644 #if defined (HAVE_TR_SUPPORT) struct bpf_insn dhcp_bpf_tr_filter [] = { /* accept all token ring packets due to variable length header */ -diff --git a/common/lpf.c b/common/lpf.c -index 6639809..a428870 100644 ---- a/common/lpf.c -+++ b/common/lpf.c +Index: dhcp-4.2.6/common/lpf.c +=================================================================== +--- dhcp-4.2.6.orig/common/lpf.c 2014-12-10 13:24:48.647082088 +0100 ++++ dhcp-4.2.6/common/lpf.c 2014-12-10 13:27:33.789208756 +0100 @@ -43,6 +43,7 @@ #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" @@ -299,7 +299,7 @@ index 6639809..a428870 100644 ssize_t send_packet (interface, packet, raw, len, from, to, hto) struct interface_info *interface; struct packet *packet; -@@ -335,6 +420,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); @@ -311,7 +311,7 @@ index 6639809..a428870 100644 if (hto == NULL && interface->anycast_mac_addr.hlen) hto = &interface->anycast_mac_addr; -@@ -356,6 +446,42 @@ 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 @@ -354,7 +354,7 @@ index 6639809..a428870 100644 ssize_t receive_packet (interface, buf, len, from, hfrom) struct interface_info *interface; unsigned char *buf; -@@ -382,6 +508,10 @@ ssize_t receive_packet (interface, buf, len, from, hfrom) +@@ -382,6 +508,10 @@ ssize_t receive_packet (interface, buf, }; struct cmsghdr *cmsg; @@ -365,7 +365,7 @@ index 6639809..a428870 100644 length = recvmsg (interface -> rfdesc, &msg, 0); if (length <= 0) return length; -@@ -462,33 +592,41 @@ void maybe_setup_fallback () +@@ -462,33 +592,44 @@ void maybe_setup_fallback () } void @@ -386,11 +386,14 @@ index 6639809..a428870 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) ++ continue; + + if (ifa->ifa_addr->sa_family != AF_PACKET) + continue; @@ -425,7 +428,7 @@ index 6639809..a428870 100644 break; case ARPHRD_IEEE802: #ifdef ARPHRD_IEEE802_TR -@@ -496,18 +634,36 @@ get_hw_addr(const char *name, struct hardware *hw) { +@@ -496,18 +637,36 @@ get_hw_addr(const char *name, struct har #endif /* ARPHRD_IEEE802_TR */ hw->hlen = 7; hw->hbuf[0] = HTYPE_IEEE802; @@ -466,10 +469,10 @@ index 6639809..a428870 100644 + freeifaddrs(ifaddrs); } #endif -diff --git a/common/socket.c b/common/socket.c -index e111d82..04c86e3 100644 ---- a/common/socket.c -+++ b/common/socket.c +Index: dhcp-4.2.6/common/socket.c +=================================================================== +--- dhcp-4.2.6.orig/common/socket.c 2014-01-31 20:35:09.000000000 +0100 ++++ dhcp-4.2.6/common/socket.c 2014-12-10 13:24:48.703080775 +0100 @@ -322,7 +322,7 @@ void if_register_send (info) info->wfdesc = if_register_socket(info, AF_INET, 0, NULL); /* If this is a normal IPv4 address, get the hardware address. */ @@ -488,7 +491,7 @@ index e111d82..04c86e3 100644 if (!quiet_interface_discovery) log_info ("Listening on Socket/%s%s%s", -@@ -499,7 +499,7 @@ if_register6(struct interface_info *info, int do_multicast) { +@@ -499,7 +499,7 @@ if_register6(struct interface_info *info if (req_multi) if_register_multicast(info); @@ -497,7 +500,7 @@ index e111d82..04c86e3 100644 if (!quiet_interface_discovery) { if (info->shared_network != NULL) { -@@ -555,7 +555,7 @@ if_register_linklocal6(struct interface_info *info) { +@@ -555,7 +555,7 @@ if_register_linklocal6(struct interface_ info->rfdesc = sock; info->wfdesc = sock; @@ -506,10 +509,10 @@ index e111d82..04c86e3 100644 if (!quiet_interface_discovery) { if (info->shared_network != NULL) { -diff --git a/includes/dhcpd.h b/includes/dhcpd.h -index 68262e9..a52992b 100644 ---- a/includes/dhcpd.h -+++ b/includes/dhcpd.h +Index: dhcp-4.2.6/includes/dhcpd.h +=================================================================== +--- dhcp-4.2.6.orig/includes/dhcpd.h 2014-12-10 13:24:48.648082065 +0100 ++++ dhcp-4.2.6/includes/dhcpd.h 2014-12-10 13:25:34.042017517 +0100 @@ -1217,6 +1217,7 @@ struct interface_info { struct shared_network *shared_network; /* Networks connected to this interface. */ @@ -518,7 +521,7 @@ index 68262e9..a52992b 100644 struct in_addr *addresses; /* Addresses associated with this * interface. */ -@@ -2346,7 +2347,7 @@ void print_dns_status (int, struct dhcp_ddns_cb *, isc_result_t); +@@ -2346,7 +2347,7 @@ void print_dns_status (int, struct dhcp_ #endif const char *print_time(TIME); @@ -527,6 +530,3 @@ index 68262e9..a52992b 100644 /* socket.c */ #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \ --- -1.7.12.4 - diff --git a/dhcp.changes b/dhcp.changes index 7f82d5d..8a22e17 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Dec 10 13:29:38 CET 2014 - pth@suse.de + +- Modify 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch as detailed + in bnc#870535 instead of adding yet another patch. + ------------------------------------------------------------------- Thu Nov 20 11:43:07 UTC 2014 - mt@suse.de