diff --git a/.cvsignore b/.cvsignore index dc88f8d..c2ae9d1 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -dhcp-3.0.5.tar.gz +dhcp-3.0.6.tar.gz diff --git a/dhcp-3.0.5-memory.patch b/dhcp-3.0.5-memory.patch deleted file mode 100644 index 803fb8c..0000000 --- a/dhcp-3.0.5-memory.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- dhcp-3.0.5/common/packet.c.memory 2005-03-03 11:55:23.000000000 -0500 -+++ dhcp-3.0.5/common/packet.c 2007-03-30 17:11:06.000000000 -0400 -@@ -140,6 +140,7 @@ - struct ip ip; - struct udphdr udp; - -+ memset( &ip, '\0', sizeof ip); - /* Fill out the IP header */ - IP_V_SET (&ip, 4); - IP_HL_SET (&ip, 20); -@@ -219,7 +220,7 @@ - { - unsigned char *data; - struct ip ip; -- struct udphdr *udp; -+ struct udphdr udph, *udp=&udph; - u_int32_t ip_len = (buf [bufix] & 0xf) << 2; - u_int32_t sum, usum; - static int ip_packets_seen; -@@ -233,7 +234,7 @@ - int ignore = 0; - - memcpy(&ip, buf + bufix, sizeof (struct ip)); -- udp = (struct udphdr *)(buf + bufix + ip_len); -+ memcpy(udp, buf + bufix + ip_len, sizeof(struct udphdr)); - - #ifdef USERLAND_FILTER - /* Is it a UDP packet? */ ---- dhcp-3.0.5/common/lpf.c.memory 2007-03-30 17:11:06.000000000 -0400 -+++ dhcp-3.0.5/common/lpf.c 2007-03-30 17:11:55.000000000 -0400 -@@ -246,6 +246,7 @@ - struct interface_info *info; - { - struct sock_fprog p; -+ memset(&p,'\0', sizeof(struct sock_fprog)); - - /* Set up the bpf filter program structure. This is defined in - bpf.c */ ---- dhcp-3.0.5/minires/ns_name.c.memory 2004-06-10 13:59:40.000000000 -0400 -+++ dhcp-3.0.5/minires/ns_name.c 2007-03-30 17:11:06.000000000 -0400 -@@ -71,6 +71,11 @@ - dn = dst; - eom = dst + dstsiz; - -+ if (dn >= eom) { -+ errno = EMSGSIZE; -+ return (-1); -+ } -+ - while ((n = *cp++) != 0) { - if ((n & NS_CMPRSFLGS) != 0) { - /* Some kind of compression pointer. */ diff --git a/dhcp-3.0.5-version.patch b/dhcp-3.0.5-version.patch deleted file mode 100644 index 8a28a95..0000000 --- a/dhcp-3.0.5-version.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- dhcp-3.0.5/includes/version.h.version 2006-10-26 18:19:38.000000000 -0400 -+++ dhcp-3.0.5/includes/version.h 2006-11-10 11:16:04.000000000 -0500 -@@ -1,3 +1,3 @@ - /* Current version of ISC DHCP Distribution. */ - --#define DHCP_VERSION "V3.0.5" -+#define DHCP_VERSION "V3.0.5-RedHat" diff --git a/dhcp-3.0.5-xen-checksum.patch b/dhcp-3.0.5-xen-checksum.patch deleted file mode 100644 index 8eada53..0000000 --- a/dhcp-3.0.5-xen-checksum.patch +++ /dev/null @@ -1,242 +0,0 @@ ---- dhcp-3.0.5/common/bpf.c.xen 2004-11-24 12:39:15.000000000 -0500 -+++ dhcp-3.0.5/common/bpf.c 2007-03-30 16:34:45.000000000 -0400 -@@ -478,7 +478,8 @@ - interface -> rbuf, - interface -> rbuf_offset, - from, -- hdr.bh_caplen); -+ hdr.bh_caplen, -+ 0); - - /* If the IP or UDP checksum was bad, skip the packet... */ - if (offset < 0) { ---- dhcp-3.0.5/common/dlpi.c.xen 2004-11-24 12:39:15.000000000 -0500 -+++ dhcp-3.0.5/common/dlpi.c 2007-03-30 16:34:45.000000000 -0400 -@@ -679,7 +679,7 @@ - length -= offset; - #endif - offset = decode_udp_ip_header (interface, dbuf, bufix, -- from, length); -+ from, length, 0); - - /* If the IP or UDP checksum was bad, skip the packet... */ - if (offset < 0) { ---- dhcp-3.0.5/common/lpf.c.xen 2007-03-30 16:34:26.000000000 -0400 -+++ dhcp-3.0.5/common/lpf.c 2007-03-30 16:34:45.000000000 -0400 -@@ -34,16 +34,31 @@ - #include "dhcpd.h" - #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) - #include -+#include - #include - - #include - #include - #include -+#include - #include - #include "includes/netinet/ip.h" - #include "includes/netinet/udp.h" - #include "includes/netinet/if_ether.h" - -+#ifndef PACKET_AUXDATA -+#define PACKET_AUXDATA 8 -+ -+struct tpacket_auxdata -+{ -+ __u32 tp_status; -+ __u32 tp_len; -+ __u32 tp_snaplen; -+ __u16 tp_mac; -+ __u16 tp_net; -+}; -+#endif -+ - /* Reinitializes the specified interface after an address change. This - is not required for packet-filter APIs. */ - -@@ -69,10 +84,14 @@ - struct interface_info *info; - { - int sock; -- struct sockaddr sa; -+ union { -+ struct sockaddr_ll ll; -+ struct sockaddr common; -+ } sa; -+ struct ifreq ifr; - - /* Make an LPF socket. */ -- if ((sock = socket(PF_PACKET, SOCK_PACKET, -+ if ((sock = socket(PF_PACKET, SOCK_RAW, - htons((short)ETH_P_ALL))) < 0) { - if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || - errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || -@@ -87,11 +106,16 @@ - log_fatal ("Open a socket for LPF: %m"); - } - -+ memset (&ifr, 0, sizeof ifr); -+ strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name); -+ if (ioctl (sock, SIOCGIFINDEX, &ifr)) -+ log_fatal ("Failed to get interface index: %m"); -+ - /* Bind to the interface name */ - memset (&sa, 0, sizeof sa); -- sa.sa_family = AF_PACKET; -- strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); -- if (bind (sock, &sa, sizeof sa)) { -+ sa.ll.sll_family = AF_PACKET; -+ sa.ll.sll_ifindex = ifr.ifr_ifindex; -+ if (bind (sock, &sa.common, sizeof sa)) { - if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || - errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || - errno == EAFNOSUPPORT || errno == EINVAL) { -@@ -171,9 +195,18 @@ - void if_register_receive (info) - struct interface_info *info; - { -+ int val; -+ - /* 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 defined (HAVE_TR_SUPPORT) - if (info -> hw_address.hbuf [0] == HTYPE_IEEE802) - lpf_tr_filter_setup (info); -@@ -291,7 +324,6 @@ - double hh [16]; - double ih [1536 / sizeof (double)]; - unsigned char *buf = (unsigned char *)ih; -- struct sockaddr sa; - int result; - int fudge; - -@@ -309,15 +341,7 @@ - (unsigned char *)raw, len); - memcpy (buf + ibufp, raw, len); - -- /* For some reason, SOCK_PACKET sockets can't be connected, -- so we have to do a sentdo every time. */ -- memset (&sa, 0, sizeof sa); -- sa.sa_family = AF_PACKET; -- strncpy (sa.sa_data, -- (const char *)interface -> ifp, sizeof sa.sa_data); -- -- result = sendto (interface -> wfdesc, -- buf + fudge, ibufp + len - fudge, 0, &sa, sizeof sa); -+ result = write (interface -> wfdesc, buf + fudge, ibufp + len - fudge); - if (result < 0) - log_error ("send_packet: %m"); - return result; -@@ -334,13 +358,34 @@ - { - int length = 0; - int offset = 0; -+ int nocsum = 0; - unsigned char ibuf [1536]; - unsigned bufix = 0; -+ unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))]; -+ struct iovec iov = { -+ .iov_base = ibuf, -+ .iov_len = sizeof ibuf, -+ }; -+ struct msghdr msg = { -+ .msg_iov = &iov, -+ .msg_iovlen = 1, -+ .msg_control = cmsgbuf, -+ .msg_controllen = sizeof(cmsgbuf), -+ }; -+ struct cmsghdr *cmsg; - -- length = read (interface -> rfdesc, ibuf, sizeof ibuf); -+ length = recvmsg (interface -> rfdesc, &msg, 0); - if (length <= 0) - return length; - -+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { -+ if (cmsg->cmsg_level == SOL_PACKET && -+ cmsg->cmsg_type == PACKET_AUXDATA) { -+ struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg); -+ nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY; -+ } -+ } -+ - bufix = 0; - /* Decode the physical header... */ - offset = decode_hw_header (interface, ibuf, bufix, hfrom); -@@ -357,7 +402,7 @@ - - /* Decode the IP and UDP headers... */ - offset = decode_udp_ip_header (interface, ibuf, bufix, from, -- (unsigned)length); -+ (unsigned)length, nocsum); - - /* If the IP or UDP checksum was bad, skip the packet... */ - if (offset < 0) ---- dhcp-3.0.5/common/nit.c.xen 2004-11-24 12:39:15.000000000 -0500 -+++ dhcp-3.0.5/common/nit.c 2007-03-30 16:34:45.000000000 -0400 -@@ -370,7 +370,7 @@ - - /* Decode the IP and UDP headers... */ - offset = decode_udp_ip_header (interface, ibuf, bufix, -- from, length); -+ from, length, 0); - - /* If the IP or UDP checksum was bad, skip the packet... */ - if (offset < 0) ---- dhcp-3.0.5/common/packet.c.xen 2007-03-30 16:34:26.000000000 -0400 -+++ dhcp-3.0.5/common/packet.c 2007-03-30 16:34:45.000000000 -0400 -@@ -211,12 +211,13 @@ - - /* UDP header and IP header decoded together for convenience. */ - --ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen) -+ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen, nocsum) - struct interface_info *interface; - unsigned char *buf; - unsigned bufix; - struct sockaddr_in *from; - unsigned buflen; -+ int nocsum; - { - unsigned char *data; - struct ip ip; -@@ -319,7 +320,7 @@ - (u_int32_t)ulen)))); - - udp_packets_seen++; -- if (usum && usum != sum) { -+ if (!nocsum && usum && usum != sum) { - udp_packets_bad_checksum++; - if (udp_packets_seen > 4 && - (udp_packets_seen / udp_packets_bad_checksum) < 2) { ---- dhcp-3.0.5/common/upf.c.xen 2004-11-24 12:39:16.000000000 -0500 -+++ dhcp-3.0.5/common/upf.c 2007-03-30 16:34:45.000000000 -0400 -@@ -321,7 +321,7 @@ - - /* Decode the IP and UDP headers... */ - offset = decode_udp_ip_header (interface, ibuf, bufix, -- from, length); -+ from, length, 0); - - /* If the IP or UDP checksum was bad, skip the packet... */ - if (offset < 0) ---- dhcp-3.0.5/includes/dhcpd.h.xen 2007-03-30 16:34:26.000000000 -0400 -+++ dhcp-3.0.5/includes/dhcpd.h 2007-03-30 16:34:45.000000000 -0400 -@@ -1988,7 +1988,7 @@ - unsigned, struct hardware *)); - ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *, - unsigned, struct sockaddr_in *, -- unsigned)); -+ unsigned, int)); - - /* ethernet.c */ - void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *, diff --git a/dhcp-3.0.6-memory.patch b/dhcp-3.0.6-memory.patch new file mode 100644 index 0000000..c08a429 --- /dev/null +++ b/dhcp-3.0.6-memory.patch @@ -0,0 +1,37 @@ +diff -up dhcp-3.0.6/minires/ns_name.c.memory dhcp-3.0.6/minires/ns_name.c +--- dhcp-3.0.6/minires/ns_name.c.memory 2004-06-10 13:59:40.000000000 -0400 ++++ dhcp-3.0.6/minires/ns_name.c 2007-07-10 11:43:29.000000000 -0400 +@@ -71,6 +71,11 @@ ns_name_ntop(const u_char *src, char *ds + dn = dst; + eom = dst + dstsiz; + ++ if (dn >= eom) { ++ errno = EMSGSIZE; ++ return (-1); ++ } ++ + while ((n = *cp++) != 0) { + if ((n & NS_CMPRSFLGS) != 0) { + /* Some kind of compression pointer. */ +diff -up dhcp-3.0.6/common/packet.c.memory dhcp-3.0.6/common/packet.c +--- dhcp-3.0.6/common/packet.c.memory 2007-05-01 16:42:55.000000000 -0400 ++++ dhcp-3.0.6/common/packet.c 2007-07-10 11:43:29.000000000 -0400 +@@ -140,6 +140,7 @@ void assemble_udp_ip_header (interface, + struct ip ip; + struct udphdr udp; + ++ memset( &ip, '\0', sizeof ip); + /* Fill out the IP header */ + IP_V_SET (&ip, 4); + IP_HL_SET (&ip, 20); +diff -up dhcp-3.0.6/common/lpf.c.memory dhcp-3.0.6/common/lpf.c +--- dhcp-3.0.6/common/lpf.c.memory 2007-07-10 11:43:29.000000000 -0400 ++++ dhcp-3.0.6/common/lpf.c 2007-07-10 11:43:29.000000000 -0400 +@@ -246,6 +246,7 @@ static void lpf_tr_filter_setup (info) + struct interface_info *info; + { + struct sock_fprog p; ++ memset(&p,'\0', sizeof(struct sock_fprog)); + + /* Set up the bpf filter program structure. This is defined in + bpf.c */ diff --git a/dhcp-3.0.6-xen-checksum.patch b/dhcp-3.0.6-xen-checksum.patch new file mode 100644 index 0000000..d180441 --- /dev/null +++ b/dhcp-3.0.6-xen-checksum.patch @@ -0,0 +1,243 @@ +diff -up dhcp-3.0.6/includes/dhcpd.h.xen dhcp-3.0.6/includes/dhcpd.h +--- dhcp-3.0.6/includes/dhcpd.h.xen 2007-07-10 11:50:22.000000000 -0400 ++++ dhcp-3.0.6/includes/dhcpd.h 2007-07-10 14:03:52.000000000 -0400 +@@ -1985,7 +1985,7 @@ ssize_t decode_hw_header PROTO ((struct + unsigned, struct hardware *)); + ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *, + unsigned, struct sockaddr_in *, +- unsigned, unsigned *)); ++ unsigned, unsigned *, int)); + + /* ethernet.c */ + void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *, +diff -up dhcp-3.0.6/common/bpf.c.xen dhcp-3.0.6/common/bpf.c +--- dhcp-3.0.6/common/bpf.c.xen 2007-05-01 16:42:55.000000000 -0400 ++++ dhcp-3.0.6/common/bpf.c 2007-07-10 14:04:24.000000000 -0400 +@@ -478,7 +478,7 @@ ssize_t receive_packet (interface, buf, + offset = decode_udp_ip_header (interface, + interface -> rbuf, + interface -> rbuf_offset, +- from, hdr.bh_caplen, &paylen); ++ from, hdr.bh_caplen, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) { +diff -up dhcp-3.0.6/common/dlpi.c.xen dhcp-3.0.6/common/dlpi.c +--- dhcp-3.0.6/common/dlpi.c.xen 2007-05-01 16:42:55.000000000 -0400 ++++ dhcp-3.0.6/common/dlpi.c 2007-07-10 14:04:36.000000000 -0400 +@@ -680,7 +680,7 @@ ssize_t receive_packet (interface, buf, + length -= offset; + #endif + offset = decode_udp_ip_header (interface, dbuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) { +diff -up dhcp-3.0.6/common/lpf.c.xen dhcp-3.0.6/common/lpf.c +--- dhcp-3.0.6/common/lpf.c.xen 2007-07-10 11:50:22.000000000 -0400 ++++ dhcp-3.0.6/common/lpf.c 2007-07-10 14:09:29.000000000 -0400 +@@ -34,16 +34,31 @@ static char copyright[] = + #include "dhcpd.h" + #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) + #include ++#include + #include + + #include + #include + #include ++#include + #include + #include "includes/netinet/ip.h" + #include "includes/netinet/udp.h" + #include "includes/netinet/if_ether.h" + ++#ifndef PACKET_AUXDATA ++#define PACKET_AUXDATA 8 ++ ++struct tpacket_auxdata ++{ ++ __u32 tp_status; ++ __u32 tp_len; ++ __u32 tp_snaplen; ++ __u16 tp_mac; ++ __u16 tp_net; ++}; ++#endif ++ + /* Reinitializes the specified interface after an address change. This + is not required for packet-filter APIs. */ + +@@ -69,10 +84,14 @@ int if_register_lpf (info) + struct interface_info *info; + { + int sock; +- struct sockaddr sa; ++ union { ++ struct sockaddr_ll ll; ++ struct sockaddr common; ++ } sa; ++ struct ifreq ifr; + + /* Make an LPF socket. */ +- if ((sock = socket(PF_PACKET, SOCK_PACKET, ++ if ((sock = socket(PF_PACKET, SOCK_RAW, + htons((short)ETH_P_ALL))) < 0) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || +@@ -87,11 +106,16 @@ int if_register_lpf (info) + log_fatal ("Open a socket for LPF: %m"); + } + ++ memset (&ifr, 0, sizeof ifr); ++ strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name); ++ if (ioctl (sock, SIOCGIFINDEX, &ifr)) ++ log_fatal ("Failed to get interface index: %m"); ++ + /* Bind to the interface name */ + memset (&sa, 0, sizeof sa); +- sa.sa_family = AF_PACKET; +- strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); +- if (bind (sock, &sa, sizeof sa)) { ++ sa.ll.sll_family = AF_PACKET; ++ sa.ll.sll_ifindex = ifr.ifr_ifindex; ++ if (bind (sock, &sa.common, sizeof sa)) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT || errno == EINVAL) { +@@ -171,9 +195,18 @@ static void lpf_gen_filter_setup (struct + void if_register_receive (info) + struct interface_info *info; + { ++ int val; ++ + /* 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 defined (HAVE_TR_SUPPORT) + if (info -> hw_address.hbuf [0] == HTYPE_IEEE802) + lpf_tr_filter_setup (info); +@@ -292,7 +325,6 @@ ssize_t send_packet (interface, packet, + double hh [16]; + double ih [1536 / sizeof (double)]; + unsigned char *buf = (unsigned char *)ih; +- struct sockaddr sa; + int result; + int fudge; + +@@ -310,15 +342,7 @@ ssize_t send_packet (interface, packet, + (unsigned char *)raw, len); + memcpy (buf + ibufp, raw, len); + +- /* For some reason, SOCK_PACKET sockets can't be connected, +- so we have to do a sentdo every time. */ +- memset (&sa, 0, sizeof sa); +- sa.sa_family = AF_PACKET; +- strncpy (sa.sa_data, +- (const char *)interface -> ifp, sizeof sa.sa_data); +- +- result = sendto (interface -> wfdesc, +- buf + fudge, ibufp + len - fudge, 0, &sa, sizeof sa); ++ result = write (interface -> wfdesc, buf + fudge, ibufp + len - fudge); + if (result < 0) + log_error ("send_packet: %m"); + return result; +@@ -335,14 +359,35 @@ ssize_t receive_packet (interface, buf, + { + int length = 0; + int offset = 0; ++ int nocsum = 0; + unsigned char ibuf [1536]; + unsigned bufix = 0; + unsigned paylen; ++ unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))]; ++ struct iovec iov = { ++ .iov_base = ibuf, ++ .iov_len = sizeof ibuf, ++ }; ++ struct msghdr msg = { ++ .msg_iov = &iov, ++ .msg_iovlen = 1, ++ .msg_control = cmsgbuf, ++ .msg_controllen = sizeof(cmsgbuf), ++ }; ++ struct cmsghdr *cmsg; + +- length = read (interface -> rfdesc, ibuf, sizeof ibuf); ++ length = recvmsg (interface -> rfdesc, &msg, 0); + if (length <= 0) + return length; + ++ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { ++ if (cmsg->cmsg_level == SOL_PACKET && ++ cmsg->cmsg_type == PACKET_AUXDATA) { ++ struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg); ++ nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY; ++ } ++ } ++ + bufix = 0; + /* Decode the physical header... */ + offset = decode_hw_header (interface, ibuf, bufix, hfrom); +@@ -359,7 +404,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, from, +- (unsigned)length, &paylen); ++ (unsigned)length, &paylen, nocsum); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) +diff -up dhcp-3.0.6/common/nit.c.xen dhcp-3.0.6/common/nit.c +--- dhcp-3.0.6/common/nit.c.xen 2007-05-01 16:42:55.000000000 -0400 ++++ dhcp-3.0.6/common/nit.c 2007-07-10 14:05:16.000000000 -0400 +@@ -371,7 +371,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) +diff -up dhcp-3.0.6/common/packet.c.xen dhcp-3.0.6/common/packet.c +--- dhcp-3.0.6/common/packet.c.xen 2007-07-10 11:50:22.000000000 -0400 ++++ dhcp-3.0.6/common/packet.c 2007-07-10 14:06:24.000000000 -0400 +@@ -215,7 +215,7 @@ ssize_t + decode_udp_ip_header(struct interface_info *interface, + unsigned char *buf, unsigned bufix, + struct sockaddr_in *from, unsigned buflen, +- unsigned *rbuflen) ++ unsigned *rbuflen, int nocsum) + { + unsigned char *data; + struct ip ip; +@@ -326,7 +326,7 @@ decode_udp_ip_header(struct interface_in + 8, IPPROTO_UDP + ulen)))); + + udp_packets_seen++; +- if (usum && usum != sum) { ++ if (!nocsum && usum && usum != sum) { + udp_packets_bad_checksum++; + if (udp_packets_seen > 4 && + (udp_packets_seen / udp_packets_bad_checksum) < 2) { +diff -up dhcp-3.0.6/common/upf.c.xen dhcp-3.0.6/common/upf.c +--- dhcp-3.0.6/common/upf.c.xen 2007-05-01 16:42:56.000000000 -0400 ++++ dhcp-3.0.6/common/upf.c 2007-07-10 14:06:37.000000000 -0400 +@@ -322,7 +322,7 @@ ssize_t receive_packet (interface, buf, + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, +- from, length, &paylen); ++ from, length, &paylen, 0); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) diff --git a/dhcp.spec b/dhcp.spec index 987dd26..bc64dd1 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -7,10 +7,13 @@ # value to avoid any problems guessing what it might be during installation. %define workdir work.linux-2.2 +# The vendor name to append to the version number +%define vendor Fedora + Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent Name: dhcp -Version: 3.0.5 -Release: 37%{?dist} +Version: 3.0.6 +Release: 1%{?dist} Epoch: 12 License: ISC Group: System Environment/Daemons @@ -30,29 +33,27 @@ Source11: Makefile.dist Source12: dhcp4client.h Source13: libdhcp_control.h -Patch0: %{name}-3.0.5-version.patch -Patch1: %{name}-3.0.5-Makefile.patch -Patch2: %{name}-3.0.5-warnings.patch -Patch3: %{name}-3.0.5-extended-new-option-info.patch -Patch4: %{name}-3.0.5-errwarn-message.patch -Patch5: %{name}-3.0.5-ldap-configuration.patch -Patch6: %{name}-3.0.5-memory.patch -Patch7: %{name}-3.0.5-options.patch -Patch8: %{name}-3.0.5-release-by-ifup.patch -Patch9: %{name}-3.0.5-dhclient-decline-backoff.patch -Patch10: %{name}-3.0.5-enable-timeout-functions.patch -Patch11: %{name}-3.0.5-inherit-leases.patch -Patch12: %{name}-3.0.5-selinux.patch -Patch13: %{name}-3.0.5-unicast-bootp.patch -Patch14: %{name}-3.0.5-fast-timeout.patch -Patch15: %{name}-3.0.5-failover-ports.patch -Patch16: %{name}-3.0.5-dhclient-usage.patch -Patch17: %{name}-3.0.5-default-requested-options.patch -Patch18: %{name}-3.0.5-prototypes.patch -Patch19: %{name}-3.0.5-manpages.patch -Patch20: %{name}-3.0.5-libdhcp4client.patch -Patch21: %{name}-3.0.5-xen-checksum.patch -Patch22: %{name}-3.0.5-dhclient-anycast.patch +Patch0: %{name}-3.0.5-Makefile.patch +Patch5: %{name}-3.0.5-warnings.patch +Patch10: %{name}-3.0.5-extended-new-option-info.patch +Patch15: %{name}-3.0.5-errwarn-message.patch +Patch20: %{name}-3.0.5-ldap-configuration.patch +Patch25: %{name}-3.0.6-memory.patch +Patch30: %{name}-3.0.5-options.patch +Patch35: %{name}-3.0.5-release-by-ifup.patch +Patch40: %{name}-3.0.5-dhclient-decline-backoff.patch +Patch45: %{name}-3.0.5-enable-timeout-functions.patch +Patch50: %{name}-3.0.5-inherit-leases.patch +Patch55: %{name}-3.0.5-unicast-bootp.patch +Patch60: %{name}-3.0.5-fast-timeout.patch +Patch65: %{name}-3.0.5-failover-ports.patch +Patch70: %{name}-3.0.5-dhclient-usage.patch +Patch75: %{name}-3.0.5-default-requested-options.patch +Patch80: %{name}-3.0.5-prototypes.patch +Patch85: %{name}-3.0.5-manpages.patch +Patch90: %{name}-3.0.5-libdhcp4client.patch +Patch95: %{name}-3.0.6-xen-checksum.patch +Patch100: %{name}-3.0.5-dhclient-anycast.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: groff openldap-devel @@ -141,74 +142,72 @@ libdhcp4client. %prep %setup -q -# Add -RedHat to the version number -%patch0 -p1 -b .version +# Add vendor to the version number +%{__sed} -e 's|V%{version}|V%{version}-%{vendor}|g' includes/version.h > includes/version.h.new +%{__mv} includes/version.h.new includes/version.h # Use $(MAKE) and $(CC) in the Makefiles -%patch1 -p1 -b .Makefile +%patch0 -p1 -b .Makefile # Fix up anything that fails -Wall -Werror -%patch2 -p1 -b .warnings +%patch5 -p1 -b .warnings # Extended new option info patch. Adds the -x option to dhclient, which is # needed for dhcdbd and NetworkManager -%patch3 -p1 -b .enoi +%patch10 -p1 -b .enoi # Replace the standard ISC warning message about requesting help with an # explanation that this is a patched build of ISC DHCP and bugs should be # reported through bugzilla.redhat.com -%patch4 -p1 -b .message +%patch15 -p1 -b .message # Add support for dhcpd.conf data in LDAP -%patch5 -p1 -b .ldap +%patch20 -p1 -b .ldap # Fix memory alignment and initialization problems in common/packet.c # Fix buffer overflow in minires library # Init struct sock_prog in common/lpf.c to NULL -%patch6 -p1 -b .memory +%patch25 -p1 -b .memory # Add more dhclient options (-I, -B, -H, -F, -T, -V, and -R) -%patch7 -p1 -b .options +%patch30 -p1 -b .options # Handle releasing interfaces requested by /sbin/ifup # pid file is assumed to be /var/run/dhclient-$interface.pid -%patch8 -p1 -b .release +%patch35 -p1 -b .release # If we receive a DHCP offer in dhclient and it's DECLINEd in dhclient-script, # backoff for an amount of time before trying again -%patch9 -p1 -b .decline +%patch40 -p1 -b .decline # Enable cancel_all_timeouts() and relinquish_timeouts() regardless of # the DEBUG_MEMORY_LEAKAGE_ON_EXIT macro -%patch10 -p1 -b .etf +%patch45 -p1 -b .etf # Inherit active leases -%patch11 -p1 -b .inherit - -# Close lease file before exec to fix SELinux error message -%patch12 -p1 -b .selinux +%patch50 -p1 -b .inherit # Support unicast BOOTP for IBM pSeries systems (and maybe others) -%patch13 -p1 -b .unicast +%patch55 -p1 -b .unicast # Fast timeout for dhclient -%patch14 -p1 -b .fast +%patch60 -p1 -b .fast # Use the following IANA-registered failover ports: # dhcp-failover 647/tcp # dhcp-failover 647/udp # dhcp-failover 847/tcp # dhcp-failover 847/udp -%patch15 -p1 -b .failover +%patch65 -p1 -b .failover # Update the usage screen for dhclient(8) indicating new options # Use printf() rather than log_info() to display the information # Also, return EXIT_FAILURE when the usage() screen is displayed (stop parsing) -%patch16 -p1 -b .usage +%patch70 -p1 -b .usage # Add NIS domain, NIS servers, and NTP servers to the list of default # requested DHCP options -%patch17 -p1 -b .dho +%patch75 -p1 -b .dho # Add missing prototypes to take care of gcc warnings # in dst/dst_api.c: add b64_pton() and b64_ntop() @@ -217,7 +216,7 @@ libdhcp4client. # in minires/res_comp.c: add ns_name_uncompress(), ns_name_compress(), and # ns_name_skip() # in minires/res_init.c: add res_randomid() -%patch18 -p1 -b .prototypes +%patch80 -p1 -b .prototypes # Man page updates explaining new features added from the above patches. # Normally these man page changes would be included in the feature patch, @@ -227,16 +226,16 @@ libdhcp4client. # and not affect the code changes in the other patches. It's actually # pretty common to update or alter these man pages independent of the code # changes. -%patch19 -p1 -b .manpages +%patch85 -p1 -b .manpages # Add the libdhcp4client target (library version of dhclient) -%patch20 -p1 -b .libdhcp4client +%patch90 -p1 -b .libdhcp4client # Handle Xen partial UDP checksums -%patch21 -p1 -b .xen +%patch95 -p1 -b .xen # Add anycast support to dhclient (for OLPC) -%patch22 -p1 -b .anycast +%patch100 -p1 -b .anycast # Copy in documentation and example scripts for LDAP patch to dhcpd %{__install} -p -m 0644 %SOURCE6 . @@ -434,6 +433,10 @@ fi %{_libdir}/libdhcp4client.a %changelog +* Tue Jul 10 2007 David Cantrell - 12:3.0.6-1 +- Upgrade to ISC dhcp-3.0.6 +- Remove the -TERM option from killproc command (#245317) + * Wed Jun 20 2007 David Cantrell - 12:3.0.5-37 - For init script functions, echo new line after OK or FAIL msg (#244956) diff --git a/dhcpd.init b/dhcpd.init index 9f324df..bec2836 100644 --- a/dhcpd.init +++ b/dhcpd.init @@ -60,7 +60,7 @@ start() { stop() { echo -n $"Shutting down $prog: " - killproc $prog -TERM + killproc $prog RETVAL=$? echo [ $RETVAL = 0 ] && rm -f $lockfile diff --git a/sources b/sources index 872be31..b9ed0bb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ce5d30d4645e4eab1f54561b487d1ec7 dhcp-3.0.5.tar.gz +724bad21ad8b638abadd5fcc07df1a0f dhcp-3.0.6.tar.gz