This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via 78522c1003b3ea3ab03c277ac80fe8e55fead87a (commit) via 0c039bf2175f85465f0030f2c7956927f779f814 (commit) via f3a8f771101d189fed7866f66a7957376d0ec515 (commit) via a175b6bb8c17ff355808221831c739f1bd175a68 (commit) via 177b938ab7c92b3ee6217161e4ab03609f98a6c1 (commit) from c5fd0a55806e0a65a38f9e3a8e0a80aeda277cb5 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 78522c1003b3ea3ab03c277ac80fe8e55fead87a Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jun 16 11:48:36 2013 +0200
keepalived: Update to 1.2.7.
commit 0c039bf2175f85465f0030f2c7956927f779f814 Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jun 16 11:44:21 2013 +0200
net-snmp: Don't remove RPATHs so agressively.
The net-snmp libs and binaries need to find libperl.so.
Fixes #10333.
commit f3a8f771101d189fed7866f66a7957376d0ec515 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jun 15 15:27:26 2013 +0200
iproute2: Rebuild because of iptables library bump.
commit a175b6bb8c17ff355808221831c739f1bd175a68 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jun 15 15:26:43 2013 +0200
iptables: Update to 1.4.19.1.
commit 177b938ab7c92b3ee6217161e4ab03609f98a6c1 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jun 15 14:48:09 2013 +0200
dhcp: Update to 4.2.5.
-----------------------------------------------------------------------
Summary of changes: dhcp/dhcp.nm | 38 ++-- .../dhcp-4.2.0-missing-ipv6-not-fatal.patch | 40 ---- dhcp/patches/dhcp-4.2.2-CLOEXEC.patch | 21 --- dhcp/patches/dhcp-4.2.2-dhclient-usage.patch | 14 -- dhcp/patches/dhcp-4.2.2-sharedlib.patch | 94 ---------- dhcp/patches/dhcp-4.2.3-paranoia.patch | 49 ----- ....4-P1-dhclient6-leases_semicolon_expected.patch | 41 ----- .../dhcp-4.2.4-P2-conflex-do-forward-updates.patch | 12 ++ dhcp/patches/dhcp-4.2.4-P2-dupl-key.patch | 13 ++ ...ons.patch => dhcp-4.2.4-dhclient-options.patch} | 156 ++++++++++++++-- dhcp/patches/dhcp-4.2.4-getifaddrs.patch | 42 +++-- dhcp/patches/dhcp-4.2.4-paths.patch | 12 ++ .../{dhcp-4.2.4-PPP.patch => dhcp-4.2.5-PPP.patch} | 2 +- ...-4.2.4-lpf-ib.patch => dhcp-4.2.5-lpf-ib.patch} | 56 +++--- ....1-manpages.patch => dhcp-4.2.5-manpages.patch} | 157 +++------------- dhcp/patches/dhcp-4.2.5-next-server.patch | 72 ++++++++ dhcp/patches/dhcp-4.2.5-paranoia.patch | 202 +++++++++++++++++++++ dhcp/patches/dhcp-4.2.5-range6.patch | 42 +++++ ...ove-bind.patch => dhcp-4.2.5-remove-bind.patch} | 87 +++++---- ...cp-4.2.5-rfc3442-classless-static-routes.patch} | 92 +++++----- ...-rfc5970-dhcpv6-options-for-network-boot.patch} | 28 +-- ...dDecline.patch => dhcp-4.2.5-sendDecline.patch} | 22 +-- dhcp/patches/dhcp-4.2.5-sharedlib.patch | 120 ++++++++++++ ...-systemtap.patch => dhcp-4.2.5-systemtap.patch} | 166 +++++++++-------- dhcp/patches/dhcp-4.2.5b1-atf-pkgconfig.patch | 23 +++ iproute2/iproute2.nm | 4 +- iptables/iptables.nm | 2 +- keepalived/keepalived.nm | 11 +- .../patches/keepalived-1.1.14-installmodules.patch | 20 -- .../keepalived-1.1.19-fix-ipvs-loading.patch | 12 -- .../patches/keepalived-1.2.2-ip_vs.h-pathfix.patch | 12 -- .../keepalived-1.2.7-dont-respawn-children.patch | 109 +++++++++++ .../keepalived-1.2.7-fix-error-message.patch | 40 ++++ ...-1.2.7-fix-pointer-arithmetic-vrrp-packet.patch | 32 ++++ ...d-1.2.7-fix-primary-ip-address-comparison.patch | 34 ++++ ...keepalived-1.2.7-fix-ssl-certificate-load.patch | 34 ++++ .../keepalived-1.2.7-remove-debug-messages.patch | 46 +++++ .../keepalived-1.2.7-update-gpl-license.patch | 146 +++++++++++++++ ...epalived-1.2.7-update-keepalived-man-page.patch | 201 ++++++++++++++++++++ keepalived/systemd/keepalived.service | 2 + net-snmp/net-snmp.nm | 8 +- 41 files changed, 1610 insertions(+), 704 deletions(-) delete mode 100644 dhcp/patches/dhcp-4.2.0-missing-ipv6-not-fatal.patch delete mode 100644 dhcp/patches/dhcp-4.2.2-dhclient-usage.patch delete mode 100644 dhcp/patches/dhcp-4.2.2-sharedlib.patch delete mode 100644 dhcp/patches/dhcp-4.2.3-paranoia.patch delete mode 100644 dhcp/patches/dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch create mode 100644 dhcp/patches/dhcp-4.2.4-P2-conflex-do-forward-updates.patch create mode 100644 dhcp/patches/dhcp-4.2.4-P2-dupl-key.patch rename dhcp/patches/{dhcp-4.2.4-options.patch => dhcp-4.2.4-dhclient-options.patch} (72%) rename dhcp/patches/{dhcp-4.2.4-PPP.patch => dhcp-4.2.5-PPP.patch} (99%) rename dhcp/patches/{dhcp-4.2.4-lpf-ib.patch => dhcp-4.2.5-lpf-ib.patch} (89%) rename dhcp/patches/{dhcp-4.2.1-manpages.patch => dhcp-4.2.5-manpages.patch} (54%) create mode 100644 dhcp/patches/dhcp-4.2.5-next-server.patch create mode 100644 dhcp/patches/dhcp-4.2.5-paranoia.patch create mode 100644 dhcp/patches/dhcp-4.2.5-range6.patch rename dhcp/patches/{dhcp-4.2.2-remove-bind.patch => dhcp-4.2.5-remove-bind.patch} (51%) rename dhcp/patches/{dhcp-4.2.4-rfc3442-classless-static-routes.patch => dhcp-4.2.5-rfc3442-classless-static-routes.patch} (79%) rename dhcp/patches/{dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch => dhcp-4.2.5-rfc5970-dhcpv6-options-for-network-boot.patch} (72%) rename dhcp/patches/{dhcp-4.2.1-sendDecline.patch => dhcp-4.2.5-sendDecline.patch} (89%) create mode 100644 dhcp/patches/dhcp-4.2.5-sharedlib.patch rename dhcp/patches/{dhcp-4.2.4-systemtap.patch => dhcp-4.2.5-systemtap.patch} (77%) create mode 100644 dhcp/patches/dhcp-4.2.5b1-atf-pkgconfig.patch delete mode 100644 keepalived/patches/keepalived-1.1.14-installmodules.patch delete mode 100644 keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch delete mode 100644 keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch create mode 100644 keepalived/patches/keepalived-1.2.7-dont-respawn-children.patch create mode 100644 keepalived/patches/keepalived-1.2.7-fix-error-message.patch create mode 100644 keepalived/patches/keepalived-1.2.7-fix-pointer-arithmetic-vrrp-packet.patch create mode 100644 keepalived/patches/keepalived-1.2.7-fix-primary-ip-address-comparison.patch create mode 100644 keepalived/patches/keepalived-1.2.7-fix-ssl-certificate-load.patch create mode 100644 keepalived/patches/keepalived-1.2.7-remove-debug-messages.patch create mode 100644 keepalived/patches/keepalived-1.2.7-update-gpl-license.patch create mode 100644 keepalived/patches/keepalived-1.2.7-update-keepalived-man-page.patch
Difference in files: diff --git a/dhcp/dhcp.nm b/dhcp/dhcp.nm index 407873b..1d15f65 100644 --- a/dhcp/dhcp.nm +++ b/dhcp/dhcp.nm @@ -4,8 +4,8 @@ ###############################################################################
name = dhcp -version = 4.2.4 -release = 2 +version = 4.2.5 +release = 1
groups = Networking/Daemons url = http://isc.org/products/DHCP/ @@ -24,45 +24,47 @@ source_dl = ftp://ftp.isc.org/isc/dhcp/%{version}/
# Apply patches in a special order. patches = \ - dhcp-4.2.2-remove-bind.patch \ + dhcp-4.2.5-remove-bind.patch \ dhcp-4.2.4-P1-remove-dst.patch \ dhcp-4.2.0-errwarn-message.patch \ - dhcp-4.2.4-options.patch \ + dhcp-4.2.4-dhclient-options.patch \ dhcp-4.2.0-release-by-ifup.patch \ dhcp-4.2.0-dhclient-decline-backoff.patch \ dhcp-4.2.4-unicast-bootp.patch \ - dhcp-4.2.2-dhclient-usage.patch \ dhcp-4.2.0-default-requested-options.patch \ dhcp-4.2.2-xen-checksum.patch \ - dhcp-4.2.1-manpages.patch \ + dhcp-4.2.5-manpages.patch \ dhcp-4.2.4-paths.patch \ dhcp-4.2.2-CLOEXEC.patch \ dhcp-4.2.0-garbage-chars.patch \ - dhcp-4.2.0-missing-ipv6-not-fatal.patch \ dhcp-4.2.0-add_timeout_when_NULL.patch \ dhcp-4.2.4-64_bit_lease_parse.patch \ dhcp-4.2.2-capability.patch \ dhcp-4.2.0-logpid.patch \ dhcp-4.2.4-UseMulticast.patch \ - dhcp-4.2.1-sendDecline.patch \ + dhcp-4.2.5-sendDecline.patch \ dhcp-4.2.1-retransmission.patch \ - dhcp-4.2.4-rfc3442-classless-static-routes.patch \ + dhcp-4.2.5-rfc3442-classless-static-routes.patch \ dhcp-4.2.0-honor-expired.patch \ - dhcp-4.2.2-sharedlib.patch \ - dhcp-4.2.4-PPP.patch \ - dhcp-4.2.3-paranoia.patch \ - dhcp-4.2.4-lpf-ib.patch \ + dhcp-4.2.5-sharedlib.patch \ + dhcp-4.2.5-PPP.patch \ + dhcp-4.2.5-paranoia.patch \ + dhcp-4.2.5-lpf-ib.patch \ dhcp-4.2.4-improved-xid.patch \ dhcp-4.2.2-gpxe-cid.patch \ - dhcp-4.2.4-systemtap.patch \ + dhcp-4.2.5-systemtap.patch \ dhcp-4.2.3-dhclient-decline-onetry.patch \ dhcp-4.2.3-P2-log_perror.patch \ dhcp-4.2.4-getifaddrs.patch \ dhcp-4.2.4-send_release.patch \ - dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch \ - dhcp-4.2.4-failOverPeer.patch \ - dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch \ - dhcp-4.2.4-P1-interval.patch + dhcp-4.2.5-rfc5970-dhcpv6-options-for-network-boot.patch \ + dhcp-4.2.4-failOverPeer.patch \ + dhcp-4.2.5b1-atf-pkgconfig.patch \ + dhcp-4.2.4-P1-interval.patch \ + dhcp-4.2.4-P2-conflex-do-forward-updates.patch \ + dhcp-4.2.4-P2-dupl-key.patch \ + dhcp-4.2.5-range6.patch \ + dhcp-4.2.5-next-server.patch
build requires diff --git a/dhcp/patches/dhcp-4.2.0-missing-ipv6-not-fatal.patch b/dhcp/patches/dhcp-4.2.0-missing-ipv6-not-fatal.patch deleted file mode 100644 index b604115..0000000 --- a/dhcp/patches/dhcp-4.2.0-missing-ipv6-not-fatal.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -up dhcp-4.2.0/common/discover.c.noipv6 dhcp-4.2.0/common/discover.c ---- dhcp-4.2.0/common/discover.c.noipv6 2010-07-21 14:31:13.000000000 +0200 -+++ dhcp-4.2.0/common/discover.c 2010-07-21 16:04:57.000000000 +0200 -@@ -443,7 +443,7 @@ begin_iface_scan(struct iface_conf_list - } - - #ifdef DHCPv6 -- if (local_family == AF_INET6) { -+ if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) { - ifaces->fp6 = fopen("/proc/net/if_inet6", "re"); - if (ifaces->fp6 == NULL) { - log_error("Error opening '/proc/net/if_inet6' to " -@@ -454,6 +454,8 @@ begin_iface_scan(struct iface_conf_list - ifaces->fp = NULL; - return 0; - } -+ } else { -+ ifaces->fp6 = NULL; - } - #endif - -@@ -721,7 +723,7 @@ next_iface(struct iface_info *info, int - return 1; - } - #ifdef DHCPv6 -- if (!(*err)) { -+ if (!(*err) && ifaces->fp6) { - if (local_family == AF_INET6) - return next_iface6(info, err, ifaces); - } -@@ -740,7 +742,8 @@ end_iface_scan(struct iface_conf_list *i - ifaces->sock = -1; - #ifdef DHCPv6 - if (local_family == AF_INET6) { -- fclose(ifaces->fp6); -+ if (ifaces->fp6) -+ fclose(ifaces->fp6); - ifaces->fp6 = NULL; - } - #endif diff --git a/dhcp/patches/dhcp-4.2.1-manpages.patch b/dhcp/patches/dhcp-4.2.1-manpages.patch deleted file mode 100644 index 9a42b7f..0000000 --- a/dhcp/patches/dhcp-4.2.1-manpages.patch +++ /dev/null @@ -1,264 +0,0 @@ -diff -up dhcp-4.2.1b1/client/dhclient.8.man dhcp-4.2.1b1/client/dhclient.8 ---- dhcp-4.2.1b1/client/dhclient.8.man 2010-07-14 22:09:34.000000000 +0200 -+++ dhcp-4.2.1b1/client/dhclient.8 2011-01-27 18:19:07.000000000 +0100 -@@ -115,6 +115,33 @@ dhclient - Dynamic Host Configuration Pr - .B -w - ] - [ -+.B -B -+] -+[ -+.B -I -+.I dhcp-client-identifier -+] -+[ -+.B -H -+.I host-name -+] -+[ -+.B -F -+.I fqdn.fqdn -+] -+[ -+.B -V -+.I vendor-class-identifier -+] -+[ -+.B -R -+.I request-option-list -+] -+[ -+.B -timeout -+.I timeout -+] -+[ - .B -v - ] - [ -@@ -264,6 +291,69 @@ not to exit when it doesn't find any suc - program can then be used to notify the client when a network interface - has been added or removed, so that the client can attempt to configure an IP - address on that interface. -+ -+.TP -+.BI -B -+Set the BOOTP broadcast flag in request packets so servers will always -+broadcast replies. -+ -+.TP -+.BI -I\ <dhcp-client-identifier> -+Specify the dhcp-client-identifier option to send to the DHCP server. -+ -+.TP -+.BI -H\ <host-name> -+Specify the host-name option to send to the DHCP server. The host-name -+string only contains the client's hostname prefix, to which the server will -+append the ddns-domainname or domain-name options, if any, to derive the -+fully qualified domain name of the client. The -+.B -H -+option cannot be used with the -+.B -F -+option. -+ -+.TP -+.BI -F\ <fqdn.fqdn> -+Specify the fqdn.fqdn option to send to the DHCP server. This option cannot -+be used with the -+.B -H -+option. The fqdn.fqdn option must specify the complete domain name of the -+client host, which the server may use for dynamic DNS updates. -+ -+.TP -+.BI -V\ <vendor-class-identifier> -+Specify the vendor-class-identifier option to send to the DHCP server. -+ -+.TP -+.BI -R\ <option>[,<option>...] -+Specify the list of options the client is to request from the server. The -+option list must be a single string consisting of option names separated -+by at least one command and optional space characters. The default option -+list is: -+ -+.BR -+ subnet-mask, broadcast-address, time-offset, routers, -+.BR -+ domain-search, domain-name, domain-name-servers, host-name, -+.BR -+ nis-domain, nis-servers, ntp-servers, interface-mtu -+ -+.TP -+.B -R -+option does not append options to the default request, it overrides the -+default request list. Keep this in mind if you want to request an -+additional option besides the default request list. You will have to -+specify all option names for the -+.B -R -+parameter. -+ -+.TP -+.BI -timeout\ <timeout> -+Specify the time after which -+.B dhclient -+will decide that no DHCP servers can be contacted when no responses have been -+received. -+ - .TP - .BI -n - Do not configure any interfaces. This is most likely to be useful in -diff -up dhcp-4.2.1b1/client/dhclient.conf.5.man dhcp-4.2.1b1/client/dhclient.conf.5 ---- dhcp-4.2.1b1/client/dhclient.conf.5.man 2010-09-15 01:03:56.000000000 +0200 -+++ dhcp-4.2.1b1/client/dhclient.conf.5 2011-01-27 18:22:56.000000000 +0100 -@@ -186,7 +186,8 @@ responding to the client send the client - options. Only the option names should be specified in the request - statement - not option parameters. By default, the DHCPv4 client - requests the subnet-mask, broadcast-address, time-offset, routers, --domain-name, domain-name-servers and host-name options while the DHCPv6 -+domain-search, domain-name, domain-name-servers, host-name, nis-domain, -+nis-servers, ntp-servers and interface-mtu options while the DHCPv6 - client requests the dhcp6 name-servers and domain-search options. Note - that if you enter a 'request' statement, you over-ride these defaults - and these options will not be requested. -@@ -672,6 +673,17 @@ know the DHCP service(s) anycast MAC add - client. The \fIlink-type\fR and \fImac-address\fR parameters are configured - in a similar manner to the \fBhardware\fR statement. - .PP -+ \fBbootp-broadcast-always;\fR -+.PP -+The -+.B bootp-broadcast-always -+statement instructs dhclient to always set the bootp broadcast flag in -+request packets, so that servers will always broadcast replies. -+This is equivalent to supplying the dhclient -B argument, and has -+the same effect as specifying 'always-broadcast' in the server's dhcpd.conf. -+This option is provided as an extension to enable dhclient to work -+on IBM s390 Linux guests. -+.PP - .SH SAMPLE - The following configuration file is used on a laptop running NetBSD - 1.3. The laptop has an IP alias of 192.5.5.213, and has one -@@ -697,7 +709,7 @@ interface "ep0" { - supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com"; - prepend domain-name-servers 127.0.0.1; - request subnet-mask, broadcast-address, time-offset, routers, -- domain-name, domain-name-servers, host-name; -+ domain-search, domain-name, domain-name-servers, host-name; - require subnet-mask, domain-name-servers; - script "CLIENTBINDIR/dhclient-script"; - media "media 10baseT/UTP", "media 10base2/BNC"; -diff -up dhcp-4.2.1b1/client/dhclient-script.8.man dhcp-4.2.1b1/client/dhclient-script.8 ---- dhcp-4.2.1b1/client/dhclient-script.8.man 2010-07-06 21:03:11.000000000 +0200 -+++ dhcp-4.2.1b1/client/dhclient-script.8 2011-01-27 18:24:44.000000000 +0100 -@@ -47,7 +47,7 @@ customizations are needed, they should b - exit hooks provided (see HOOKS for details). These hooks will allow the - user to override the default behaviour of the client in creating a - .B /etc/resolv.conf --file. -+file, and to handle DHCP options not handled by default. - .PP - No standard client script exists for some operating systems, even though - the actual client may work, so a pioneering user may well need to create -@@ -91,6 +91,26 @@ present. The - .B ETCDIR/dhclient-exit-hooks - script can modify the valid of exit_status to change the exit status - of dhclient-script. -+.PP -+Immediately after dhclient brings an interface UP with a new IP address, -+subnet mask, and routes, in the REBOOT/BOUND states, it will check for the -+existence of an executable -+.B ETCDIR/dhclient-up-hooks -+script, and source it if found. This script can handle DHCP options in -+the environment that are not handled by default. A per-interface. -+.B ETCDIR/dhclient-${IF}-up-hooks -+script will override the generic script and be sourced when interface -+$IF has been brought up. -+.PP -+Immediately before dhclient brings an interface DOWN, removing its IP -+address, subnet mask, and routes, in the STOP/RELEASE states, it will -+check for the existence of an executable -+.B ETCDIR/dhclient-down-hooks -+script, and source it if found. This script can handle DHCP options in -+the environment that are not handled by default. A per-interface -+.B ETCDIR/dhclient-${IF}-down-hooks -+script will override the generic script and be sourced when interface -+$IF is about to be brought down. - .SH OPERATION - When dhclient needs to invoke the client configuration script, it - defines a set of variables in the environment, and then invokes -diff -up dhcp-4.2.1b1/common/dhcp-options.5.man dhcp-4.2.1b1/common/dhcp-options.5 ---- dhcp-4.2.1b1/common/dhcp-options.5.man 2010-07-13 22:56:56.000000000 +0200 -+++ dhcp-4.2.1b1/common/dhcp-options.5 2011-01-27 18:25:57.000000000 +0100 -@@ -913,6 +913,21 @@ classless IP routing - it does not inclu - classless IP routing is now the most widely deployed routing standard, - this option is virtually useless, and is not implemented by any of the - popular DHCP clients, for example the Microsoft DHCP client. -+.PP -+NOTE to Fedora dhclient users: -+.br -+dhclient-script interprets trailing 0 octets of the target as indicating -+the subnet class of the route, so for the following static-routes value: -+.br -+ option static-routes 172.0.0.0 172.16.2.254, -+.br -+ 192.168.0.0 192.168.2.254; -+.br -+dhclient-script will create routes: -+.br -+ 172/8 via 172.16.2.254 dev $interface -+.br -+ 192.168/16 via 192.168.2.254 dev $interface - .RE - .PP - .nf -diff -up dhcp-4.2.1b1/server/dhcpd.conf.5.man dhcp-4.2.1b1/server/dhcpd.conf.5 ---- dhcp-4.2.1b1/server/dhcpd.conf.5.man 2010-07-06 21:03:12.000000000 +0200 -+++ dhcp-4.2.1b1/server/dhcpd.conf.5 2011-01-27 18:29:12.000000000 +0100 -@@ -519,6 +519,9 @@ pool { - }; - .fi - .PP -+Dynamic BOOTP leases are not compatible with failover, and, as such, -+you need to disallow BOOTP in pools that you are using failover for. -+.PP - The server currently does very little sanity checking, so if you - configure it wrong, it will just fail in odd ways. I would recommend - therefore that you either do failover or don't do failover, but don't -@@ -533,9 +536,9 @@ primary server might look like this: - failover peer "foo" { - primary; - address anthrax.rc.vix.com; -- port 519; -+ port 647; - peer address trantor.rc.vix.com; -- peer port 520; -+ peer port 847; - max-response-delay 60; - max-unacked-updates 10; - mclt 3600; -@@ -1305,7 +1308,7 @@ the zone containing PTR records - for IS - .PP - .nf - key DHCP_UPDATER { -- algorithm HMAC-MD5.SIG-ALG.REG.INT; -+ algorithm hmac-md5; - secret pRP5FapFoJ95JEL06sv4PQ==; - }; - -@@ -1328,7 +1331,7 @@ dhcpd.conf file: - .PP - .nf - key DHCP_UPDATER { -- algorithm HMAC-MD5.SIG-ALG.REG.INT; -+ algorithm hmac-md5; - secret pRP5FapFoJ95JEL06sv4PQ==; - }; - -@@ -2540,7 +2543,8 @@ statement - The \fInext-server\fR statement is used to specify the host address of - the server from which the initial boot file (specified in the - \fIfilename\fR statement) is to be loaded. \fIServer-name\fR should --be a numeric IP address or a domain name. -+be a numeric IP address or a domain name. If no \fInext-server\fR statement -+applies to a given client, the address 0.0.0.0 is used. - .RE - .PP - The diff --git a/dhcp/patches/dhcp-4.2.1-sendDecline.patch b/dhcp/patches/dhcp-4.2.1-sendDecline.patch deleted file mode 100644 index b2fa4af..0000000 --- a/dhcp/patches/dhcp-4.2.1-sendDecline.patch +++ /dev/null @@ -1,231 +0,0 @@ -diff -up dhcp-4.2.1-P1/client/dhc6.c.sendDecline dhcp-4.2.1-P1/client/dhc6.c ---- dhcp-4.2.1-P1/client/dhc6.c.sendDecline 2010-09-10 22:27:11.000000000 +0200 -+++ dhcp-4.2.1-P1/client/dhc6.c 2011-06-17 14:19:48.992099868 +0200 -@@ -95,6 +95,8 @@ void do_select6(void *input); - void do_refresh6(void *input); - static void do_release6(void *input); - static void start_bound(struct client_state *client); -+static void start_decline6(struct client_state *client); -+static void do_decline6(void *input); - static void start_informed(struct client_state *client); - void informed_handler(struct packet *packet, struct client_state *client); - void bound_handler(struct packet *packet, struct client_state *client); -@@ -2075,6 +2077,7 @@ start_release6(struct client_state *clie - cancel_timeout(do_select6, client); - cancel_timeout(do_refresh6, client); - cancel_timeout(do_release6, client); -+ cancel_timeout(do_decline6, client); - client->state = S_STOPPED; - - /* -@@ -2708,6 +2711,7 @@ dhc6_check_reply(struct client_state *cl - break; - - case S_STOPPED: -+ case S_DECLINED: - action = dhc6_stop_action; - break; - -@@ -2809,6 +2813,7 @@ dhc6_check_reply(struct client_state *cl - break; - - case S_STOPPED: -+ case S_DECLINED: - /* Nothing critical to do at this stage. */ - break; - -@@ -3799,17 +3804,23 @@ reply_handler(struct packet *packet, str - cancel_timeout(do_select6, client); - cancel_timeout(do_refresh6, client); - cancel_timeout(do_release6, client); -+ cancel_timeout(do_decline6, client); - - /* If this is in response to a Release/Decline, clean up and return. */ -- if (client->state == S_STOPPED) { -- if (client->active_lease == NULL) -- return; -+ if ((client->state == S_STOPPED) || -+ (client->state == S_DECLINED)) { -+ -+ if (client->active_lease != NULL) { -+ dhc6_lease_destroy(&client->active_lease, MDL); -+ client->active_lease = NULL; -+ /* We should never wait for nothing!? */ -+ if (stopping_finished()) -+ exit(0); -+ } -+ -+ if (client->state == S_DECLINED) -+ start_init6(client); - -- dhc6_lease_destroy(&client->active_lease, MDL); -- client->active_lease = NULL; -- /* We should never wait for nothing!? */ -- if (stopping_finished()) -- exit(0); - return; - } - -@@ -4336,7 +4347,11 @@ start_bound(struct client_state *client) - oldia, oldaddr); - dhc6_marshall_values("new_", client, lease, ia, addr); - -- script_go(client); -+ // when script returns 3, DAD failed -+ if (script_go(client) == 3) { -+ start_decline6(client); -+ return; -+ } - } - - /* XXX: maybe we should loop on the old values instead? */ -@@ -4382,6 +4397,149 @@ start_bound(struct client_state *client) - dhc6_check_times(client); - } - -+/* -+ * Decline addresses. -+ */ -+void -+start_decline6(struct client_state *client) -+{ -+ /* Cancel any pending transmissions */ -+ cancel_timeout(do_confirm6, client); -+ cancel_timeout(do_select6, client); -+ cancel_timeout(do_refresh6, client); -+ cancel_timeout(do_release6, client); -+ cancel_timeout(do_decline6, client); -+ client->state = S_DECLINED; -+ -+ if (client->active_lease == NULL) -+ return; -+ -+ /* Set timers per RFC3315 section 18.1.7. */ -+ client->IRT = DEC_TIMEOUT * 100; -+ client->MRT = 0; -+ client->MRC = DEC_MAX_RC; -+ client->MRD = 0; -+ -+ dhc6_retrans_init(client); -+ client->v6_handler = reply_handler; -+ -+ client->refresh_type = DHCPV6_DECLINE; -+ do_decline6(client); -+} -+ -+/* -+ * do_decline6() creates a Decline packet and transmits it. -+ */ -+static void -+do_decline6(void *input) -+{ -+ struct client_state *client; -+ struct data_string ds; -+ int send_ret; -+ struct timeval elapsed, tv; -+ -+ client = input; -+ -+ if ((client->active_lease == NULL) || !active_prefix(client)) -+ return; -+ -+ if ((client->MRC != 0) && (client->txcount > client->MRC)) { -+ log_info("Max retransmission count exceeded."); -+ goto decline_done; -+ } -+ -+ /* -+ * Start_time starts at the first transmission. -+ */ -+ if (client->txcount == 0) { -+ client->start_time.tv_sec = cur_tv.tv_sec; -+ client->start_time.tv_usec = cur_tv.tv_usec; -+ } -+ -+ /* elapsed = cur - start */ -+ elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec; -+ elapsed.tv_usec = cur_tv.tv_usec - client->start_time.tv_usec; -+ if (elapsed.tv_usec < 0) { -+ elapsed.tv_sec -= 1; -+ elapsed.tv_usec += 1000000; -+ } -+ -+ memset(&ds, 0, sizeof(ds)); -+ if (!buffer_allocate(&ds.buffer, 4, MDL)) { -+ log_error("Unable to allocate memory for Decline."); -+ goto decline_done; -+ } -+ -+ ds.data = ds.buffer->data; -+ ds.len = 4; -+ ds.buffer->data[0] = DHCPV6_DECLINE; -+ memcpy(ds.buffer->data + 1, client->dhcpv6_transaction_id, 3); -+ -+ /* Form an elapsed option. */ -+ /* Maximum value is 65535 1/100s coded as 0xffff. */ -+ if ((elapsed.tv_sec < 0) || (elapsed.tv_sec > 655) || -+ ((elapsed.tv_sec == 655) && (elapsed.tv_usec > 350000))) { -+ client->elapsed = 0xffff; -+ } else { -+ client->elapsed = elapsed.tv_sec * 100; -+ client->elapsed += elapsed.tv_usec / 10000; -+ } -+ -+ client->elapsed = htons(client->elapsed); -+ -+ log_debug("XMT: Forming Decline."); -+ make_client6_options(client, &client->sent_options, -+ client->active_lease, DHCPV6_DECLINE); -+ dhcpv6_universe.encapsulate(&ds, NULL, NULL, client, NULL, -+ client->sent_options, &global_scope, -+ &dhcpv6_universe); -+ -+ /* Append IA's (but don't release temporary addresses). */ -+ if (wanted_ia_na && -+ dhc6_add_ia_na(client, &ds, client->active_lease, -+ DHCPV6_DECLINE) != ISC_R_SUCCESS) { -+ data_string_forget(&ds, MDL); -+ goto decline_done; -+ } -+ if (wanted_ia_pd && -+ dhc6_add_ia_pd(client, &ds, client->active_lease, -+ DHCPV6_DECLINE) != ISC_R_SUCCESS) { -+ data_string_forget(&ds, MDL); -+ goto decline_done; -+ } -+ -+ /* Transmit and wait. */ -+ log_info("XMT: Decline on %s, interval %ld0ms.", -+ client->name ? client->name : client->interface->name, -+ (long int)client->RT); -+ -+ send_ret = send_packet6(client->interface, ds.data, ds.len, -+ &DHCPv6DestAddr); -+ if (send_ret != ds.len) { -+ log_error("dhc6: sendpacket6() sent %d of %d bytes", -+ send_ret, ds.len); -+ } -+ -+ data_string_forget(&ds, MDL); -+ -+ /* Wait RT */ -+ tv.tv_sec = cur_tv.tv_sec + client->RT / 100; -+ tv.tv_usec = cur_tv.tv_usec + (client->RT % 100) * 10000; -+ if (tv.tv_usec >= 1000000) { -+ tv.tv_sec += 1; -+ tv.tv_usec -= 1000000; -+ } -+ add_timeout(&tv, do_decline6, client, NULL, NULL); -+ dhc6_retrans_advance(client); -+ return; -+ -+decline_done: -+ dhc6_lease_destroy(&client->active_lease, MDL); -+ client->active_lease = NULL; -+ start_init6(client); -+ return; -+} -+ - /* While bound, ignore packets. In the future we'll want to answer - * Reconfigure-Request messages and the like. - */ diff --git a/dhcp/patches/dhcp-4.2.2-CLOEXEC.patch b/dhcp/patches/dhcp-4.2.2-CLOEXEC.patch index 1198f77..1f4538e 100644 --- a/dhcp/patches/dhcp-4.2.2-CLOEXEC.patch +++ b/dhcp/patches/dhcp-4.2.2-CLOEXEC.patch @@ -133,27 +133,6 @@ diff -up dhcp-4.2.2b1/common/bpf.c.cloexec dhcp-4.2.2b1/common/bpf.c if (sock < 0) { if (errno == EBUSY) { continue; -diff -up dhcp-4.2.2b1/common/discover.c.cloexec dhcp-4.2.2b1/common/discover.c ---- dhcp-4.2.2b1/common/discover.c.cloexec 2011-06-27 18:18:20.000000000 +0200 -+++ dhcp-4.2.2b1/common/discover.c 2011-07-01 14:13:31.031887673 +0200 -@@ -421,7 +421,7 @@ begin_iface_scan(struct iface_conf_list - int len; - int i; - -- ifaces->fp = fopen("/proc/net/dev", "r"); -+ ifaces->fp = fopen("/proc/net/dev", "re"); - if (ifaces->fp == NULL) { - log_error("Error opening '/proc/net/dev' to list interfaces"); - return 0; -@@ -456,7 +456,7 @@ begin_iface_scan(struct iface_conf_list - - #ifdef DHCPv6 - if (local_family == AF_INET6) { -- ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); -+ ifaces->fp6 = fopen("/proc/net/if_inet6", "re"); - if (ifaces->fp6 == NULL) { - log_error("Error opening '/proc/net/if_inet6' to " - "list IPv6 interfaces; %m"); diff -up dhcp-4.2.2b1/common/dlpi.c.cloexec dhcp-4.2.2b1/common/dlpi.c --- dhcp-4.2.2b1/common/dlpi.c.cloexec 2011-07-01 14:13:30.977887712 +0200 +++ dhcp-4.2.2b1/common/dlpi.c 2011-07-01 14:13:31.032887673 +0200 diff --git a/dhcp/patches/dhcp-4.2.2-dhclient-usage.patch b/dhcp/patches/dhcp-4.2.2-dhclient-usage.patch deleted file mode 100644 index 0d41943..0000000 --- a/dhcp/patches/dhcp-4.2.2-dhclient-usage.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up dhcp-4.2.2b1/client/dhclient.c.usage dhcp-4.2.2b1/client/dhclient.c ---- dhcp-4.2.2b1/client/dhclient.c.usage 2011-07-01 13:55:16.000000000 +0200 -+++ dhcp-4.2.2b1/client/dhclient.c 2011-07-01 13:58:55.243800602 +0200 -@@ -1047,6 +1047,10 @@ static void usage() - " [-s server-addr] [-cf config-file] " - "[-lf lease-file]\n" - " [-pf pid-file] [--no-pid] [-e VAR=val]\n" -+ " [-I <dhcp-client-identifier>] [-B]\n" -+ " [-H <host-name> | -F <fqdn.fqdn>] [-timeout <timeout>]\n" -+ " [-V <vendor-class-identifier>]\n" -+ " [-R <request option list>]\n" - " [-sf script-file] [interface]"); - } - diff --git a/dhcp/patches/dhcp-4.2.2-remove-bind.patch b/dhcp/patches/dhcp-4.2.2-remove-bind.patch deleted file mode 100644 index 6297772..0000000 --- a/dhcp/patches/dhcp-4.2.2-remove-bind.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -up dhcp-4.2.2/client/Makefile.am.rh637017 dhcp-4.2.2/client/Makefile.am ---- dhcp-4.2.2/client/Makefile.am.rh637017 2010-09-15 00:32:36.000000000 +0200 -+++ dhcp-4.2.2/client/Makefile.am 2011-08-11 17:28:58.923897561 +0200 -@@ -5,7 +5,7 @@ dhclient_SOURCES = clparse.c dhclient.c - scripts/netbsd scripts/nextstep scripts/openbsd \ - scripts/solaris scripts/openwrt - dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -- ../bind/lib/libdns.a ../bind/lib/libisc.a -+ $(BIND9_LIBDIR) -ldns-export -lisc-export - man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 - EXTRA_DIST = $(man_MANS) - -diff -up dhcp-4.2.2/common/tests/Makefile.am.rh637017 dhcp-4.2.2/common/tests/Makefile.am ---- dhcp-4.2.2/common/tests/Makefile.am.rh637017 2009-10-28 05:12:30.000000000 +0100 -+++ dhcp-4.2.2/common/tests/Makefile.am 2011-08-11 17:33:45.258637236 +0200 -@@ -6,6 +6,5 @@ TESTS = test_alloc - - test_alloc_SOURCES = test_alloc.c - test_alloc_LDADD = ../libdhcp.a ../../tests/libt_api.a \ -- ../../omapip/libomapi.a ../../bind/lib/libdns.a \ -- ../../bind/lib/libisc.a -- -+ ../../omapip/libomapi.a \ -+ $(BIND9_LIBDIR) -ldns-export -lisc-export -diff -up dhcp-4.2.2/configure.ac.rh637017 dhcp-4.2.2/configure.ac ---- dhcp-4.2.2/configure.ac.rh637017 2011-07-20 02:32:18.000000000 +0200 -+++ dhcp-4.2.2/configure.ac 2011-08-11 17:28:58.924897535 +0200 -@@ -512,20 +512,37 @@ AC_CHECK_MEMBER(struct msghdr.msg_contro - libbind= - AC_ARG_WITH(libbind, - AC_HELP_STRING([--with-libbind=PATH], -- [bind includes and libraries are in PATH -- (default is ./bind)]), -+ [bind includes are in PATH -+ (default is ./bind/includes)]), - use_libbind="$withval", use_libbind="no") - case "$use_libbind" in -+yes|no) -+ libbind="${top_srcdir}/bind/include" -+ ;; -+*) -+ libbind="$use_libbind" -+ ;; -+esac -+ -+BIND9_LIBDIR='-L$(top_builddir)/bind/lib' -+AC_ARG_WITH(libbind-libs, -+ AC_HELP_STRING([--with-libbind-libs=PATH], -+ [bind9 export libraries are in PATH]), -+ [libbind_libs="$withval"], [libbind_libs='no']) -+case "$libbind_libs" in - yes) -- libbind="${top_srcdir}/bind" -+ AC_MSG_ERROR([Specify path to bind9 libraries]) - ;; - no) -- libbind="${top_srcdir}/bind" -+ BUNDLED_BIND=yes - ;; - *) -- libbind="$use_libbind" -+ BIND9_LIBDIR="-L$libbind_libs" -+ BUNDLED_BIND=no - ;; - esac -+AM_CONDITIONAL([BUNDLED_BIND], [test "$BUNDLED_BIND" = yes]) -+AC_SUBST([BIND9_LIBDIR]) - - # OpenLDAP support. - AC_ARG_WITH(ldap, -@@ -562,7 +579,7 @@ fi - CFLAGS="$CFLAGS $STD_CWARNINGS" - - # Try to add the bind include directory --CFLAGS="$CFLAGS -I$libbind/include" -+CFLAGS="$CFLAGS -I$libbind" - - AC_C_FLEXIBLE_ARRAY_MEMBER - -diff -up dhcp-4.2.2/dhcpctl/Makefile.am.rh637017 dhcp-4.2.2/dhcpctl/Makefile.am ---- dhcp-4.2.2/dhcpctl/Makefile.am.rh637017 2009-10-28 05:12:30.000000000 +0100 -+++ dhcp-4.2.2/dhcpctl/Makefile.am 2011-08-11 17:28:58.924897535 +0200 -@@ -6,10 +6,10 @@ EXTRA_DIST = $(man_MANS) - - omshell_SOURCES = omshell.c - omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ -- ../bind/lib/libdns.a ../bind/lib/libisc.a -+ $(BIND9_LIBDIR) -ldns-export -lisc-export - - libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c - - cltest_SOURCES = cltest.c - cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ -- ../bind/lib/libdns.a ../bind/lib/libisc.a -\ No newline at end of file -+ $(BIND9_LIBDIR) -ldns-export -lisc-export -diff -up dhcp-4.2.2/Makefile.am.rh637017 dhcp-4.2.2/Makefile.am ---- dhcp-4.2.2/Makefile.am.rh637017 2010-03-25 00:30:38.000000000 +0100 -+++ dhcp-4.2.2/Makefile.am 2011-08-11 17:28:58.925897509 +0200 -@@ -21,7 +21,13 @@ EXTRA_DIST = RELNOTES LICENSE \ - util/bindvar.sh \ - bind/Makefile bind/bind.tar.gz bind/version.tmp - --SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server -+if BUNDLED_BIND -+SUBDIRS = bind -+else -+SUBDIRS = -+endif -+ -+SUBDIRS += includes tests common dst omapip client dhcpctl relay server - - nobase_include_HEADERS = dhcpctl/dhcpctl.h - -diff -up dhcp-4.2.2/omapip/Makefile.am.rh637017 dhcp-4.2.2/omapip/Makefile.am ---- dhcp-4.2.2/omapip/Makefile.am.rh637017 2010-02-12 01:13:54.000000000 +0100 -+++ dhcp-4.2.2/omapip/Makefile.am 2011-08-11 17:28:58.939897149 +0200 -@@ -10,5 +10,5 @@ man_MANS = omapi.3 - EXTRA_DIST = $(man_MANS) - - svtest_SOURCES = test.c --svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a -+svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export - -diff -up dhcp-4.2.2/relay/Makefile.am.rh637017 dhcp-4.2.2/relay/Makefile.am ---- dhcp-4.2.2/relay/Makefile.am.rh637017 2009-10-28 05:12:30.000000000 +0100 -+++ dhcp-4.2.2/relay/Makefile.am 2011-08-11 17:28:58.940897123 +0200 -@@ -3,7 +3,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst - sbin_PROGRAMS = dhcrelay - dhcrelay_SOURCES = dhcrelay.c - dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -- ../bind/lib/libdns.a ../bind/lib/libisc.a -+ $(BIND9_LIBDIR) -ldns-export -lisc-export - man_MANS = dhcrelay.8 - EXTRA_DIST = $(man_MANS) - -diff -up dhcp-4.2.2/server/Makefile.am.rh637017 dhcp-4.2.2/server/Makefile.am ---- dhcp-4.2.2/server/Makefile.am.rh637017 2010-03-24 22:49:47.000000000 +0100 -+++ dhcp-4.2.2/server/Makefile.am 2011-08-11 17:28:58.944897021 +0200 -@@ -8,8 +8,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c - - dhcpd_CFLAGS = $(LDAP_CFLAGS) - dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -- ../dhcpctl/libdhcpctl.a ../bind/lib/libdns.a \ -- ../bind/lib/libisc.a -+ ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export - - man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 - EXTRA_DIST = $(man_MANS) diff --git a/dhcp/patches/dhcp-4.2.2-sharedlib.patch b/dhcp/patches/dhcp-4.2.2-sharedlib.patch deleted file mode 100644 index b504de7..0000000 --- a/dhcp/patches/dhcp-4.2.2-sharedlib.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff -up dhcp-4.2.2/client/Makefile.am.sharedlib dhcp-4.2.2/client/Makefile.am ---- dhcp-4.2.2/client/Makefile.am.sharedlib 2011-10-09 20:07:40.000000000 +0200 -+++ dhcp-4.2.2/client/Makefile.am 2011-10-09 20:07:40.000000000 +0200 -@@ -4,7 +4,7 @@ dhclient_SOURCES = clparse.c dhclient.c - scripts/bsdos scripts/freebsd scripts/linux scripts/macos \ - scripts/netbsd scripts/nextstep scripts/openbsd \ - scripts/solaris scripts/openwrt --dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -+dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ - $(BIND9_LIBDIR) -ldns-export -lisc-export $(CAPNG_LDADD) - man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 - EXTRA_DIST = $(man_MANS) -diff -up dhcp-4.2.2/configure.ac.sharedlib dhcp-4.2.2/configure.ac ---- dhcp-4.2.2/configure.ac.sharedlib 2011-10-09 20:07:40.000000000 +0200 -+++ dhcp-4.2.2/configure.ac 2011-10-09 20:07:40.000000000 +0200 -@@ -30,7 +30,8 @@ fi - # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API. - AC_USE_SYSTEM_EXTENSIONS - --AC_PROG_RANLIB -+# Use libtool to simplify building of shared libraries -+AC_PROG_LIBTOOL - AC_CONFIG_HEADERS([includes/config.h]) - - # we sometimes need to know byte order for building packets -diff -up dhcp-4.2.2/dhcpctl/Makefile.am.sharedlib dhcp-4.2.2/dhcpctl/Makefile.am ---- dhcp-4.2.2/dhcpctl/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200 -+++ dhcp-4.2.2/dhcpctl/Makefile.am 2011-10-09 20:07:40.000000000 +0200 -@@ -1,15 +1,15 @@ - bin_PROGRAMS = omshell --lib_LIBRARIES = libdhcpctl.a -+lib_LTLIBRARIES = libdhcpctl.la - noinst_PROGRAMS = cltest - man_MANS = omshell.1 dhcpctl.3 - EXTRA_DIST = $(man_MANS) - - omshell_SOURCES = omshell.c --omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ -+omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ - $(BIND9_LIBDIR) -ldns-export -lisc-export - --libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c -+libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c - - cltest_SOURCES = cltest.c --cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ -+cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ - $(BIND9_LIBDIR) -ldns-export -lisc-export -diff -up dhcp-4.2.2/omapip/Makefile.am.sharedlib dhcp-4.2.2/omapip/Makefile.am ---- dhcp-4.2.2/omapip/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200 -+++ dhcp-4.2.2/omapip/Makefile.am 2011-10-09 20:07:40.000000000 +0200 -@@ -1,7 +1,7 @@ --lib_LIBRARIES = libomapi.a -+lib_LTLIBRARIES = libomapi.la - noinst_PROGRAMS = svtest - --libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ -+libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ - errwarn.c listener.c dispatch.c generic.c support.c \ - handle.c message.c convert.c hash.c auth.c inet_addr.c \ - array.c trace.c toisc.c iscprint.c isclib.c -@@ -10,5 +10,5 @@ man_MANS = omapi.3 - EXTRA_DIST = $(man_MANS) - - svtest_SOURCES = test.c --svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export -+svtest_LDADD = libomapi.la $(BIND9_LIBDIR) -ldns-export -lisc-export - -diff -up dhcp-4.2.2/relay/Makefile.am.sharedlib dhcp-4.2.2/relay/Makefile.am ---- dhcp-4.2.2/relay/Makefile.am.sharedlib 2011-10-09 20:07:40.000000000 +0200 -+++ dhcp-4.2.2/relay/Makefile.am 2011-10-09 20:07:40.000000000 +0200 -@@ -2,7 +2,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst - - sbin_PROGRAMS = dhcrelay - dhcrelay_SOURCES = dhcrelay.c --dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -+dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ - $(BIND9_LIBDIR) -ldns-export -lisc-export $(CAPNG_LDADD) - man_MANS = dhcrelay.8 - EXTRA_DIST = $(man_MANS) -diff -up dhcp-4.2.2/server/Makefile.am.sharedlib dhcp-4.2.2/server/Makefile.am ---- dhcp-4.2.2/server/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200 -+++ dhcp-4.2.2/server/Makefile.am 2011-10-09 20:08:26.000000000 +0200 -@@ -7,8 +7,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c - dhcpv6.c mdb6.c ldap.c ldap_casa.c - - dhcpd_CFLAGS = $(LDAP_CFLAGS) --dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ -- ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export -+dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ -+ ../dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export - - man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 - EXTRA_DIST = $(man_MANS) diff --git a/dhcp/patches/dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch b/dhcp/patches/dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch deleted file mode 100644 index 3bcb5da..0000000 --- a/dhcp/patches/dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff -up dhcp-4.2.3-P2/common/dhcp-options.5.rfc5970 dhcp-4.2.3-P2/common/dhcp-options.5 ---- dhcp-4.2.3-P2/common/dhcp-options.5.rfc5970 2012-03-21 19:39:47.572002389 +0100 -+++ dhcp-4.2.3-P2/common/dhcp-options.5 2012-03-21 19:39:47.670001164 +0100 -@@ -1770,7 +1770,48 @@ The \fBlq-relay-data\fR option is used i - The \fBlq-client-link\fR option is used internally by for lease query. - .RE - .PP -+ -+.B option -+.B dhcp6.bootfile-url -+.I string -+.B ; -+.RS 0.25i -+.PP -+The server sends this option to inform the client about a URL to a -+boot file. Used primarily for UEFI network booting, it contains an RFC3986 -+compliant URI which the client may use to boot an operating system. This option -+is defined in RFC5970 -+.RE -+.PP -+ -+.B option -+.B dhcp6.arch-type -+.I arch-id \fR[\fB,\fR arch-id\fR...] -+.B ; -+.RS 0.25i -+.PP -+A client will send this option to a server so that the server may make decisions -+on what options and addresses to offer the requesting client. The option -+consists of a list of 16 bit unsigned values that represent the architecture of -+the requesting client. These values corespond to the values available to the -+dhcpv4 option architecture-type, as defined in RFC4578, section 2.1. -+This option is defined in RFC5970 - .RE -+.PP -+ -+.B option -+.B dhcp6.net-id -+.I uint8 uint8 uint8 -+.B ; -+.RS 0.25i -+.PP -+A client will send this option to a server to inform it about the clients level -+of UNDI support. The option consists of 3 octets (a type, major and minor -+value). Specific meanings of these values are doumented in section 2.2 of -+RFC4578. -+This option is defined in RFC5970 -+.RE -+.PP - .SH DEFINING NEW OPTIONS - The Internet Systems Consortium DHCP client and server provide the - capability to define new options. Each DHCP option has a name, a -diff -up dhcp-4.2.3-P2/common/tables.c.rfc5970 dhcp-4.2.3-P2/common/tables.c ---- dhcp-4.2.3-P2/common/tables.c.rfc5970 2012-03-21 19:39:47.577002328 +0100 -+++ dhcp-4.2.3-P2/common/tables.c 2012-03-21 19:39:47.670001164 +0100 -@@ -461,6 +461,18 @@ static struct option dhcpv6_options[] = - { "lq-relay-data", "6X", &dhcpv6_universe, 47, 1 }, - { "lq-client-link", "6A", &dhcpv6_universe, 48, 1 }, - -+ /* RFC5970 OPTIONS */ -+ -+ { "bootfile-url", "t", &dhcpv6_universe, 59, 1}, -+#if 0 -+ /* Can't implement this until arrays of strings with length "StA" -+ * are implemented -+ */ -+ { "bootfile-param", "StA", &dhcpv6_universe, 60, 1}, -+#endif -+ { "arch-type", "Sa", &dhcpv6_universe, 61, 1}, -+ { "net-id", "BBB", &dhcpv6_universe, 62, 1}, -+ - { NULL, NULL, NULL, 0, 0 } - }; - -diff -up dhcp-4.2.3-P2/includes/dhcp6.h.rfc5970 dhcp-4.2.3-P2/includes/dhcp6.h ---- dhcp-4.2.3-P2/includes/dhcp6.h.rfc5970 2010-02-17 21:33:55.000000000 +0100 -+++ dhcp-4.2.3-P2/includes/dhcp6.h 2012-03-21 19:39:47.671001151 +0100 -@@ -75,6 +75,11 @@ - #define D6O_CLT_TIME 46 /* RFC5007 */ - #define D6O_LQ_RELAY_DATA 47 /* RFC5007 */ - #define D6O_LQ_CLIENT_LINK 48 /* RFC5007 */ -+/* 49-58 Not yet assigned */ -+#define D60_BOOT_URL 59 /* RFC5970 */ -+#define D60_BOOT_PARAMS 60 /* RFC5970 */ -+#define D60_CLIENT_ARCH 61 /* RFC5970 */ -+#define D60_CLIENT_NII 62 /* RFC5970 */ - - /* - * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007. diff --git a/dhcp/patches/dhcp-4.2.3-paranoia.patch b/dhcp/patches/dhcp-4.2.3-paranoia.patch deleted file mode 100644 index e6c1576..0000000 --- a/dhcp/patches/dhcp-4.2.3-paranoia.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -up dhcp-4.2.3-P1/server/dhcpd.c.paranoia dhcp-4.2.3-P1/server/dhcpd.c ---- dhcp-4.2.3-P1/server/dhcpd.c.paranoia 2011-12-20 18:02:26.000000000 +0100 -+++ dhcp-4.2.3-P1/server/dhcpd.c 2011-12-20 18:03:43.840037108 +0100 -@@ -771,22 +771,6 @@ main(int argc, char **argv) { - exit (0); - } - --#if defined (PARANOIA) -- /* change uid to the specified one */ -- -- if (set_gid) { -- if (setgroups (0, (void *)0)) -- log_fatal ("setgroups: %m"); -- if (setgid (set_gid)) -- log_fatal ("setgid(%d): %m", (int) set_gid); -- } -- -- if (set_uid) { -- if (setuid (set_uid)) -- log_fatal ("setuid(%d): %m", (int) set_uid); -- } --#endif /* PARANOIA */ -- - /* - * Deal with pid files. If the user told us - * not to write a file we don't read one either -@@ -823,6 +807,22 @@ main(int argc, char **argv) { - } - } - -+#if defined (PARANOIA) -+ /* change uid to the specified one */ -+ -+ if (set_gid) { -+ if (setgroups (0, (void *)0)) -+ log_fatal ("setgroups: %m"); -+ if (setgid (set_gid)) -+ log_fatal ("setgid(%d): %m", (int) set_gid); -+ } -+ -+ if (set_uid) { -+ if (setuid (set_uid)) -+ log_fatal ("setuid(%d): %m", (int) set_uid); -+ } -+#endif /* PARANOIA */ -+ - /* If we were requested to log to stdout on the command line, - keep doing so; otherwise, stop. */ - if (log_perror == -1) diff --git a/dhcp/patches/dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch b/dhcp/patches/dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch deleted file mode 100644 index c18380d..0000000 --- a/dhcp/patches/dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -up dhcp-4.2.4-P1/client/dhclient.c.dhclient6-leases_semicolon dhcp-4.2.4-P1/client/dhclient.c ---- dhcp-4.2.4-P1/client/dhclient.c.dhclient6-leases_semicolon 2012-07-25 15:20:22.187164614 +0200 -+++ dhcp-4.2.4-P1/client/dhclient.c 2012-07-25 15:20:26.648152028 +0200 -@@ -3236,10 +3236,21 @@ void write_lease_option (struct option_c - } - if (evaluate_option_cache (&ds, packet, lease, client_state, - in_options, cfg_options, scope, oc, MDL)) { -- fprintf(leaseFile, "%soption %s%s%s %s;\n", preamble, -- name, dot, oc->option->name, -- pretty_print_option(oc->option, ds.data, ds.len, -- 1, 1)); -+ /* The option name */ -+ fprintf(leaseFile, "%soption %s%s%s", preamble, -+ name, dot, oc->option->name); -+ -+ /* The option value if there is one */ -+ if ((oc->option->format == NULL) || -+ (oc->option->format[0] != 'Z')) { -+ fprintf(leaseFile, " %s", -+ pretty_print_option(oc->option, ds.data, -+ ds.len, 1, 1)); -+ } -+ -+ /* The closing semi-colon and newline */ -+ fprintf(leaseFile, ";\n"); -+ - data_string_forget (&ds, MDL); - } - } -diff -up dhcp-4.2.4-P1/common/parse.c.dhclient6-leases_semicolon dhcp-4.2.4-P1/common/parse.c ---- dhcp-4.2.4-P1/common/parse.c.dhclient6-leases_semicolon 2012-07-25 15:10:39.683557386 +0200 -+++ dhcp-4.2.4-P1/common/parse.c 2012-07-25 15:16:50.826762985 +0200 -@@ -5772,7 +5772,7 @@ int parse_option_decl (oc, cfile) - goto alloc; - - case 'Z': /* Zero-length option */ -- token = next_token(&val, (unsigned *)0, cfile); -+ token = peek_token(&val, (unsigned *)0, cfile); - if (token != SEMI) { - parse_warn(cfile, - "semicolon expected."); diff --git a/dhcp/patches/dhcp-4.2.4-P2-conflex-do-forward-updates.patch b/dhcp/patches/dhcp-4.2.4-P2-conflex-do-forward-updates.patch new file mode 100644 index 0000000..679fdd3 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.4-P2-conflex-do-forward-updates.patch @@ -0,0 +1,12 @@ +diff -up dhcp-4.2.4-P2/common/conflex.c.orig dhcp-4.2.4-P2/common/conflex.c +--- dhcp-4.2.4-P2/common/conflex.c.orig 2012-08-28 04:13:03.000000000 +0200 ++++ dhcp-4.2.4-P2/common/conflex.c 2012-10-09 14:01:29.922104149 +0200 +@@ -889,7 +889,7 @@ intern(char *atom, enum dhcp_token dfv) + if (!strcasecmp(atom + 7, "list")) + return DOMAIN_LIST; + } +- if (!strcasecmp (atom + 1, "o-forward-update")) ++ if (!strcasecmp (atom + 1, "o-forward-updates")) + return DO_FORWARD_UPDATE; + if (!strcasecmp (atom + 1, "ebug")) + return TOKEN_DEBUG; diff --git a/dhcp/patches/dhcp-4.2.4-P2-dupl-key.patch b/dhcp/patches/dhcp-4.2.4-P2-dupl-key.patch new file mode 100644 index 0000000..85c7473 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.4-P2-dupl-key.patch @@ -0,0 +1,13 @@ +diff -up dhcp-4.2.4-P2/common/parse.c.dupl-key dhcp-4.2.4-P2/common/parse.c +--- dhcp-4.2.4-P2/common/parse.c.dupl-key 2012-11-16 15:31:30.568561745 +0100 ++++ dhcp-4.2.4-P2/common/parse.c 2012-11-16 15:31:30.577561619 +0100 +@@ -2893,6 +2893,9 @@ int parse_zone (struct dns_zone *zone, s + } + val = key_name; + } ++ if (zone->key) ++ log_fatal("Multiple key definition for zone %s.", ++ zone->name); + if (omapi_auth_key_lookup_name (&zone -> key, val) != + ISC_R_SUCCESS) + parse_warn (cfile, "unknown key %s", val); diff --git a/dhcp/patches/dhcp-4.2.4-PPP.patch b/dhcp/patches/dhcp-4.2.4-PPP.patch deleted file mode 100644 index edb11bf..0000000 --- a/dhcp/patches/dhcp-4.2.4-PPP.patch +++ /dev/null @@ -1,150 +0,0 @@ -diff -up dhcp-4.2.4b1/client/dhc6.c.PPP dhcp-4.2.4b1/client/dhc6.c ---- dhcp-4.2.4b1/client/dhc6.c.PPP 2012-04-16 17:37:23.243618764 +0200 -+++ dhcp-4.2.4b1/client/dhc6.c 2012-04-16 17:37:23.252618638 +0200 -@@ -133,7 +133,7 @@ extern int stateless; - * is not how it is intended. Upcoming rearchitecting the client should - * address this "one daemon model." - */ --void -+isc_result_t - form_duid(struct data_string *duid, const char *file, int line) - { - struct interface_info *ip; -@@ -145,6 +145,15 @@ form_duid(struct data_string *duid, cons - if (ip == NULL) - log_fatal("Impossible condition at %s:%d.", MDL); - -+ while (ip && ip->hw_address.hbuf[0] == HTYPE_RESERVED) { -+ /* Try the other interfaces */ -+ log_debug("Cannot form default DUID from interface %s.", ip->name); -+ ip = ip->next; -+ } -+ if (ip == NULL) { -+ return ISC_R_UNEXPECTED; -+ } -+ - if ((ip->hw_address.hlen == 0) || - (ip->hw_address.hlen > sizeof(ip->hw_address.hbuf))) - log_fatal("Impossible hardware address length at %s:%d.", MDL); -@@ -180,6 +189,8 @@ form_duid(struct data_string *duid, cons - memcpy(duid->buffer->data + 4, ip->hw_address.hbuf + 1, - ip->hw_address.hlen - 1); - } -+ -+ return ISC_R_SUCCESS; - } - - /* -@@ -5130,7 +5141,8 @@ make_client6_options(struct client_state - */ - if ((oc = lookup_option(&dhcpv6_universe, *op, - D6O_CLIENTID)) == NULL) { -- if (!option_cache(&oc, &default_duid, NULL, clientid_option, -+ if (default_duid.len == 0 || -+ !option_cache(&oc, &default_duid, NULL, clientid_option, - MDL)) - log_fatal("Failure assembling a DUID."); - -diff -up dhcp-4.2.4b1/client/dhclient.c.PPP dhcp-4.2.4b1/client/dhclient.c ---- dhcp-4.2.4b1/client/dhclient.c.PPP 2012-04-16 17:37:23.214619170 +0200 -+++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:37:23.254618610 +0200 -@@ -919,8 +919,8 @@ main(int argc, char **argv) { - if (default_duid.buffer != NULL) - data_string_forget(&default_duid, MDL); - -- form_duid(&default_duid, MDL); -- write_duid(&default_duid); -+ if (form_duid(&default_duid, MDL) == ISC_R_SUCCESS) -+ write_duid(&default_duid); - } - - for (ip = interfaces ; ip != NULL ; ip = ip->next) { -diff -up dhcp-4.2.4b1/common/bpf.c.PPP dhcp-4.2.4b1/common/bpf.c ---- dhcp-4.2.4b1/common/bpf.c.PPP 2012-04-16 17:37:23.175619716 +0200 -+++ dhcp-4.2.4b1/common/bpf.c 2012-04-16 17:37:23.255618596 +0200 -@@ -599,6 +599,22 @@ get_hw_addr(const char *name, struct har - memcpy(&hw->hbuf[1], LLADDR(sa), sa->sdl_alen); - break; - #endif /* IFT_FDDI */ -+#if defined(IFT_PPP) -+ case IFT_PPP: -+ if (local_family != AF_INET6) -+ log_fatal("Unsupported device type %d for "%s"", -+ sa->sdl_type, name); -+ hw->hlen = 0; -+ hw->hbuf[0] = HTYPE_RESERVED; -+ /* 0xdeadbeef should never occur on the wire, -+ * and is a signature that something went wrong. -+ */ -+ hw->hbuf[1] = 0xde; -+ hw->hbuf[2] = 0xad; -+ hw->hbuf[3] = 0xbe; -+ hw->hbuf[4] = 0xef; -+ break; -+#endif - default: - log_fatal("Unsupported device type %d for "%s"", - sa->sdl_type, name); -diff -up dhcp-4.2.4b1/common/lpf.c.PPP dhcp-4.2.4b1/common/lpf.c ---- dhcp-4.2.4b1/common/lpf.c.PPP 2012-04-16 17:37:23.155619996 +0200 -+++ dhcp-4.2.4b1/common/lpf.c 2012-04-16 17:37:23.256618582 +0200 -@@ -503,6 +503,22 @@ get_hw_addr(const char *name, struct har - hw->hbuf[0] = HTYPE_FDDI; - memcpy(&hw->hbuf[1], sa->sa_data, 16); - 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); -+ hw->hlen = 0; -+ hw->hbuf[0] = HTYPE_RESERVED; -+ /* 0xdeadbeef should never occur on the wire, -+ * and is a signature that something went wrong. -+ */ -+ hw->hbuf[1] = 0xde; -+ hw->hbuf[2] = 0xad; -+ hw->hbuf[3] = 0xbe; -+ hw->hbuf[4] = 0xef; -+ break; -+#endif - default: - log_fatal("Unsupported device type %ld for "%s"", - (long int)sa->sa_family, name); -diff -up dhcp-4.2.4b1/includes/dhcpd.h.PPP dhcp-4.2.4b1/includes/dhcpd.h ---- dhcp-4.2.4b1/includes/dhcpd.h.PPP 2012-04-16 17:37:23.239618820 +0200 -+++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:37:23.257618568 +0200 -@@ -2760,7 +2760,7 @@ void dhcpv4_client_assignments(void); - void dhcpv6_client_assignments(void); - - /* dhc6.c */ --void form_duid(struct data_string *duid, const char *file, int line); -+isc_result_t form_duid(struct data_string *duid, const char *file, int line); - void dhc6_lease_destroy(struct dhc6_lease **src, const char *file, int line); - void start_init6(struct client_state *client); - void start_info_request6(struct client_state *client); -diff -up dhcp-4.2.4b1/includes/dhcp.h.PPP dhcp-4.2.4b1/includes/dhcp.h ---- dhcp-4.2.4b1/includes/dhcp.h.PPP 2012-04-16 17:37:23.000000000 +0200 -+++ dhcp-4.2.4b1/includes/dhcp.h 2012-04-16 17:38:34.675618138 +0200 -@@ -85,6 +85,8 @@ struct dhcp_packet { - * is no standard for this so we - * just steal a type */ - -+#define HTYPE_RESERVED 0 /* RFC 5494 */ -+ - /* Magic cookie validating dhcp options field (and bootp vendor - extensions field). */ - #define DHCP_OPTIONS_COOKIE "\143\202\123\143" -diff -up dhcp-4.2.4b1/server/dhcpv6.c.PPP dhcp-4.2.4b1/server/dhcpv6.c ---- dhcp-4.2.4b1/server/dhcpv6.c.PPP 2012-04-16 17:37:23.218619114 +0200 -+++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:37:23.260618526 +0200 -@@ -300,6 +300,9 @@ generate_new_server_duid(void) { - if (p->hw_address.hlen > 0) { - break; - } -+ if (p->next == NULL && p->hw_address.hbuf[0] == HTYPE_RESERVED) { -+ log_error("Can not generate DUID from interfaces which do not have hardware addresses, please configure server-duid!"); -+ } - } - if (p == NULL) { - return ISC_R_UNEXPECTED; diff --git a/dhcp/patches/dhcp-4.2.4-dhclient-options.patch b/dhcp/patches/dhcp-4.2.4-dhclient-options.patch new file mode 100644 index 0000000..40c3271 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.4-dhclient-options.patch @@ -0,0 +1,509 @@ +diff -up dhcp-4.2.1b1/client/dhclient.8.man dhcp-4.2.1b1/client/dhclient.8 +--- dhcp-4.2.1b1/client/dhclient.8.man 2010-07-14 22:09:34.000000000 +0200 ++++ dhcp-4.2.1b1/client/dhclient.8 2011-01-27 18:19:07.000000000 +0100 +@@ -115,6 +115,33 @@ dhclient - Dynamic Host Configuration Pr + .B -w + ] + [ ++.B -B ++] ++[ ++.B -I ++.I dhcp-client-identifier ++] ++[ ++.B -H ++.I host-name ++] ++[ ++.B -F ++.I fqdn.fqdn ++] ++[ ++.B -V ++.I vendor-class-identifier ++] ++[ ++.B -R ++.I request-option-list ++] ++[ ++.B -timeout ++.I timeout ++] ++[ + .B -v + ] + [ +@@ -264,6 +291,69 @@ not to exit when it doesn't find any suc + program can then be used to notify the client when a network interface + has been added or removed, so that the client can attempt to configure an IP + address on that interface. ++ ++.TP ++.BI -B ++Set the BOOTP broadcast flag in request packets so servers will always ++broadcast replies. ++ ++.TP ++.BI -I\ <dhcp-client-identifier> ++Specify the dhcp-client-identifier option to send to the DHCP server. ++ ++.TP ++.BI -H\ <host-name> ++Specify the host-name option to send to the DHCP server. The host-name ++string only contains the client's hostname prefix, to which the server will ++append the ddns-domainname or domain-name options, if any, to derive the ++fully qualified domain name of the client. The ++.B -H ++option cannot be used with the ++.B -F ++option. ++ ++.TP ++.BI -F\ <fqdn.fqdn> ++Specify the fqdn.fqdn option to send to the DHCP server. This option cannot ++be used with the ++.B -H ++option. The fqdn.fqdn option must specify the complete domain name of the ++client host, which the server may use for dynamic DNS updates. ++ ++.TP ++.BI -V\ <vendor-class-identifier> ++Specify the vendor-class-identifier option to send to the DHCP server. ++ ++.TP ++.BI -R\ <option>[,<option>...] ++Specify the list of options the client is to request from the server. The ++option list must be a single string consisting of option names separated ++by at least one command and optional space characters. The default option ++list is: ++ ++.BR ++ subnet-mask, broadcast-address, time-offset, routers, ++.BR ++ domain-search, domain-name, domain-name-servers, host-name, ++.BR ++ nis-domain, nis-servers, ntp-servers, interface-mtu ++ ++.TP ++.B -R ++option does not append options to the default request, it overrides the ++default request list. Keep this in mind if you want to request an ++additional option besides the default request list. You will have to ++specify all option names for the ++.B -R ++parameter. ++ ++.TP ++.BI -timeout\ <timeout> ++Specify the time after which ++.B dhclient ++will decide that no DHCP servers can be contacted when no responses have been ++received. ++ + .TP + .BI -n + Do not configure any interfaces. This is most likely to be useful in +diff -up dhcp-4.2.4-P2/client/clparse.c.options dhcp-4.2.4-P2/client/clparse.c +--- dhcp-4.2.4-P2/client/clparse.c.options 2012-08-24 21:11:21.000000000 +0200 ++++ dhcp-4.2.4-P2/client/clparse.c 2012-09-26 10:34:27.140049896 +0200 +@@ -154,6 +154,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) +@@ -320,7 +321,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; +@@ -739,6 +741,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.4-P2/client/dhclient.c.options dhcp-4.2.4-P2/client/dhclient.c +--- dhcp-4.2.4-P2/client/dhclient.c.options 2012-08-28 04:13:03.000000000 +0200 ++++ dhcp-4.2.4-P2/client/dhclient.c 2012-09-26 10:36:10.396967531 +0200 +@@ -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 + 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); + +@@ -123,6 +132,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)); +@@ -310,6 +328,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("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) { +@@ -484,6 +584,156 @@ 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. ++ */ ++ for (ip=interfaces; ip; ip = ip->next) { ++ if (ip->client->config->timeout == 60) ++ ip->client->config->timeout = timeout_arg; ++ } ++ } ++ ++ if ((dhclient_request_options != 0) && (top_level_config.requested_options != default_requested_options)) { ++ for (ip=interfaces; ip; ip = ip->next) { ++ if (ip->client->config->requested_options == 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(); + +@@ -715,6 +965,10 @@ static void usage() + " [-s server-addr] [-cf config-file] " + "[-lf lease-file]\n" + " [-pf pid-file] [--no-pid] [-e VAR=val]\n" ++ " [-I <dhcp-client-identifier>] [-B]\n" ++ " [-H <host-name> | -F <fqdn.fqdn>] [-timeout <timeout>]\n" ++ " [-V <vendor-class-identifier>]\n" ++ " [-R <request option list>]\n" + " [-sf script-file] [interface]"); + } + +@@ -2421,7 +2675,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); +@@ -2505,7 +2760,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); +@@ -2567,7 +2824,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.4-P2/common/conflex.c.options dhcp-4.2.4-P2/common/conflex.c +--- dhcp-4.2.4-P2/common/conflex.c.options 2012-08-28 04:13:03.000000000 +0200 ++++ dhcp-4.2.4-P2/common/conflex.c 2012-09-26 10:34:27.142049876 +0200 +@@ -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.4-P2/includes/dhcpd.h.options dhcp-4.2.4-P2/includes/dhcpd.h +--- dhcp-4.2.4-P2/includes/dhcpd.h.options 2012-08-28 04:13:22.000000000 +0200 ++++ dhcp-4.2.4-P2/includes/dhcpd.h 2012-09-26 10:34:27.143049865 +0200 +@@ -1153,6 +1153,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.4-P2/includes/dhctoken.h.options dhcp-4.2.4-P2/includes/dhctoken.h +--- dhcp-4.2.4-P2/includes/dhctoken.h.options 2012-08-28 04:13:03.000000000 +0200 ++++ dhcp-4.2.4-P2/includes/dhctoken.h 2012-09-26 10:34:27.144049854 +0200 +@@ -364,7 +364,8 @@ enum dhcp_token { + GETHOSTBYNAME = 665, + PRIMARY6 = 666, + SECONDARY6 = 667, +- TOKEN_INFINIBAND = 668 ++ TOKEN_INFINIBAND = 668, ++ BOOTP_BROADCAST_ALWAYS = 669 + }; + + #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/dhcp/patches/dhcp-4.2.4-getifaddrs.patch b/dhcp/patches/dhcp-4.2.4-getifaddrs.patch index fe22da0..330a1fc 100644 --- a/dhcp/patches/dhcp-4.2.4-getifaddrs.patch +++ b/dhcp/patches/dhcp-4.2.4-getifaddrs.patch @@ -1,7 +1,19 @@ -diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discover.c ---- dhcp-4.2.4rc2/common/discover.c.getifaddrs 2012-05-25 18:05:29.592024035 +0200 -+++ dhcp-4.2.4rc2/common/discover.c 2012-05-25 18:12:05.254266023 +0200 -@@ -379,394 +379,13 @@ end_iface_scan(struct iface_conf_list *i +From c09dd24a7d63988e0acef7d033bd3e088fc005c0 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka jpopelka@redhat.com +Date: Thu, 24 Jan 2013 12:39:50 +0100 +Subject: [PATCH] Linux interface discovery + +Use the same discovery code as for *BSD and OS X, +i.e. the getifaddrs() function. +--- + common/discover.c | 398 +++--------------------------------------------------- + 1 file changed, 17 insertions(+), 381 deletions(-) + +diff --git a/common/discover.c b/common/discover.c +index 1d84219..f2a8f6d 100644 +--- a/common/discover.c ++++ b/common/discover.c +@@ -379,391 +379,13 @@ end_iface_scan(struct iface_conf_list *ifaces) { ifaces->sock = -1; }
@@ -47,7 +59,7 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove - int len; - int i; - -- ifaces->fp = fopen("/proc/net/dev", "re"); +- ifaces->fp = fopen("/proc/net/dev", "r"); - if (ifaces->fp == NULL) { - log_error("Error opening '/proc/net/dev' to list interfaces"); - return 0; @@ -81,8 +93,8 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove - } - -#ifdef DHCPv6 -- if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) { -- ifaces->fp6 = fopen("/proc/net/if_inet6", "re"); +- if (local_family == AF_INET6) { +- ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); - if (ifaces->fp6 == NULL) { - log_error("Error opening '/proc/net/if_inet6' to " - "list IPv6 interfaces; %m"); @@ -92,8 +104,6 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove - ifaces->fp = NULL; - return 0; - } -- } else { -- ifaces->fp6 = NULL; - } -#endif - @@ -361,7 +371,7 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove - return 1; - } -#ifdef DHCPv6 -- if (!(*err) && ifaces->fp6) { +- if (!(*err)) { - if (local_family == AF_INET6) - return next_iface6(info, err, ifaces); - } @@ -380,8 +390,7 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove - ifaces->sock = -1; -#ifdef DHCPv6 - if (local_family == AF_INET6) { -- if (ifaces->fp6) -- fclose(ifaces->fp6); +- fclose(ifaces->fp6); - ifaces->fp6 = NULL; - } -#endif @@ -393,11 +402,11 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove * ----------- * - * FreeBSD, NetBSD, OpenBSD, and OS X all have the getifaddrs() -+ * FreeBSD, NetBSD, OpenBSD, OS X and Linux all have the getifaddrs() ++ * FreeBSD, NetBSD, OpenBSD, OS X and Linux all have the getifaddrs() * function. * * The getifaddrs() man page describes the use. -@@ -814,6 +433,8 @@ begin_iface_scan(struct iface_conf_list +@@ -811,6 +433,8 @@ begin_iface_scan(struct iface_conf_list *ifaces) { */ int next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { @@ -406,7 +415,7 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove if (ifaces->next == NULL) { *err = 0; return 0; -@@ -825,8 +446,20 @@ next_iface(struct iface_info *info, int +@@ -822,8 +446,20 @@ next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { return 0; } strcpy(info->name, ifaces->next->ifa_name); @@ -429,3 +438,6 @@ diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discove info->flags = ifaces->next->ifa_flags; ifaces->next = ifaces->next->ifa_next; *err = 0; +-- +1.8.1 + diff --git a/dhcp/patches/dhcp-4.2.4-lpf-ib.patch b/dhcp/patches/dhcp-4.2.4-lpf-ib.patch deleted file mode 100644 index abf7af9..0000000 --- a/dhcp/patches/dhcp-4.2.4-lpf-ib.patch +++ /dev/null @@ -1,549 +0,0 @@ -diff -up dhcp-4.2.4/client/dhclient.c.lpf-ib dhcp-4.2.4/client/dhclient.c ---- dhcp-4.2.4/client/dhclient.c.lpf-ib 2012-07-18 21:08:48.100835005 +0200 -+++ dhcp-4.2.4/client/dhclient.c 2012-07-18 21:08:48.111834856 +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; -@@ -909,6 +911,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) { -@@ -1185,6 +1195,29 @@ int find_subnet (struct subnet **sp, - return 0; - } - -+static void setup_ib_interface(struct interface_info *ip) -+{ -+ struct group *g; -+ -+ /* Set the broadcast flag */ -+ ip->client->config->bootp_broadcast_always = 1; -+ -+ /* -+ * Find out if a dhcp-client-identifier option was specified either -+ * in the config file or on the command line -+ */ -+ for (g = ip->client->config->on_transmission; g != NULL; g = g->next) { -+ if ((g->statements != NULL) && -+ (strcmp(g->statements->data.option->option->name, -+ "dhcp-client-identifier") == 0)) { -+ return; -+ } -+ } -+ -+ /* No client ID specified */ -+ log_fatal("dhcp-client-identifier must be specified for InfiniBand"); -+} -+ - /* Individual States: - * - * Each routine is called from the dhclient_state_machine() in one of -diff -up dhcp-4.2.4/common/bpf.c.lpf-ib dhcp-4.2.4/common/bpf.c ---- dhcp-4.2.4/common/bpf.c.lpf-ib 2012-07-18 21:08:48.101834991 +0200 -+++ dhcp-4.2.4/common/bpf.c 2012-07-18 21:08:48.111834856 +0200 -@@ -198,11 +198,44 @@ struct bpf_insn dhcp_bpf_filter [] = { - BPF_STMT(BPF_RET+BPF_K, 0), - }; - -+/* Packet filter program for DHCP over Infiniband. -+ * -+ * XXX -+ * Changes to the filter program may require changes to the constant offsets -+ * used in lpf_gen_filter_setup to patch the port in the BPF program! -+ * XXX -+ */ -+struct bpf_insn dhcp_ib_bpf_filter [] = { -+ /* Packet filter for Infiniband */ -+ /* Make sure it's a UDP packet... */ -+ BPF_STMT(BPF_LD + BPF_B + BPF_ABS, 9), -+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 6), -+ -+ /* Make sure this isn't a fragment... */ -+ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 6), -+ BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 4, 0), -+ -+ /* Get the IP header length... */ -+ BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 0), -+ -+ /* Make sure it's to the right port... */ -+ BPF_STMT(BPF_LD + BPF_H + BPF_IND, 2), -+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), -+ -+ /* If we passed all the tests, ask for the whole packet. */ -+ BPF_STMT(BPF_RET + BPF_K, (u_int)-1), -+ -+ /* Otherwise, drop it. */ -+ BPF_STMT(BPF_RET + BPF_K, 0), -+}; -+ - #if defined (DEC_FDDI) - struct bpf_insn *bpf_fddi_filter; - #endif - - int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn); -+int dhcp_ib_bpf_filter_len = sizeof dhcp_ib_bpf_filter / sizeof (struct bpf_insn); -+ - #if defined (HAVE_TR_SUPPORT) - struct bpf_insn dhcp_bpf_tr_filter [] = { - /* accept all token ring packets due to variable length header */ -diff -up dhcp-4.2.4/common/lpf.c.lpf-ib dhcp-4.2.4/common/lpf.c ---- dhcp-4.2.4/common/lpf.c.lpf-ib 2012-07-18 21:08:48.101834991 +0200 -+++ dhcp-4.2.4/common/lpf.c 2012-07-18 21:10:47.367210799 +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. */ - -+/* Default broadcast address for IPoIB */ -+static unsigned char default_ib_bcast_addr[20] = { -+ 0x00, 0xff, 0xff, 0xff, -+ 0xff, 0x12, 0x40, 0x1b, -+ 0x00, 0x00, 0x00, 0x00, -+ 0x00, 0x00, 0x00, 0x00, -+ 0xff, 0xff, 0xff, 0xff -+}; -+ - #ifdef USE_LPF_SEND - void if_reinitialize_send (info) - struct interface_info *info; -@@ -86,10 +96,21 @@ int if_register_lpf (info) - struct sockaddr common; - } sa; - struct ifreq ifr; -+ int type; -+ int protocol; - - /* Make an LPF socket. */ -- 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; -+ protocol = ETHERTYPE_IP; -+ } else { -+ type = SOCK_RAW; -+ protocol = ETH_P_ALL; -+ } -+ -+ if ((sock = socket(PF_PACKET, type, htons((short)protocol))) < 0) { - if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || - errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || - errno == EAFNOSUPPORT || errno == EINVAL) { -@@ -112,6 +133,7 @@ int if_register_lpf (info) - /* Bind to the interface name */ - memset (&sa, 0, sizeof sa); - sa.ll.sll_family = AF_PACKET; -+ sa.ll.sll_protocol = htons(protocol); - sa.ll.sll_ifindex = ifr.ifr_ifindex; - if (bind (sock, &sa.common, sizeof sa)) { - if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || -@@ -127,8 +149,6 @@ int if_register_lpf (info) - log_fatal ("Bind socket to interface: %m"); - } - -- get_hw_addr(info->name, &info->hw_address); -- - return sock; - } - #endif /* USE_LPF_SEND || USE_LPF_RECEIVE */ -@@ -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; -+extern struct sock_filter dhcp_ib_bpf_filter []; -+extern int dhcp_ib_bpf_filter_len; - - #if defined (HAVE_TR_SUPPORT) - extern struct sock_filter dhcp_bpf_tr_filter []; -@@ -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)); - -- /* Set up the bpf filter program structure. This is defined in -- bpf.c */ -- p.len = dhcp_bpf_filter_len; -- p.filter = dhcp_bpf_filter; -- -- /* Patch the server port into the LPF program... -- XXX changes to filter program may require changes -- to the insn number(s) used below! XXX */ -- dhcp_bpf_filter [8].k = ntohs ((short)local_port); -+ if (info->hw_address.hbuf[0] == HTYPE_INFINIBAND) { -+ /* Set up the bpf filter program structure. */ -+ p.len = dhcp_ib_bpf_filter_len; -+ p.filter = dhcp_ib_bpf_filter; -+ -+ /* Patch the server port into the LPF program... -+ XXX -+ changes to filter program may require changes -+ to the insn number(s) used below! -+ XXX */ -+ dhcp_ib_bpf_filter[6].k = ntohs ((short)local_port); -+ } else { -+ /* Set up the bpf filter program structure. -+ This is defined in bpf.c */ -+ p.len = dhcp_bpf_filter_len; -+ p.filter = dhcp_bpf_filter; -+ -+ /* Patch the server port into the LPF program... -+ XXX changes to filter program may require changes -+ to the insn number(s) used below! XXX */ -+ dhcp_bpf_filter [8].k = ntohs ((short)local_port); -+ } - - if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p, - sizeof p) < 0) { -@@ -315,6 +352,54 @@ static void lpf_tr_filter_setup (info) - #endif /* USE_LPF_RECEIVE */ - - #ifdef USE_LPF_SEND -+ssize_t send_packet_ib(interface, packet, raw, len, from, to, hto) -+ struct interface_info *interface; -+ struct packet *packet; -+ struct dhcp_packet *raw; -+ size_t len; -+ struct in_addr from; -+ struct sockaddr_in *to; -+ struct hardware *hto; -+{ -+ unsigned ibufp = 0; -+ double ih [1536 / sizeof (double)]; -+ unsigned char *buf = (unsigned char *)ih; -+ ssize_t result; -+ -+ union sockunion { -+ struct sockaddr sa; -+ struct sockaddr_ll sll; -+ struct sockaddr_storage ss; -+ } su; -+ -+ assemble_udp_ip_header (interface, buf, &ibufp, from.s_addr, -+ to->sin_addr.s_addr, to->sin_port, -+ (unsigned char *)raw, len); -+ memcpy (buf + ibufp, raw, len); -+ -+ memset(&su, 0, sizeof(su)); -+ su.sll.sll_family = AF_PACKET; -+ su.sll.sll_protocol = htons(ETHERTYPE_IP); -+ -+ if (!(su.sll.sll_ifindex = if_nametoindex(interface->name))) { -+ errno = ENOENT; -+ log_error ("send_packet_ib: %m - failed to get if index"); -+ return -1; -+ } -+ -+ su.sll.sll_hatype = htons(HTYPE_INFINIBAND); -+ su.sll.sll_halen = sizeof(interface->bcast_addr); -+ memcpy(&su.sll.sll_addr, interface->bcast_addr, 20); -+ -+ result = sendto(interface->wfdesc, buf, ibufp + len, 0, -+ &su.sa, sizeof(su)); -+ -+ if (result < 0) -+ log_error ("send_packet_ib: %m"); -+ -+ return result; -+} -+ - 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, - return send_fallback (interface, packet, raw, - len, from, to, hto); - -+ if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) { -+ return send_packet_ib(interface, packet, raw, len, from, -+ to, hto); -+ } -+ - if (hto == NULL && interface->anycast_mac_addr.hlen) - hto = &interface->anycast_mac_addr; - -@@ -356,6 +446,42 @@ ssize_t send_packet (interface, packet, - #endif /* USE_LPF_SEND */ - - #ifdef USE_LPF_RECEIVE -+ssize_t receive_packet_ib (interface, buf, len, from, hfrom) -+ struct interface_info *interface; -+ unsigned char *buf; -+ size_t len; -+ struct sockaddr_in *from; -+ struct hardware *hfrom; -+{ -+ int length = 0; -+ int offset = 0; -+ unsigned char ibuf [1536]; -+ unsigned bufix = 0; -+ unsigned paylen; -+ -+ length = read(interface->rfdesc, ibuf, sizeof(ibuf)); -+ -+ if (length <= 0) -+ return length; -+ -+ offset = decode_udp_ip_header(interface, ibuf, bufix, from, -+ (unsigned)length, &paylen, 0); -+ -+ if (offset < 0) -+ return 0; -+ -+ bufix += offset; -+ length -= offset; -+ -+ if (length < paylen) -+ log_fatal("Internal inconsistency at %s:%d.", MDL); -+ -+ /* Copy out the data in the packet... */ -+ memcpy(buf, &ibuf[bufix], paylen); -+ -+ return (ssize_t)paylen; -+} -+ - 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, - }; - 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; -@@ -461,11 +591,32 @@ void maybe_setup_fallback () - } - } - --void --get_hw_addr(const char *name, struct hardware *hw) { -+struct sockaddr_ll * -+get_ll (struct ifaddrs *ifaddrs, struct ifaddrs **ifa, char *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; -+ -+ if ((*ifa)->ifa_flags & IFF_LOOPBACK) -+ continue; -+ -+ if (strcmp((*ifa)->ifa_name, name) == 0) -+ return (struct sockaddr_ll *)(void *)(*ifa)->ifa_addr; -+ } -+ return NULL; -+} -+ -+struct sockaddr_ll * -+ioctl_get_ll(char *name) -+{ - int sock; - struct ifreq tmp; -- struct sockaddr *sa; -+ struct sockaddr *sa = NULL; -+ struct sockaddr_ll *sll = NULL; - - if (strlen(name) >= sizeof(tmp.ifr_name)) { - log_fatal("Device name too long: "%s"", name); -@@ -479,16 +630,44 @@ get_hw_addr(const char *name, struct har - memset(&tmp, 0, sizeof(tmp)); - strcpy(tmp.ifr_name, name); - if (ioctl(sock, SIOCGIFHWADDR, &tmp) < 0) { -- log_fatal("Error getting hardware address for "%s": %m", -+ log_fatal("Error getting hardware address for "%s": %m", - name); - } - - sa = &tmp.ifr_hwaddr; -- switch (sa->sa_family) { -+ sll = dmalloc (sizeof (struct sockaddr_ll), MDL); -+ if (!sll) -+ log_fatal("Unable to allocate memory for link layer address"); -+ memcpy(&sll->sll_hatype, &sa->sa_family, sizeof (sll->sll_hatype)); -+ memcpy(sll->sll_addr, sa->sa_data, sizeof (sll->sll_addr)); -+ return sll; -+} -+ -+void -+get_hw_addr(struct interface_info *info) -+{ -+ struct hardware *hw = &info->hw_address; -+ char *name = info->name; -+ struct ifaddrs *ifaddrs = NULL; -+ struct ifaddrs *ifa = NULL; -+ struct sockaddr_ll *sll = NULL; -+ -+ if (getifaddrs(&ifaddrs) == -1) -+ log_fatal("Failed to get interfaces"); -+ -+ if ((sll = get_ll(ifaddrs, &ifa, name)) == NULL) { -+ /* -+ * We were unable to get link-layer address for name. -+ * Fall back to ioctl(SIOCGIFHWADDR). -+ */ -+ sll = ioctl_get_ll(name); -+ } -+ -+ switch (sll->sll_hatype) { - case ARPHRD_ETHER: - hw->hlen = 7; - hw->hbuf[0] = HTYPE_ETHER; -- memcpy(&hw->hbuf[1], sa->sa_data, 6); -+ memcpy(&hw->hbuf[1], sll->sll_addr, 6); - break; - case ARPHRD_IEEE802: - #ifdef ARPHRD_IEEE802_TR -@@ -496,18 +675,35 @@ get_hw_addr(const char *name, struct har - #endif /* ARPHRD_IEEE802_TR */ - hw->hlen = 7; - hw->hbuf[0] = HTYPE_IEEE802; -- memcpy(&hw->hbuf[1], sa->sa_data, 6); -+ memcpy(&hw->hbuf[1], sll->sll_addr, 6); - break; - case ARPHRD_FDDI: - hw->hlen = 17; - hw->hbuf[0] = HTYPE_FDDI; -- memcpy(&hw->hbuf[1], sa->sa_data, 16); -+ memcpy(&hw->hbuf[1], sll->sll_addr, 16); -+ break; -+ case ARPHRD_INFINIBAND: -+ /* For Infiniband, save the broadcast address and store -+ * the port GUID into the hardware address. -+ */ -+ if (ifa->ifa_flags & IFF_BROADCAST) { -+ struct sockaddr_ll *bll; -+ -+ bll = (struct sockaddr_ll *)ifa->ifa_broadaddr; -+ memcpy(&info->bcast_addr, bll->sll_addr, 20); -+ } else { -+ memcpy(&info->bcast_addr, default_ib_bcast_addr, -+ 20); -+ } -+ -+ 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("local_family != AF_INET6 for "%s"", -+ name); - hw->hlen = 0; - hw->hbuf[0] = HTYPE_RESERVED; - /* 0xdeadbeef should never occur on the wire, -@@ -520,10 +716,11 @@ get_hw_addr(const char *name, struct har - break; - #endif - default: -- log_fatal("Unsupported device type %ld for "%s"", -- (long int)sa->sa_family, name); -+ freeifaddrs(ifaddrs); -+ log_fatal("Unsupported device type %h for "%s"", -+ sll->sll_hatype, name); - } - -- close(sock); -+ freeifaddrs(ifaddrs); - } - #endif -diff -up dhcp-4.2.4/common/socket.c.lpf-ib dhcp-4.2.4/common/socket.c ---- dhcp-4.2.4/common/socket.c.lpf-ib 2012-03-09 12:28:11.000000000 +0100 -+++ dhcp-4.2.4/common/socket.c 2012-07-18 21:08:48.112834843 +0200 -@@ -325,7 +325,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. */ - if (strcmp(info->name, "fallback") != 0) -- get_hw_addr(info->name, &info->hw_address); -+ get_hw_addr(info); - #if defined (USE_SOCKET_FALLBACK) - /* Fallback only registers for send, but may need to receive as - well. */ -@@ -388,7 +388,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", -@@ -498,7 +498,7 @@ if_register6(struct interface_info *info - if (req_multi) - if_register_multicast(info); - -- get_hw_addr(info->name, &info->hw_address); -+ get_hw_addr(info); - - if (!quiet_interface_discovery) { - if (info->shared_network != NULL) { -diff -up dhcp-4.2.4/includes/dhcpd.h.lpf-ib dhcp-4.2.4/includes/dhcpd.h ---- dhcp-4.2.4/includes/dhcpd.h.lpf-ib 2012-07-18 21:08:48.102834978 +0200 -+++ dhcp-4.2.4/includes/dhcpd.h 2012-07-18 21:08:48.114834815 +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. */ -+ u_int8_t bcast_addr[20]; /* Infiniband broadcast address */ - struct in_addr *addresses; /* Addresses associated with this - * interface. - */ -@@ -2360,7 +2361,7 @@ void print_dns_status (int, struct dhcp_ - #endif - const char *print_time(TIME); - --void get_hw_addr(const char *name, struct hardware *hw); -+void get_hw_addr(struct interface_info *info); - - /* socket.c */ - #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \ diff --git a/dhcp/patches/dhcp-4.2.4-options.patch b/dhcp/patches/dhcp-4.2.4-options.patch deleted file mode 100644 index b0080e1..0000000 --- a/dhcp/patches/dhcp-4.2.4-options.patch +++ /dev/null @@ -1,391 +0,0 @@ -diff -up dhcp-4.2.4b1/client/clparse.c.options dhcp-4.2.4b1/client/clparse.c ---- dhcp-4.2.4b1/client/clparse.c.options 2012-03-09 12:28:10.000000000 +0100 -+++ dhcp-4.2.4b1/client/clparse.c 2012-04-16 17:24:58.794047046 +0200 -@@ -154,6 +154,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) -@@ -320,7 +321,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; -@@ -739,6 +741,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.4b1/client/dhclient.c.options dhcp-4.2.4b1/client/dhclient.c ---- dhcp-4.2.4b1/client/dhclient.c.options 2012-04-11 22:43:24.000000000 +0200 -+++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:24:58.795047032 +0200 -@@ -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 - 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); - -@@ -123,6 +132,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)); -@@ -310,6 +328,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("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) { -@@ -484,6 +584,156 @@ 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. -+ */ -+ for (ip=interfaces; ip; ip = ip->next) { -+ if (ip->client->config->timeout == 60) -+ ip->client->config->timeout = timeout_arg; -+ } -+ } -+ -+ if ((dhclient_request_options != 0) && (top_level_config.requested_options != default_requested_options)) { -+ for (ip=interfaces; ip; ip = ip->next) { -+ if (ip->client->config->requested_options == 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(); - -@@ -2421,7 +2671,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); -@@ -2505,7 +2756,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); -@@ -2567,7 +2820,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.4b1/common/conflex.c.options dhcp-4.2.4b1/common/conflex.c ---- dhcp-4.2.4b1/common/conflex.c.options 2012-02-16 22:09:14.000000000 +0100 -+++ dhcp-4.2.4b1/common/conflex.c 2012-04-16 17:24:58.796047018 +0200 -@@ -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.4b1/includes/dhcpd.h.options dhcp-4.2.4b1/includes/dhcpd.h ---- dhcp-4.2.4b1/includes/dhcpd.h.options 2012-04-10 02:55:06.000000000 +0200 -+++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:24:58.797047004 +0200 -@@ -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 -up dhcp-4.2.4b1/includes/dhctoken.h.options dhcp-4.2.4b1/includes/dhctoken.h ---- dhcp-4.2.4b1/includes/dhctoken.h.options 2012-02-16 22:09:15.000000000 +0100 -+++ dhcp-4.2.4b1/includes/dhctoken.h 2012-04-16 17:25:53.819276248 +0200 -@@ -364,7 +364,8 @@ enum dhcp_token { - GETHOSTBYNAME = 665, - PRIMARY6 = 666, - SECONDARY6 = 667, -- TOKEN_INFINIBAND = 668 -+ TOKEN_INFINIBAND = 668, -+ BOOTP_BROADCAST_ALWAYS = 669 - }; - - #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/dhcp/patches/dhcp-4.2.4-paths.patch b/dhcp/patches/dhcp-4.2.4-paths.patch index a737571..52647ac 100644 --- a/dhcp/patches/dhcp-4.2.4-paths.patch +++ b/dhcp/patches/dhcp-4.2.4-paths.patch @@ -1,3 +1,15 @@ +diff -up dhcp-4.2.4-P2/doc/examples/dhcpd-dhcpv6.conf.paths dhcp-4.2.4-P2/doc/examples/dhcpd-dhcpv6.conf +--- dhcp-4.2.4-P2/doc/examples/dhcpd-dhcpv6.conf.paths 2012-08-24 21:11:21.000000000 +0200 ++++ dhcp-4.2.4-P2/doc/examples/dhcpd-dhcpv6.conf 2012-10-26 18:10:08.716560729 +0200 +@@ -42,7 +42,7 @@ option dhcp6.domain-search "test.example + option dhcp6.info-refresh-time 21600; + + # The path of the lease file +-dhcpv6-lease-file-name "/usr/local/var/db/dhcpd6.leases"; ++dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases"; + + # Static definition (must be global) + host myclient { diff -up dhcp-4.2.4b1/includes/dhcpd.h.paths dhcp-4.2.4b1/includes/dhcpd.h --- dhcp-4.2.4b1/includes/dhcpd.h.paths 2012-04-18 11:12:34.000000000 +0200 +++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-18 11:14:38.541272405 +0200 diff --git a/dhcp/patches/dhcp-4.2.4-rfc3442-classless-static-routes.patch b/dhcp/patches/dhcp-4.2.4-rfc3442-classless-static-routes.patch deleted file mode 100644 index a2fe219..0000000 --- a/dhcp/patches/dhcp-4.2.4-rfc3442-classless-static-routes.patch +++ /dev/null @@ -1,405 +0,0 @@ -diff -up dhcp-4.2.4b1/client/clparse.c.rfc3442 dhcp-4.2.4b1/client/clparse.c ---- dhcp-4.2.4b1/client/clparse.c.rfc3442 2012-04-16 17:34:27.546079944 +0200 -+++ dhcp-4.2.4b1/client/clparse.c 2012-04-16 17:34:27.605079118 +0200 -@@ -37,7 +37,7 @@ - - struct client_config top_level_config; - --#define NUM_DEFAULT_REQUESTED_OPTS 14 -+#define NUM_DEFAULT_REQUESTED_OPTS 15 - struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1]; - - static void parse_client_default_duid(struct parse *cfile); -@@ -90,7 +90,11 @@ isc_result_t read_client_conf () - dhcp_universe.code_hash, &code, 0, MDL); - - /* 4 */ -- code = DHO_ROUTERS; -+ /* The Classless Static Routes option code MUST appear in the parameter -+ * request list prior to both the Router option code and the Static -+ * Routes option code, if present. (RFC3442) -+ */ -+ code = DHO_CLASSLESS_STATIC_ROUTES; - option_code_hash_lookup(&default_requested_options[3], - dhcp_universe.code_hash, &code, 0, MDL); - -@@ -144,6 +148,11 @@ isc_result_t read_client_conf () - option_code_hash_lookup(&default_requested_options[13], - dhcp_universe.code_hash, &code, 0, MDL); - -+ /* 15 */ -+ code = DHO_ROUTERS; -+ option_code_hash_lookup(&default_requested_options[14], -+ dhcp_universe.code_hash, &code, 0, MDL); -+ - for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) { - if (default_requested_options[code] == NULL) - log_fatal("Unable to find option definition for " -diff -up dhcp-4.2.4b1/common/dhcp-options.5.rfc3442 dhcp-4.2.4b1/common/dhcp-options.5 ---- dhcp-4.2.4b1/common/dhcp-options.5.rfc3442 2012-04-16 17:34:27.537080070 +0200 -+++ dhcp-4.2.4b1/common/dhcp-options.5 2012-04-16 17:34:27.606079104 +0200 -@@ -115,6 +115,26 @@ hexadecimal, separated by colons. For - or - option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f; - .fi -+.PP -+The -+.B destination-descriptor -+describe the IP subnet number and subnet mask -+of a particular destination using a compact encoding. This encoding -+consists of one octet describing the width of the subnet mask, -+followed by all the significant octets of the subnet number. -+The following table contains some examples of how various subnet -+number/mask combinations can be encoded: -+.nf -+.sp 1 -+Subnet number Subnet mask Destination descriptor -+0 0 0 -+10.0.0.0 255.0.0.0 8.10 -+10.0.0.0 255.255.255.0 24.10.0.0 -+10.17.0.0 255.255.0.0 16.10.17 -+10.27.129.0 255.255.255.0 24.10.27.129 -+10.229.0.128 255.255.255.128 25.10.229.0.128 -+10.198.122.47 255.255.255.255 32.10.198.122.47 -+.fi - .SH SETTING OPTION VALUES USING EXPRESSIONS - Sometimes it's helpful to be able to set the value of a DHCP option - based on some value that the client has sent. To do this, you can -@@ -931,6 +951,29 @@ dhclient-script will create routes: - .RE - .PP - .nf -+.B option \fBclassless-static-routes\fR \fIdestination-descriptor ip-address\fR -+ [\fB,\fR \fIdestination-descriptor ip-address\fR...]\fB;\fR -+.fi -+.RS 0.25i -+.PP -+This option (see RFC3442) specifies a list of classless static routes -+that the client should install in its routing cache. -+.PP -+This option can contain one or more static routes, each of which -+consists of a destination descriptor and the IP address of the router -+that should be used to reach that destination. -+.PP -+Many clients may not implement the Classless Static Routes option. -+DHCP server administrators should therefore configure their DHCP -+servers to send both a Router option and a Classless Static Routes -+option, and should specify the default router(s) both in the Router -+option and in the Classless Static Routes option. -+.PP -+If the DHCP server returns both a Classless Static Routes option and -+a Router option, the DHCP client ignores the Router option. -+.RE -+.PP -+.nf - .B option \fBstreettalk-directory-assistance-server\fR \fIip-address\fR - [\fB,\fR \fIip-address\fR...]\fB;\fR - .fi -diff -up dhcp-4.2.4b1/common/inet.c.rfc3442 dhcp-4.2.4b1/common/inet.c ---- dhcp-4.2.4b1/common/inet.c.rfc3442 2011-05-11 02:47:22.000000000 +0200 -+++ dhcp-4.2.4b1/common/inet.c 2012-04-16 17:34:27.607079090 +0200 -@@ -528,6 +528,60 @@ free_iaddrcidrnetlist(struct iaddrcidrne - return ISC_R_SUCCESS; - } - -+static const char * -+inet_ntopdd(const unsigned char *src, unsigned srclen, char *dst, size_t size) -+{ -+ char tmp[sizeof("32.255.255.255.255")]; -+ int len; -+ -+ switch (srclen) { -+ case 2: -+ len = sprintf (tmp, "%u.%u", src[0], src[1]); -+ break; -+ case 3: -+ len = sprintf (tmp, "%u.%u.%u", src[0], src[1], src[2]); -+ break; -+ case 4: -+ len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]); -+ break; -+ case 5: -+ len = sprintf (tmp, "%u.%u.%u.%u.%u", src[0], src[1], src[2], src[3], src[4]); -+ break; -+ default: -+ return NULL; -+ } -+ if (len < 0) -+ return NULL; -+ -+ if (len > size) { -+ errno = ENOSPC; -+ return NULL; -+ } -+ -+ return strcpy (dst, tmp); -+} -+ -+/* pdestdesc() turns an iaddr structure into a printable dest. descriptor */ -+const char * -+pdestdesc(const struct iaddr addr) { -+ static char pbuf[sizeof("255.255.255.255.255")]; -+ -+ if (addr.len == 0) { -+ return "<null destination descriptor>"; -+ } -+ if (addr.len == 1) { -+ return "0"; -+ } -+ if ((addr.len >= 2) && (addr.len <= 5)) { -+ return inet_ntopdd(addr.iabuf, addr.len, pbuf, sizeof(pbuf)); -+ } -+ -+ log_fatal("pdestdesc():%s:%d: Invalid destination descriptor length %d.", -+ MDL, addr.len); -+ /* quell compiler warnings */ -+ return NULL; -+} -+ - /* piaddr() turns an iaddr structure into a printable address. */ - /* XXX: should use a const pointer rather than passing the structure */ - const char * -diff -up dhcp-4.2.4b1/common/options.c.rfc3442 dhcp-4.2.4b1/common/options.c ---- dhcp-4.2.4b1/common/options.c.rfc3442 2012-03-20 01:31:53.000000000 +0100 -+++ dhcp-4.2.4b1/common/options.c 2012-04-16 17:34:27.608079076 +0200 -@@ -706,7 +706,11 @@ cons_options(struct packet *inpacket, st - * packet. - */ - priority_list[priority_len++] = DHO_SUBNET_MASK; -- priority_list[priority_len++] = DHO_ROUTERS; -+ if (lookup_option(&dhcp_universe, cfg_options, -+ DHO_CLASSLESS_STATIC_ROUTES)) -+ priority_list[priority_len++] = DHO_CLASSLESS_STATIC_ROUTES; -+ else -+ priority_list[priority_len++] = DHO_ROUTERS; - priority_list[priority_len++] = DHO_DOMAIN_NAME_SERVERS; - priority_list[priority_len++] = DHO_HOST_NAME; - priority_list[priority_len++] = DHO_FQDN; -@@ -1683,6 +1687,7 @@ const char *pretty_print_option (option, - const unsigned char *dp = data; - char comma; - unsigned long tval; -+ unsigned int octets = 0; - - if (emit_commas) - comma = ','; -@@ -1691,6 +1696,7 @@ const char *pretty_print_option (option, - - memset (enumbuf, 0, sizeof enumbuf); - -+ if (option->format[0] != 'R') { /* see explanation lower */ - /* Figure out the size of the data. */ - for (l = i = 0; option -> format [i]; i++, l++) { - if (l >= sizeof(fmtbuf) - 1) -@@ -1840,6 +1846,33 @@ const char *pretty_print_option (option, - if (numhunk < 0) - numhunk = 1; - -+ } else { /* option->format[i] == 'R') */ -+ /* R (destination descriptor) has variable length. -+ * We can find it only in classless static route option, -+ * so we are for sure parsing classless static route option now. -+ * We go through whole the option to check whether there are no -+ * missing/extra bytes. -+ * I didn't find out how to improve the existing code and that's the -+ * reason for this separate 'else' where I do my own checkings. -+ * I know it's little bit unsystematic, but it works. -+ */ -+ numhunk = 0; -+ numelem = 2; /* RI */ -+ fmtbuf[0]='R'; fmtbuf[1]='I'; fmtbuf[2]=0; -+ for (i =0; i < len; i = i + octets + 5) { -+ if (data[i] > 32) { /* subnet mask width */ -+ log_error ("wrong subnet mask width in destination descriptor"); -+ break; -+ } -+ numhunk++; -+ octets = ((data[i]+7) / 8); -+ } -+ if (i != len) { -+ log_error ("classless static routes option has wrong size or " -+ "there's some garbage in format"); -+ } -+ } -+ - /* Cycle through the array (or hunk) printing the data. */ - for (i = 0; i < numhunk; i++) { - for (j = 0; j < numelem; j++) { -@@ -1978,6 +2011,20 @@ const char *pretty_print_option (option, - strcpy(op, piaddr(iaddr)); - dp += 4; - break; -+ -+ case 'R': -+ if (dp[0] <= 32) -+ iaddr.len = (((dp[0]+7)/8)+1); -+ else { -+ log_error ("wrong subnet mask width in destination descriptor"); -+ return "<error>"; -+ } -+ -+ memcpy(iaddr.iabuf, dp, iaddr.len); -+ strcpy(op, pdestdesc(iaddr)); -+ dp += iaddr.len; -+ break; -+ - case '6': - iaddr.len = 16; - memcpy(iaddr.iabuf, dp, 16); -diff -up dhcp-4.2.4b1/common/parse.c.rfc3442 dhcp-4.2.4b1/common/parse.c ---- dhcp-4.2.4b1/common/parse.c.rfc3442 2012-04-16 17:34:27.577079510 +0200 -+++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:34:27.610079048 +0200 -@@ -341,6 +341,39 @@ int parse_ip_addr (cfile, addr) - } - - /* -+ * destination-descriptor :== NUMBER DOT NUMBER | -+ * NUMBER DOT NUMBER DOT NUMBER | -+ * NUMBER DOT NUMBER DOT NUMBER DOT NUMBER | -+ * NUMBER DOT NUMBER DOT NUMBER DOT NUMBER DOT NUMBER -+ */ -+ -+int parse_destination_descriptor (cfile, addr) -+ struct parse *cfile; -+ struct iaddr *addr; -+{ -+ unsigned int mask_width, dest_dest_len; -+ addr -> len = 0; -+ if (parse_numeric_aggregate (cfile, addr -> iabuf, -+ &addr -> len, DOT, 10, 8)) { -+ mask_width = (unsigned int)addr->iabuf[0]; -+ dest_dest_len = (((mask_width+7)/8)+1); -+ if (mask_width > 32) { -+ parse_warn (cfile, -+ "subnet mask width (%u) greater than 32.", mask_width); -+ } -+ else if (dest_dest_len != addr->len) { -+ parse_warn (cfile, -+ "destination descriptor with subnet mask width %u " -+ "should have %u octets, but has %u octets.", -+ mask_width, dest_dest_len, addr->len); -+ } -+ -+ return 1; -+ } -+ return 0; -+} -+ -+/* - * Return true if every character in the string is hexadecimal. - */ - static int -@@ -704,8 +737,10 @@ unsigned char *parse_numeric_aggregate ( - if (count) { - token = peek_token (&val, (unsigned *)0, cfile); - if (token != separator) { -- if (!*max) -+ if (!*max) { -+ *max = count; - break; -+ } - if (token != RBRACE && token != LBRACE) - token = next_token (&val, - (unsigned *)0, -@@ -1628,6 +1663,9 @@ int parse_option_code_definition (cfile, - case IP_ADDRESS: - type = 'I'; - break; -+ case DESTINATION_DESCRIPTOR: -+ type = 'R'; -+ break; - case IP6_ADDRESS: - type = '6'; - break; -@@ -5375,6 +5413,15 @@ int parse_option_token (rv, cfile, fmt, - } - break; - -+ case 'R': /* destination descriptor */ -+ if (!parse_destination_descriptor (cfile, &addr)) { -+ return 0; -+ } -+ if (!make_const_data (&t, addr.iabuf, addr.len, 0, 1, MDL)) { -+ return 0; -+ } -+ break; -+ - case '6': /* IPv6 address. */ - if (!parse_ip6_addr(cfile, &addr)) { - return 0; -@@ -5635,6 +5682,13 @@ int parse_option_decl (oc, cfile) - goto exit; - len = ip_addr.len; - dp = ip_addr.iabuf; -+ goto alloc; -+ -+ case 'R': /* destination descriptor */ -+ if (!parse_destination_descriptor (cfile, &ip_addr)) -+ goto exit; -+ len = ip_addr.len; -+ dp = ip_addr.iabuf; - - alloc: - if (hunkix + len > sizeof hunkbuf) { -diff -up dhcp-4.2.4b1/common/tables.c.rfc3442 dhcp-4.2.4b1/common/tables.c ---- dhcp-4.2.4b1/common/tables.c.rfc3442 2012-04-16 17:34:27.566079664 +0200 -+++ dhcp-4.2.4b1/common/tables.c 2012-04-16 17:34:27.611079034 +0200 -@@ -52,6 +52,7 @@ HASH_FUNCTIONS (option_code, const unsig - Format codes: - - I - IPv4 address -+ R - destination descriptor (RFC3442) - 6 - IPv6 address - l - 32-bit signed integer - L - 32-bit unsigned integer -@@ -209,6 +210,7 @@ static struct option dhcp_options[] = { - { "default-url", "t", &dhcp_universe, 114, 1 }, - { "subnet-selection", "I", &dhcp_universe, 118, 1 }, - { "domain-search", "D", &dhcp_universe, 119, 1 }, -+ { "classless-static-routes", "RIA", &dhcp_universe, 121, 1 }, - { "vivco", "Evendor-class.", &dhcp_universe, 124, 1 }, - { "vivso", "Evendor.", &dhcp_universe, 125, 1 }, - #if 0 -diff -up dhcp-4.2.4b1/includes/dhcpd.h.rfc3442 dhcp-4.2.4b1/includes/dhcpd.h ---- dhcp-4.2.4b1/includes/dhcpd.h.rfc3442 2012-04-16 17:34:27.543079986 +0200 -+++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:34:27.613079006 +0200 -@@ -2666,6 +2666,7 @@ isc_result_t range2cidr(struct iaddrcidr - const struct iaddr *lo, const struct iaddr *hi); - isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result); - const char *piaddr (struct iaddr); -+const char *pdestdesc (struct iaddr); - char *piaddrmask(struct iaddr *, struct iaddr *); - char *piaddrcidr(const struct iaddr *, unsigned int); - u_int16_t validate_port(char *); -@@ -2873,6 +2874,7 @@ void parse_client_lease_declaration (str - int parse_option_decl (struct option_cache **, struct parse *); - void parse_string_list (struct parse *, struct string_list **, int); - int parse_ip_addr (struct parse *, struct iaddr *); -+int parse_destination_descriptor (struct parse *, struct iaddr *); - int parse_ip_addr_with_subnet(struct parse *, struct iaddrmatch *); - void parse_reject_statement (struct parse *, struct client_config *); - -diff -up dhcp-4.2.4b1/includes/dhcp.h.rfc3442 dhcp-4.2.4b1/includes/dhcp.h ---- dhcp-4.2.4b1/includes/dhcp.h.rfc3442 2012-02-16 22:09:14.000000000 +0100 -+++ dhcp-4.2.4b1/includes/dhcp.h 2012-04-16 17:34:27.613079006 +0200 -@@ -163,6 +163,7 @@ struct dhcp_packet { - #define DHO_ASSOCIATED_IP 92 - #define DHO_SUBNET_SELECTION 118 /* RFC3011! */ - #define DHO_DOMAIN_SEARCH 119 /* RFC3397 */ -+#define DHO_CLASSLESS_STATIC_ROUTES 121 /* RFC3442 */ - #define DHO_VIVCO_SUBOPTIONS 124 - #define DHO_VIVSO_SUBOPTIONS 125 - -diff -up dhcp-4.2.4b1/includes/dhctoken.h.rfc3442 dhcp-4.2.4b1/includes/dhctoken.h ---- dhcp-4.2.4b1/includes/dhctoken.h.rfc3442 2012-04-16 17:34:27.000000000 +0200 -+++ dhcp-4.2.4b1/includes/dhctoken.h 2012-04-16 17:35:15.028414805 +0200 -@@ -365,7 +365,8 @@ enum dhcp_token { - PRIMARY6 = 666, - SECONDARY6 = 667, - TOKEN_INFINIBAND = 668, -- BOOTP_BROADCAST_ALWAYS = 669 -+ BOOTP_BROADCAST_ALWAYS = 669, -+ DESTINATION_DESCRIPTOR = 670 - }; - - #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/dhcp/patches/dhcp-4.2.4-systemtap.patch b/dhcp/patches/dhcp-4.2.4-systemtap.patch deleted file mode 100644 index 6f036a7..0000000 --- a/dhcp/patches/dhcp-4.2.4-systemtap.patch +++ /dev/null @@ -1,808 +0,0 @@ -diff -up dhcp-4.2.4b1/configure.ac.systemtap dhcp-4.2.4b1/configure.ac ---- dhcp-4.2.4b1/configure.ac.systemtap 2012-04-16 17:46:10.913227143 +0200 -+++ dhcp-4.2.4b1/configure.ac 2012-04-16 17:46:10.947226667 +0200 -@@ -504,6 +504,35 @@ else - AC_MSG_RESULT(no) - fi - -+AC_MSG_CHECKING([whether to include systemtap tracing support]) -+AC_ARG_ENABLE([systemtap], -+ [AS_HELP_STRING([--enable-systemtap], -+ [Enable inclusion of systemtap trace support])], -+ [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no']) -+AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes]) -+AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) -+ -+if test "x${ENABLE_SYSTEMTAP}" = xyes; then -+ # Additional configuration for --enable-systemtap is HERE -+ AC_CHECK_PROGS(DTRACE, dtrace) -+ if test -z "$DTRACE"; then -+ AC_MSG_ERROR([dtrace not found]) -+ fi -+ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'], -+ [SDT_H_FOUND='no'; -+ AC_MSG_ERROR([systemtap support needs sys/sdt.h header])]) -+ AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using SystemTap probes.]) -+ AC_ARG_WITH([tapset-install-dir], -+ [AS_HELP_STRING([--with-tapset-install-dir], -+ [The absolute path where the tapset dir will be installed])], -+ [if test "x${withval}" = x; then -+ ABS_TAPSET_DIR="$(datadir)/systemtap/tapset" -+ else -+ ABS_TAPSET_DIR="${withval}" -+ fi], [ABS_TAPSET_DIR="$(datadir)/systemtap/tapset"]) -+ AC_SUBST(ABS_TAPSET_DIR) -+fi -+ - # Solaris needs some libraries for functions - AC_SEARCH_LIBS(socket, [socket]) - AC_SEARCH_LIBS(inet_ntoa, [nsl]) -@@ -650,6 +679,7 @@ AC_OUTPUT([ - relay/Makefile - server/Makefile - tests/Makefile -+ tapset/Makefile - ]) - - sh util/bindvar.sh -diff -up dhcp-4.2.4b1/Makefile.am.systemtap dhcp-4.2.4b1/Makefile.am ---- dhcp-4.2.4b1/Makefile.am.systemtap 2012-04-16 17:46:10.791228851 +0200 -+++ dhcp-4.2.4b1/Makefile.am 2012-04-16 17:46:10.947226667 +0200 -@@ -29,5 +29,8 @@ endif - - SUBDIRS += includes tests common omapip client dhcpctl relay server - -+SUBDIRS += tapset -+#DIST_SUBDIRS = $(SUBDIRS) -+ - nobase_include_HEADERS = dhcpctl/dhcpctl.h - -diff -up dhcp-4.2.4b1/server/dhcp.c.systemtap dhcp-4.2.4b1/server/dhcp.c ---- dhcp-4.2.4b1/server/dhcp.c.systemtap 2012-04-16 17:46:10.816228501 +0200 -+++ dhcp-4.2.4b1/server/dhcp.c 2012-04-16 17:48:11.528537555 +0200 -@@ -36,7 +36,7 @@ - #include <errno.h> - #include <limits.h> - #include <sys/time.h> -- -+#include "trace.h" - static void commit_leases_ackout(void *foo); - static void maybe_return_agent_options(struct packet *packet, - struct option_state *options); -@@ -275,6 +275,8 @@ void dhcpdiscover (packet, ms_nulltp) - dhcp_failover_state_t *peer; - #endif - -+ TRACE(DHCPD_DISCOVER_START()); -+ - find_lease (&lease, packet, packet -> shared_network, - 0, &peer_has_leases, (struct lease *)0, MDL); - -@@ -399,6 +401,8 @@ void dhcpdiscover (packet, ms_nulltp) - out: - if (lease) - lease_dereference (&lease, MDL); -+ -+ TRACE(DHCPD_DISCOVER_DONE()); - } - - void dhcprequest (packet, ms_nulltp, ip_lease) -@@ -421,6 +425,8 @@ void dhcprequest (packet, ms_nulltp, ip_ - #endif - int have_requested_addr = 0; - -+ TRACE(DHCPD_REQUEST_START()); -+ - oc = lookup_option (&dhcp_universe, packet -> options, - DHO_DHCP_REQUESTED_ADDRESS); - memset (&data, 0, sizeof data); -@@ -677,6 +683,9 @@ void dhcprequest (packet, ms_nulltp, ip_ - log_info ("%s: unknown lease %s.", msgbuf, piaddr (cip)); - - out: -+ -+ TRACE(DHCPD_REQUEST_DONE()); -+ - if (subnet) - subnet_dereference (&subnet, MDL); - if (lease) -@@ -695,6 +704,7 @@ void dhcprelease (packet, ms_nulltp) - const char *s; - char msgbuf [1024], cstr[16]; /* XXX */ - -+ TRACE(DHCPD_RELEASE_START()); - - /* DHCPRELEASE must not specify address in requested-address - option, but old protocol specs weren't explicit about this, -@@ -819,6 +829,8 @@ void dhcprelease (packet, ms_nulltp) - #endif - if (lease) - lease_dereference (&lease, MDL); -+ -+ TRACE(DHCPD_RELEASE_DONE()); - } - - void dhcpdecline (packet, ms_nulltp) -@@ -836,6 +848,8 @@ void dhcpdecline (packet, ms_nulltp) - struct option_cache *oc; - struct data_string data; - -+ TRACE(DHCPD_DECLINE_START()); -+ - /* DHCPDECLINE must specify address. */ - if (!(oc = lookup_option (&dhcp_universe, packet -> options, - DHO_DHCP_REQUESTED_ADDRESS))) -@@ -947,6 +961,8 @@ void dhcpdecline (packet, ms_nulltp) - option_state_dereference (&options, MDL); - if (lease) - lease_dereference (&lease, MDL); -+ -+ TRACE(DHCPD_DECLINE_DONE()); - } - - void dhcpinform (packet, ms_nulltp) -@@ -970,6 +986,8 @@ void dhcpinform (packet, ms_nulltp) - struct interface_info *interface; - int result; - -+ TRACE(DHCPD_INFORM_START()); -+ - /* The client should set ciaddr to its IP address, but apparently - it's common for clients not to do this, so we'll use their IP - source address if they didn't set ciaddr. */ -@@ -1327,6 +1345,8 @@ void dhcpinform (packet, ms_nulltp) - - if (subnet) - subnet_dereference (&subnet, MDL); -+ -+ TRACE(DHCPD_INFORM_DONE()); - } - - void nak_lease (packet, cip) -@@ -1343,6 +1363,8 @@ void nak_lease (packet, cip) - struct option_state *options = (struct option_state *)0; - struct option_cache *oc = (struct option_cache *)0; - -+ TRACE(DHCPD_NAK_LEASE_START()); -+ - option_state_allocate (&options, MDL); - memset (&outgoing, 0, sizeof outgoing); - memset (&raw, 0, sizeof raw); -@@ -1494,6 +1516,7 @@ void nak_lease (packet, cip) - packet->interface->name); - } - -+ TRACE(DHCPD_NAK_LEASE_DONE()); - } - - void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) -@@ -1535,6 +1558,8 @@ void ack_lease (packet, lease, offer, wh - if (lease -> state) - return; - -+ TRACE(DHCPD_ACK_LEASE_START()); -+ - /* Save original cltt for comparison later. */ - lease_cltt = lease->cltt; - -@@ -2897,6 +2922,8 @@ void ack_lease (packet, lease, offer, wh - #endif - dhcp_reply(lease); - } -+ -+ TRACE(DHCPD_ACK_LEASE_DONE()); - } - - /* -@@ -3049,6 +3076,8 @@ void dhcp_reply (lease) - if (!state) - log_fatal ("dhcp_reply was supplied lease with no state!"); - -+ TRACE(DHCPD_REPLY_START()); -+ - /* Compose a response for the client... */ - memset (&raw, 0, sizeof raw); - memset (&d1, 0, sizeof d1); -@@ -3270,6 +3299,8 @@ void dhcp_reply (lease) - - free_lease_state (state, MDL); - lease -> state = (struct lease_state *)0; -+ -+ TRACE(DHCPD_REPLY_DONE()); - } - - int find_lease (struct lease **lp, -@@ -3292,6 +3323,8 @@ int find_lease (struct lease **lp, - struct data_string client_identifier; - struct hardware h; - -+ TRACE(DHCPD_FIND_LEASE_START()); -+ - #if defined(FAILOVER_PROTOCOL) - /* Quick check to see if the peer has leases. */ - if (peer_has_leases) { -@@ -4019,6 +4052,9 @@ int find_lease (struct lease **lp, - #if defined (DEBUG_FIND_LEASE) - log_info ("Not returning a lease."); - #endif -+ -+ TRACE(DHCPD_FIND_LEASE_DONE()); -+ - return 0; - } - -diff -up dhcp-4.2.4b1/server/dhcpd.c.systemtap dhcp-4.2.4b1/server/dhcpd.c ---- dhcp-4.2.4b1/server/dhcpd.c.systemtap 2012-04-16 17:46:10.928226933 +0200 -+++ dhcp-4.2.4b1/server/dhcpd.c 2012-04-16 17:46:10.951226611 +0200 -@@ -58,6 +58,8 @@ static const char url [] = - # undef group - #endif /* PARANOIA */ - -+#include "trace.h" -+ - static void usage(void); - - struct iaddr server_identifier; -@@ -859,6 +861,7 @@ main(int argc, char **argv) { - omapi_set_int_value ((omapi_object_t *)dhcp_control_object, - (omapi_object_t *)0, "state", server_running); - -+ TRACE(DHCPD_MAIN()); - /* Receive packets and dispatch them... */ - dispatch (); - -diff -up dhcp-4.2.4b1/server/dhcpv6.c.systemtap dhcp-4.2.4b1/server/dhcpv6.c ---- dhcp-4.2.4b1/server/dhcpv6.c.systemtap 2012-04-16 17:46:10.925226975 +0200 -+++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:46:10.953226583 +0200 -@@ -15,6 +15,7 @@ - */ - - #include "dhcpd.h" -+#include "trace.h" - - #ifdef DHCPv6 - -@@ -4198,6 +4199,8 @@ static void - dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) { - struct data_string client_id; - -+ TRACE(DHCPD_6_SOLICIT_START()); -+ - /* - * Validate our input. - */ -@@ -4211,6 +4214,8 @@ dhcpv6_solicit(struct data_string *reply - * Clean up. - */ - data_string_forget(&client_id, MDL); -+ -+ TRACE(DHCPD_6_SOLICIT_DONE()); - } - - /* -@@ -4224,6 +4229,8 @@ dhcpv6_request(struct data_string *reply - struct data_string client_id; - struct data_string server_id; - -+ TRACE(DHCPD_6_REQUEST_START()); -+ - /* - * Validate our input. - */ -@@ -4241,6 +4248,8 @@ dhcpv6_request(struct data_string *reply - */ - data_string_forget(&client_id, MDL); - data_string_forget(&server_id, MDL); -+ -+ TRACE(DHCPD_6_REQUEST_DONE()); - } - - /* Find a DHCPv6 packet's shared network from hints in the packet. -@@ -4353,6 +4362,8 @@ dhcpv6_confirm(struct data_string *reply - struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data; - int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options)); - -+ TRACE(DHCPD_6_CONFIRM_START()); -+ - /* - * Basic client message validation. - */ -@@ -4539,6 +4550,8 @@ exit: - option_state_dereference(&cli_enc_opt_state, MDL); - if (opt_state != NULL) - option_state_dereference(&opt_state, MDL); -+ -+ TRACE(DHCPD_6_CONFIRM_DONE()); - } - - /* -@@ -4553,6 +4566,8 @@ dhcpv6_renew(struct data_string *reply, - struct data_string client_id; - struct data_string server_id; - -+ TRACE(DHCPD_6_RENEW_START()); -+ - /* - * Validate the request. - */ -@@ -4570,6 +4585,8 @@ dhcpv6_renew(struct data_string *reply, - */ - data_string_forget(&server_id, MDL); - data_string_forget(&client_id, MDL); -+ -+ TRACE(DHCPD_6_RENEW_DONE()); - } - - /* -@@ -4583,6 +4600,8 @@ static void - dhcpv6_rebind(struct data_string *reply, struct packet *packet) { - struct data_string client_id; - -+ TRACE(DHCPD_6_REBIND_START()); -+ - if (!valid_client_msg(packet, &client_id)) { - return; - } -@@ -4590,6 +4609,8 @@ dhcpv6_rebind(struct data_string *reply, - lease_to_client(reply, packet, &client_id, NULL); - - data_string_forget(&client_id, MDL); -+ -+ TRACE(DHCPD_6_REBIND_DONE()); - } - - static void -@@ -5034,6 +5055,8 @@ dhcpv6_decline(struct data_string *reply - struct data_string client_id; - struct data_string server_id; - -+ TRACE(DHCPD_6_DECLINE_START()); -+ - /* - * Validate our input. - */ -@@ -5054,6 +5077,8 @@ dhcpv6_decline(struct data_string *reply - - data_string_forget(&server_id, MDL); - data_string_forget(&client_id, MDL); -+ -+ TRACE(DHCPD_6_DECLINE_DONE()); - } - - static void -@@ -5502,6 +5527,8 @@ dhcpv6_release(struct data_string *reply - struct data_string client_id; - struct data_string server_id; - -+ TRACE(DHCPD_6_RELEASE_START()); -+ - /* - * Validate our input. - */ -@@ -5523,6 +5550,8 @@ dhcpv6_release(struct data_string *reply - - data_string_forget(&server_id, MDL); - data_string_forget(&client_id, MDL); -+ -+ TRACE(DHCPD_6_RELEASE_DONE()); - } - - /* -@@ -5535,6 +5564,8 @@ dhcpv6_information_request(struct data_s - struct data_string client_id; - struct data_string server_id; - -+ TRACE(DHCPD_6_INFORMATION_REQUEST_START()); -+ - /* - * Validate our input. - */ -@@ -5566,6 +5597,8 @@ dhcpv6_information_request(struct data_s - data_string_forget(&client_id, MDL); - } - data_string_forget(&server_id, MDL); -+ -+ TRACE(DHCPD_6_INFORMATION_REQUEST_DONE()); - } - - /* -@@ -5594,6 +5627,8 @@ dhcpv6_relay_forw(struct data_string *re - struct dhcpv6_relay_packet *reply; - int reply_ofs; - -+ TRACE(DHCPD_6_RELAY_FORW_START()); -+ - /* - * Initialize variables for early exit. - */ -@@ -5853,6 +5888,8 @@ exit: - if (enc_packet != NULL) { - packet_dereference(&enc_packet, MDL); - } -+ -+ TRACE(DHCPD_6_RELAY_FORW_DONE()); - } - - static void -diff -up dhcp-4.2.4b1/server/failover.c.systemtap dhcp-4.2.4b1/server/failover.c ---- dhcp-4.2.4b1/server/failover.c.systemtap 2012-03-19 23:29:49.000000000 +0100 -+++ dhcp-4.2.4b1/server/failover.c 2012-04-16 17:46:10.955226555 +0200 -@@ -36,6 +36,8 @@ - #include "dhcpd.h" - #include <omapip/omapip_p.h> - -+#include "trace.h" -+ - #if defined (FAILOVER_PROTOCOL) - dhcp_failover_state_t *failover_states; - static isc_result_t do_a_failover_option (omapi_object_t *, -@@ -1712,6 +1714,8 @@ isc_result_t dhcp_failover_set_state (dh - struct lease *l; - struct timeval tv; - -+ TRACE(DHCPD_FAILOVER_SET_STATE_START(state->me.state, new_state)); -+ - /* If we're in certain states where we're sending updates, and the peer - * state changes, we need to re-schedule any pending updates just to - * be on the safe side. This results in retransmission. -@@ -1939,6 +1943,8 @@ isc_result_t dhcp_failover_set_state (dh - break; - } - -+ TRACE(DHCPD_FAILOVER_SET_STATE_DONE()); -+ - return ISC_R_SUCCESS; - } - -@@ -2422,6 +2428,8 @@ dhcp_failover_pool_dobalance(dhcp_failov - if (state -> me.state != normal) - return 0; - -+ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_START()); -+ - state->last_balance = cur_time; - - for (s = shared_networks ; s ; s = s->next) { -@@ -2582,6 +2590,8 @@ dhcp_failover_pool_dobalance(dhcp_failov - if (leases_queued) - commit_leases(); - -+ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_DONE()); -+ - return leases_queued; - } - -diff -up dhcp-4.2.4b1/server/Makefile.am.systemtap dhcp-4.2.4b1/server/Makefile.am ---- dhcp-4.2.4b1/server/Makefile.am.systemtap 2012-04-16 17:46:10.914227129 +0200 -+++ dhcp-4.2.4b1/server/Makefile.am 2012-04-16 17:46:10.956226541 +0200 -@@ -4,7 +4,7 @@ dist_sysconf_DATA = dhcpd.conf - sbin_PROGRAMS = dhcpd - dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \ - omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \ -- dhcpv6.c mdb6.c ldap.c ldap_casa.c -+ dhcpv6.c mdb6.c ldap.c ldap_casa.c probes.d trace.h - - dhcpd_CFLAGS = $(LDAP_CFLAGS) - dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ -@@ -13,3 +13,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma - man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 - EXTRA_DIST = $(man_MANS) - -+if ENABLE_SYSTEMTAP -+BUILT_SOURCES = probes.h -+probes.h: probes.d -+ $(DTRACE) -C -h -s $< -o $@ -+ -+probes.o: probes.d -+ $(DTRACE) -C -G -s $< -o $@ -+ -+dhcpd_LDADD += probes.o -+endif -diff -up dhcp-4.2.4b1/server/probes.d.systemtap dhcp-4.2.4b1/server/probes.d ---- dhcp-4.2.4b1/server/probes.d.systemtap 2012-04-16 17:46:10.956226541 +0200 -+++ dhcp-4.2.4b1/server/probes.d 2012-04-16 17:46:10.956226541 +0200 -@@ -0,0 +1,43 @@ -+provider dhcpd { -+ probe main(); -+ probe discover_start() -+ probe discover_done() -+ probe request_start() -+ probe request_done() -+ probe release_start() -+ probe release_done() -+ probe decline_start() -+ probe decline_done() -+ probe inform_start() -+ probe inform_done() -+ probe nak_lease_start() -+ probe nak_lease_done() -+ probe ack_lease_start() -+ probe ack_lease_done() -+ probe reply_start() -+ probe reply_done() -+ probe find_lease_start() -+ probe find_lease_done() -+ probe 6_solicit_start() -+ probe 6_solicit_done() -+ probe 6_request_start() -+ probe 6_request_done() -+ probe 6_confirm_start() -+ probe 6_confirm_done() -+ probe 6_renew_start() -+ probe 6_renew_done() -+ probe 6_rebind_start() -+ probe 6_rebind_done() -+ probe 6_decline_start() -+ probe 6_decline_done() -+ probe 6_release_start() -+ probe 6_release_done() -+ probe 6_information_request_start() -+ probe 6_information_request_done() -+ probe 6_relay_forw_start() -+ probe 6_relay_forw_done() -+ probe failover_pool_dobalance_start() -+ probe failover_pool_dobalance_done() -+ probe failover_set_state_start(int, int) /* state, new_state */ -+ probe failover_set_state_done() -+}; -diff -up dhcp-4.2.4b1/server/trace.h.systemtap dhcp-4.2.4b1/server/trace.h ---- dhcp-4.2.4b1/server/trace.h.systemtap 2012-04-16 17:46:10.956226541 +0200 -+++ dhcp-4.2.4b1/server/trace.h 2012-04-16 17:46:10.956226541 +0200 -@@ -0,0 +1,11 @@ -+// trace.h -+ -+#include "config.h" -+#ifdef HAVE_SYSTEMTAP -+// include the generated probes header and put markers in code -+#include "probes.h" -+#define TRACE(probe) probe -+#else -+// Wrap the probe to allow it to be removed when no systemtap available -+#define TRACE(probe) -+#endif -diff -up dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap dhcp-4.2.4b1/tapset/dhcpd.stp ---- dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap 2012-04-16 17:46:10.957226527 +0200 -+++ dhcp-4.2.4b1/tapset/dhcpd.stp 2012-04-16 17:46:10.957226527 +0200 -@@ -0,0 +1,212 @@ -+/* dhcpd tapset -+ Copyright (C) 2011, Red Hat Inc. -+ */ -+ -+probe dhcpd_main = process("dhcpd").mark("main") -+{ -+ probestr = sprintf("%s(locals: %s)", $$name, $$locals); -+ -+} -+ -+probe dhcpd_discover_start = process("dhcpd").mark("discover_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_discover_done = process("dhcpd").mark("discover_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_request_start = process("dhcpd").mark("request_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_request_done = process("dhcpd").mark("request_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_release_start = process("dhcpd").mark("release_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_release_done = process("dhcpd").mark("release_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_decline_start = process("dhcpd").mark("decline_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_decline_done = process("dhcpd").mark("decline_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_inform_start = process("dhcpd").mark("inform_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_inform_done = process("dhcpd").mark("inform_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_nak_lease_start = process("dhcpd").mark("nak_lease_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_nak_lease_done = process("dhcpd").mark("nak_lease_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_ack_lease_start = process("dhcpd").mark("ack_lease_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_ack_lease_done = process("dhcpd").mark("ack_lease_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_reply_start = process("dhcpd").mark("reply_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_reply_done = process("dhcpd").mark("reply_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_find_lease_start = process("dhcpd").mark("find_lease_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_find_lease_done = process("dhcpd").mark("find_lease_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_solicit_start = process("dhcpd").mark("6_solicit_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_solicit_done = process("dhcpd").mark("6_solicit_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_request_start = process("dhcpd").mark("6_request_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_request_done = process("dhcpd").mark("6_request_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_confirm_start = process("dhcpd").mark("6_confirm_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_confirm_done = process("dhcpd").mark("6_confirm_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_renew_start = process("dhcpd").mark("6_renew_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_renew_done = process("dhcpd").mark("6_renew_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_rebind_start = process("dhcpd").mark("6_rebind_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_rebind_done = process("dhcpd").mark("6_rebind_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_decline_start = process("dhcpd").mark("6_decline_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_decline_done = process("dhcpd").mark("6_decline_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_release_start = process("dhcpd").mark("6_release_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_release_done = process("dhcpd").mark("6_release_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_information_request_start = process("dhcpd").mark("6_information_request_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_information_request_done = process("dhcpd").mark("6_information_request_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_relay_forw_start = process("dhcpd").mark("6_relay_forw_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_6_relay_forw_done = process("dhcpd").mark("6_relay_forw_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_failover_pool_dobalance_start = process("dhcpd").mark("failover_pool_dobalance_start") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+probe dhcpd_failover_pool_dobalance_done = process("dhcpd").mark("failover_pool_dobalance_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -+ -+ -+probe dhcpd_failover_set_state_start = process("dhcpd").mark("failover_set_state_start") -+{ -+ state = $arg1; -+ new_state = $arg2; -+ probestr = sprintf("%s(state=%d, new_state=%d)", $$name, state, new_state); -+} -+ -+probe dhcpd_failover_set_state_done = process("dhcpd").mark("failover_set_state_done") -+{ -+ probestr = sprintf("%s", $$name); -+} -diff -up dhcp-4.2.4b1/tapset/Makefile.am.systemtap dhcp-4.2.4b1/tapset/Makefile.am ---- dhcp-4.2.4b1/tapset/Makefile.am.systemtap 2012-04-16 17:46:10.957226527 +0200 -+++ dhcp-4.2.4b1/tapset/Makefile.am 2012-04-16 17:46:10.957226527 +0200 -@@ -0,0 +1,26 @@ -+# Makefile.am for dhcp/tapset -+# Jiri Popelka -+ -+.PHONY: clean-local install-data-hook uninstall-local -+ -+# -+EXTRA_DIST = dhcpd.stp -+TAPSET_FILES = $(EXTRA_DIST) -+TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@ -+ -+if ENABLE_SYSTEMTAP -+all-local: $(TAPSET_FILES) -+ -+clean-local: -+ -+install-data-hook: -+ $(MKDIR_P) $(TAPSET_INSTALL_DIR) -+ $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR) -+ -+uninstall-local: -+ @list='$(TAPSET_FILES)'; for p in $$list; do \ -+ echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \ -+ rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \ -+ done -+endif -+ diff --git a/dhcp/patches/dhcp-4.2.5-PPP.patch b/dhcp/patches/dhcp-4.2.5-PPP.patch new file mode 100644 index 0000000..1bc1e3f --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-PPP.patch @@ -0,0 +1,150 @@ +diff -up dhcp-4.2.4b1/client/dhc6.c.PPP dhcp-4.2.4b1/client/dhc6.c +--- dhcp-4.2.4b1/client/dhc6.c.PPP 2012-04-16 17:37:23.243618764 +0200 ++++ dhcp-4.2.4b1/client/dhc6.c 2012-04-16 17:37:23.252618638 +0200 +@@ -133,7 +133,7 @@ extern int stateless; + * is not how it is intended. Upcoming rearchitecting the client should + * address this "one daemon model." + */ +-void ++isc_result_t + form_duid(struct data_string *duid, const char *file, int line) + { + struct interface_info *ip; +@@ -145,6 +145,15 @@ form_duid(struct data_string *duid, cons + if (ip == NULL) + log_fatal("Impossible condition at %s:%d.", MDL); + ++ while (ip && ip->hw_address.hbuf[0] == HTYPE_RESERVED) { ++ /* Try the other interfaces */ ++ log_debug("Cannot form default DUID from interface %s.", ip->name); ++ ip = ip->next; ++ } ++ if (ip == NULL) { ++ return ISC_R_UNEXPECTED; ++ } ++ + if ((ip->hw_address.hlen == 0) || + (ip->hw_address.hlen > sizeof(ip->hw_address.hbuf))) + log_fatal("Impossible hardware address length at %s:%d.", MDL); +@@ -180,6 +189,8 @@ form_duid(struct data_string *duid, cons + memcpy(duid->buffer->data + 4, ip->hw_address.hbuf + 1, + ip->hw_address.hlen - 1); + } ++ ++ return ISC_R_SUCCESS; + } + + /* +@@ -5130,7 +5141,8 @@ make_client6_options(struct client_state + */ + if ((oc = lookup_option(&dhcpv6_universe, *op, + D6O_CLIENTID)) == NULL) { +- if (!option_cache(&oc, &default_duid, NULL, clientid_option, ++ if (default_duid.len == 0 || ++ !option_cache(&oc, &default_duid, NULL, clientid_option, + MDL)) + log_fatal("Failure assembling a DUID."); + +diff -up dhcp-4.2.4b1/client/dhclient.c.PPP dhcp-4.2.4b1/client/dhclient.c +--- dhcp-4.2.4b1/client/dhclient.c.PPP 2012-04-16 17:37:23.214619170 +0200 ++++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:37:23.254618610 +0200 +@@ -919,8 +919,8 @@ main(int argc, char **argv) { + if (default_duid.buffer != NULL) + data_string_forget(&default_duid, MDL); + +- form_duid(&default_duid, MDL); +- write_duid(&default_duid); ++ if (form_duid(&default_duid, MDL) == ISC_R_SUCCESS) ++ write_duid(&default_duid); + } + + for (ip = interfaces ; ip != NULL ; ip = ip->next) { +diff -up dhcp-4.2.4b1/common/bpf.c.PPP dhcp-4.2.4b1/common/bpf.c +--- dhcp-4.2.4b1/common/bpf.c.PPP 2012-04-16 17:37:23.175619716 +0200 ++++ dhcp-4.2.4b1/common/bpf.c 2012-04-16 17:37:23.255618596 +0200 +@@ -599,6 +599,22 @@ get_hw_addr(const char *name, struct har + memcpy(&hw->hbuf[1], LLADDR(sa), sa->sdl_alen); + break; + #endif /* IFT_FDDI */ ++#if defined(IFT_PPP) ++ case IFT_PPP: ++ if (local_family != AF_INET6) ++ log_fatal("Unsupported device type %d for "%s"", ++ sa->sdl_type, name); ++ hw->hlen = 0; ++ hw->hbuf[0] = HTYPE_RESERVED; ++ /* 0xdeadbeef should never occur on the wire, ++ * and is a signature that something went wrong. ++ */ ++ hw->hbuf[1] = 0xde; ++ hw->hbuf[2] = 0xad; ++ hw->hbuf[3] = 0xbe; ++ hw->hbuf[4] = 0xef; ++ break; ++#endif + default: + log_fatal("Unsupported device type %d for "%s"", + sa->sdl_type, name); +diff -up dhcp-4.2.4b1/common/lpf.c.PPP dhcp-4.2.4b1/common/lpf.c +--- dhcp-4.2.4b1/common/lpf.c.PPP 2012-04-16 17:37:23.155619996 +0200 ++++ dhcp-4.2.4b1/common/lpf.c 2012-04-16 17:37:23.256618582 +0200 +@@ -503,6 +503,22 @@ get_hw_addr(const char *name, struct har + hw->hbuf[0] = HTYPE_FDDI; + memcpy(&hw->hbuf[1], sa->sa_data, 6); + 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); ++ hw->hlen = 0; ++ hw->hbuf[0] = HTYPE_RESERVED; ++ /* 0xdeadbeef should never occur on the wire, ++ * and is a signature that something went wrong. ++ */ ++ hw->hbuf[1] = 0xde; ++ hw->hbuf[2] = 0xad; ++ hw->hbuf[3] = 0xbe; ++ hw->hbuf[4] = 0xef; ++ break; ++#endif + default: + log_fatal("Unsupported device type %ld for "%s"", + (long int)sa->sa_family, name); +diff -up dhcp-4.2.4b1/includes/dhcpd.h.PPP dhcp-4.2.4b1/includes/dhcpd.h +--- dhcp-4.2.4b1/includes/dhcpd.h.PPP 2012-04-16 17:37:23.239618820 +0200 ++++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:37:23.257618568 +0200 +@@ -2760,7 +2760,7 @@ void dhcpv4_client_assignments(void); + void dhcpv6_client_assignments(void); + + /* dhc6.c */ +-void form_duid(struct data_string *duid, const char *file, int line); ++isc_result_t form_duid(struct data_string *duid, const char *file, int line); + void dhc6_lease_destroy(struct dhc6_lease **src, const char *file, int line); + void start_init6(struct client_state *client); + void start_info_request6(struct client_state *client); +diff -up dhcp-4.2.4b1/includes/dhcp.h.PPP dhcp-4.2.4b1/includes/dhcp.h +--- dhcp-4.2.4b1/includes/dhcp.h.PPP 2012-04-16 17:37:23.000000000 +0200 ++++ dhcp-4.2.4b1/includes/dhcp.h 2012-04-16 17:38:34.675618138 +0200 +@@ -85,6 +85,8 @@ struct dhcp_packet { + * is no standard for this so we + * just steal a type */ + ++#define HTYPE_RESERVED 0 /* RFC 5494 */ ++ + /* Magic cookie validating dhcp options field (and bootp vendor + extensions field). */ + #define DHCP_OPTIONS_COOKIE "\143\202\123\143" +diff -up dhcp-4.2.4b1/server/dhcpv6.c.PPP dhcp-4.2.4b1/server/dhcpv6.c +--- dhcp-4.2.4b1/server/dhcpv6.c.PPP 2012-04-16 17:37:23.218619114 +0200 ++++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:37:23.260618526 +0200 +@@ -300,6 +300,9 @@ generate_new_server_duid(void) { + if (p->hw_address.hlen > 0) { + break; + } ++ if (p->next == NULL && p->hw_address.hbuf[0] == HTYPE_RESERVED) { ++ log_error("Can not generate DUID from interfaces which do not have hardware addresses, please configure server-duid!"); ++ } + } + if (p == NULL) { + return ISC_R_UNEXPECTED; diff --git a/dhcp/patches/dhcp-4.2.5-lpf-ib.patch b/dhcp/patches/dhcp-4.2.5-lpf-ib.patch new file mode 100644 index 0000000..a136c6c --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-lpf-ib.patch @@ -0,0 +1,559 @@ +diff -up dhcp-4.2.4-P2/client/dhclient.c.lpf-ib dhcp-4.2.4-P2/client/dhclient.c +--- dhcp-4.2.4-P2/client/dhclient.c.lpf-ib 2012-11-30 14:05:07.399394154 +0100 ++++ dhcp-4.2.4-P2/client/dhclient.c 2012-11-30 14:05:07.406394070 +0100 +@@ -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; +@@ -909,6 +911,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) { +@@ -1185,6 +1195,29 @@ int find_subnet (struct subnet **sp, + return 0; + } + ++static void setup_ib_interface(struct interface_info *ip) ++{ ++ struct group *g; ++ ++ /* Set the broadcast flag */ ++ ip->client->config->bootp_broadcast_always = 1; ++ ++ /* ++ * Find out if a dhcp-client-identifier option was specified either ++ * in the config file or on the command line ++ */ ++ for (g = ip->client->config->on_transmission; g != NULL; g = g->next) { ++ if ((g->statements != NULL) && ++ (strcmp(g->statements->data.option->option->name, ++ "dhcp-client-identifier") == 0)) { ++ return; ++ } ++ } ++ ++ /* No client ID specified */ ++ log_fatal("dhcp-client-identifier must be specified for InfiniBand"); ++} ++ + /* Individual States: + * + * Each routine is called from the dhclient_state_machine() in one of +diff -up dhcp-4.2.4-P2/common/bpf.c.lpf-ib dhcp-4.2.4-P2/common/bpf.c +--- dhcp-4.2.4-P2/common/bpf.c.lpf-ib 2012-11-30 14:05:07.394394214 +0100 ++++ dhcp-4.2.4-P2/common/bpf.c 2012-11-30 14:05:07.407394058 +0100 +@@ -198,11 +198,44 @@ struct bpf_insn dhcp_bpf_filter [] = { + BPF_STMT(BPF_RET+BPF_K, 0), + }; + ++/* Packet filter program for DHCP over Infiniband. ++ * ++ * XXX ++ * Changes to the filter program may require changes to the constant offsets ++ * used in lpf_gen_filter_setup to patch the port in the BPF program! ++ * XXX ++ */ ++struct bpf_insn dhcp_ib_bpf_filter [] = { ++ /* Packet filter for Infiniband */ ++ /* Make sure it's a UDP packet... */ ++ BPF_STMT(BPF_LD + BPF_B + BPF_ABS, 9), ++ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 0, 6), ++ ++ /* Make sure this isn't a fragment... */ ++ BPF_STMT(BPF_LD + BPF_H + BPF_ABS, 6), ++ BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 4, 0), ++ ++ /* Get the IP header length... */ ++ BPF_STMT(BPF_LDX + BPF_B + BPF_MSH, 0), ++ ++ /* Make sure it's to the right port... */ ++ BPF_STMT(BPF_LD + BPF_H + BPF_IND, 2), ++ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 67, 0, 1), ++ ++ /* If we passed all the tests, ask for the whole packet. */ ++ BPF_STMT(BPF_RET + BPF_K, (u_int)-1), ++ ++ /* Otherwise, drop it. */ ++ BPF_STMT(BPF_RET + BPF_K, 0), ++}; ++ + #if defined (DEC_FDDI) + struct bpf_insn *bpf_fddi_filter; + #endif + + int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn); ++int dhcp_ib_bpf_filter_len = sizeof dhcp_ib_bpf_filter / sizeof (struct bpf_insn); ++ + #if defined (HAVE_TR_SUPPORT) + struct bpf_insn dhcp_bpf_tr_filter [] = { + /* accept all token ring packets due to variable length header */ +diff -up dhcp-4.2.4-P2/common/lpf.c.lpf-ib dhcp-4.2.4-P2/common/lpf.c +--- dhcp-4.2.4-P2/common/lpf.c.lpf-ib 2012-11-30 14:05:07.394394214 +0100 ++++ dhcp-4.2.4-P2/common/lpf.c 2012-11-30 14:19:27.211031532 +0100 +@@ -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. */ + ++/* Default broadcast address for IPoIB */ ++static unsigned char default_ib_bcast_addr[20] = { ++ 0x00, 0xff, 0xff, 0xff, ++ 0xff, 0x12, 0x40, 0x1b, ++ 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, ++ 0xff, 0xff, 0xff, 0xff ++}; ++ + #ifdef USE_LPF_SEND + void if_reinitialize_send (info) + struct interface_info *info; +@@ -86,10 +96,21 @@ int if_register_lpf (info) + struct sockaddr common; + } sa; + struct ifreq ifr; ++ int type; ++ int protocol; + + /* Make an LPF socket. */ +- 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; ++ protocol = ETHERTYPE_IP; ++ } else { ++ type = SOCK_RAW; ++ protocol = ETH_P_ALL; ++ } ++ ++ if ((sock = socket(PF_PACKET, type, htons((short)protocol))) < 0) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT || errno == EINVAL) { +@@ -112,6 +133,7 @@ int if_register_lpf (info) + /* Bind to the interface name */ + memset (&sa, 0, sizeof sa); + sa.ll.sll_family = AF_PACKET; ++ sa.ll.sll_protocol = htons(protocol); + sa.ll.sll_ifindex = ifr.ifr_ifindex; + if (bind (sock, &sa.common, sizeof sa)) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || +@@ -127,8 +149,6 @@ int if_register_lpf (info) + log_fatal ("Bind socket to interface: %m"); + } + +- get_hw_addr(info->name, &info->hw_address); +- + return sock; + } + #endif /* USE_LPF_SEND || USE_LPF_RECEIVE */ +@@ -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; ++extern struct sock_filter dhcp_ib_bpf_filter []; ++extern int dhcp_ib_bpf_filter_len; + + #if defined (HAVE_TR_SUPPORT) + extern struct sock_filter dhcp_bpf_tr_filter []; +@@ -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)); + +- /* Set up the bpf filter program structure. This is defined in +- bpf.c */ +- p.len = dhcp_bpf_filter_len; +- p.filter = dhcp_bpf_filter; +- +- /* Patch the server port into the LPF program... +- XXX changes to filter program may require changes +- to the insn number(s) used below! XXX */ +- dhcp_bpf_filter [8].k = ntohs ((short)local_port); ++ if (info->hw_address.hbuf[0] == HTYPE_INFINIBAND) { ++ /* Set up the bpf filter program structure. */ ++ p.len = dhcp_ib_bpf_filter_len; ++ p.filter = dhcp_ib_bpf_filter; ++ ++ /* Patch the server port into the LPF program... ++ XXX ++ changes to filter program may require changes ++ to the insn number(s) used below! ++ XXX */ ++ dhcp_ib_bpf_filter[6].k = ntohs ((short)local_port); ++ } else { ++ /* Set up the bpf filter program structure. ++ This is defined in bpf.c */ ++ p.len = dhcp_bpf_filter_len; ++ p.filter = dhcp_bpf_filter; ++ ++ /* Patch the server port into the LPF program... ++ XXX changes to filter program may require changes ++ to the insn number(s) used below! XXX */ ++ dhcp_bpf_filter [8].k = ntohs ((short)local_port); ++ } + + if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p, + sizeof p) < 0) { +@@ -315,6 +352,54 @@ static void lpf_tr_filter_setup (info) + #endif /* USE_LPF_RECEIVE */ + + #ifdef USE_LPF_SEND ++ssize_t send_packet_ib(interface, packet, raw, len, from, to, hto) ++ struct interface_info *interface; ++ struct packet *packet; ++ struct dhcp_packet *raw; ++ size_t len; ++ struct in_addr from; ++ struct sockaddr_in *to; ++ struct hardware *hto; ++{ ++ unsigned ibufp = 0; ++ double ih [1536 / sizeof (double)]; ++ unsigned char *buf = (unsigned char *)ih; ++ ssize_t result; ++ ++ union sockunion { ++ struct sockaddr sa; ++ struct sockaddr_ll sll; ++ struct sockaddr_storage ss; ++ } su; ++ ++ assemble_udp_ip_header (interface, buf, &ibufp, from.s_addr, ++ to->sin_addr.s_addr, to->sin_port, ++ (unsigned char *)raw, len); ++ memcpy (buf + ibufp, raw, len); ++ ++ memset(&su, 0, sizeof(su)); ++ su.sll.sll_family = AF_PACKET; ++ su.sll.sll_protocol = htons(ETHERTYPE_IP); ++ ++ if (!(su.sll.sll_ifindex = if_nametoindex(interface->name))) { ++ errno = ENOENT; ++ log_error ("send_packet_ib: %m - failed to get if index"); ++ return -1; ++ } ++ ++ su.sll.sll_hatype = htons(HTYPE_INFINIBAND); ++ su.sll.sll_halen = sizeof(interface->bcast_addr); ++ memcpy(&su.sll.sll_addr, interface->bcast_addr, 20); ++ ++ result = sendto(interface->wfdesc, buf, ibufp + len, 0, ++ &su.sa, sizeof(su)); ++ ++ if (result < 0) ++ log_error ("send_packet_ib: %m"); ++ ++ return result; ++} ++ + 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, + return send_fallback (interface, packet, raw, + len, from, to, hto); + ++ if (interface->hw_address.hbuf[0] == HTYPE_INFINIBAND) { ++ return send_packet_ib(interface, packet, raw, len, from, ++ to, hto); ++ } ++ + if (hto == NULL && interface->anycast_mac_addr.hlen) + hto = &interface->anycast_mac_addr; + +@@ -356,6 +446,42 @@ ssize_t send_packet (interface, packet, + #endif /* USE_LPF_SEND */ + + #ifdef USE_LPF_RECEIVE ++ssize_t receive_packet_ib (interface, buf, len, from, hfrom) ++ struct interface_info *interface; ++ unsigned char *buf; ++ size_t len; ++ struct sockaddr_in *from; ++ struct hardware *hfrom; ++{ ++ int length = 0; ++ int offset = 0; ++ unsigned char ibuf [1536]; ++ unsigned bufix = 0; ++ unsigned paylen; ++ ++ length = read(interface->rfdesc, ibuf, sizeof(ibuf)); ++ ++ if (length <= 0) ++ return length; ++ ++ offset = decode_udp_ip_header(interface, ibuf, bufix, from, ++ (unsigned)length, &paylen, 0); ++ ++ if (offset < 0) ++ return 0; ++ ++ bufix += offset; ++ length -= offset; ++ ++ if (length < paylen) ++ log_fatal("Internal inconsistency at %s:%d.", MDL); ++ ++ /* Copy out the data in the packet... */ ++ memcpy(buf, &ibuf[bufix], paylen); ++ ++ return (ssize_t)paylen; ++} ++ + 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, + }; + 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; +@@ -461,11 +591,32 @@ void maybe_setup_fallback () + } + } + +-void +-get_hw_addr(const char *name, struct hardware *hw) { ++struct sockaddr_ll * ++get_ll (struct ifaddrs *ifaddrs, struct ifaddrs **ifa, char *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; ++ ++ if ((*ifa)->ifa_flags & IFF_LOOPBACK) ++ continue; ++ ++ if (strcmp((*ifa)->ifa_name, name) == 0) ++ return (struct sockaddr_ll *)(void *)(*ifa)->ifa_addr; ++ } ++ return NULL; ++} ++ ++struct sockaddr_ll * ++ioctl_get_ll(char *name) ++{ + int sock; + struct ifreq tmp; +- struct sockaddr *sa; ++ struct sockaddr *sa = NULL; ++ struct sockaddr_ll *sll = NULL; + + if (strlen(name) >= sizeof(tmp.ifr_name)) { + log_fatal("Device name too long: "%s"", name); +@@ -479,16 +630,52 @@ get_hw_addr(const char *name, struct har + memset(&tmp, 0, sizeof(tmp)); + strcpy(tmp.ifr_name, name); + if (ioctl(sock, SIOCGIFHWADDR, &tmp) < 0) { +- log_fatal("Error getting hardware address for "%s": %m", ++ log_fatal("Error getting hardware address for "%s": %m", + name); + } ++ close(sock); + + sa = &tmp.ifr_hwaddr; +- switch (sa->sa_family) { ++ // needs to be freed outside this function ++ sll = dmalloc (sizeof (struct sockaddr_ll), MDL); ++ if (!sll) ++ log_fatal("Unable to allocate memory for link layer address"); ++ memcpy(&sll->sll_hatype, &sa->sa_family, sizeof (sll->sll_hatype)); ++ memcpy(sll->sll_addr, sa->sa_data, sizeof (sll->sll_addr)); ++ return sll; ++} ++ ++void ++get_hw_addr(struct interface_info *info) ++{ ++ struct hardware *hw = &info->hw_address; ++ char *name = info->name; ++ struct ifaddrs *ifaddrs = NULL; ++ struct ifaddrs *ifa = NULL; ++ struct sockaddr_ll *sll = NULL; ++ int sll_allocated = 0; ++ ++ if (getifaddrs(&ifaddrs) == -1) ++ log_fatal("Failed to get interfaces"); ++ ++ if ((sll = get_ll(ifaddrs, &ifa, name)) == NULL) { ++ /* ++ * We were unable to get link-layer address for name. ++ * Fall back to ioctl(SIOCGIFHWADDR). ++ */ ++ sll = ioctl_get_ll(name); ++ if (sll != NULL) ++ sll_allocated = 1; ++ else ++ // shouldn't happed ++ log_fatal("Unexpected internal error"); ++ } ++ ++ switch (sll->sll_hatype) { + case ARPHRD_ETHER: + hw->hlen = 7; + hw->hbuf[0] = HTYPE_ETHER; +- memcpy(&hw->hbuf[1], sa->sa_data, 6); ++ memcpy(&hw->hbuf[1], sll->sll_addr, 6); + break; + case ARPHRD_IEEE802: + #ifdef ARPHRD_IEEE802_TR +@@ -496,18 +683,35 @@ get_hw_addr(const char *name, struct har + #endif /* ARPHRD_IEEE802_TR */ + hw->hlen = 7; + hw->hbuf[0] = HTYPE_IEEE802; +- memcpy(&hw->hbuf[1], sa->sa_data, 6); ++ memcpy(&hw->hbuf[1], sll->sll_addr, 6); + break; + case ARPHRD_FDDI: + hw->hlen = 7; + hw->hbuf[0] = HTYPE_FDDI; +- memcpy(&hw->hbuf[1], sa->sa_data, 6); ++ memcpy(&hw->hbuf[1], sll->sll_addr, 6); ++ break; ++ case ARPHRD_INFINIBAND: ++ /* For Infiniband, save the broadcast address and store ++ * the port GUID into the hardware address. ++ */ ++ if (ifa->ifa_flags & IFF_BROADCAST) { ++ struct sockaddr_ll *bll; ++ ++ bll = (struct sockaddr_ll *)ifa->ifa_broadaddr; ++ memcpy(&info->bcast_addr, bll->sll_addr, 20); ++ } else { ++ memcpy(&info->bcast_addr, default_ib_bcast_addr, ++ 20); ++ } ++ ++ 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("local_family != AF_INET6 for "%s"", ++ name); + hw->hlen = 0; + hw->hbuf[0] = HTYPE_RESERVED; + /* 0xdeadbeef should never occur on the wire, +@@ -520,10 +724,13 @@ get_hw_addr(const char *name, struct har + break; + #endif + default: +- log_fatal("Unsupported device type %ld for "%s"", +- (long int)sa->sa_family, name); ++ freeifaddrs(ifaddrs); ++ log_fatal("Unsupported device type %h for "%s"", ++ sll->sll_hatype, name); + } + +- close(sock); ++ if (sll_allocated) ++ dfree(sll, MDL); ++ freeifaddrs(ifaddrs); + } + #endif +diff -up dhcp-4.2.4-P2/common/socket.c.lpf-ib dhcp-4.2.4-P2/common/socket.c +--- dhcp-4.2.4-P2/common/socket.c.lpf-ib 2012-08-24 21:11:21.000000000 +0200 ++++ dhcp-4.2.4-P2/common/socket.c 2012-11-30 14:05:07.408394046 +0100 +@@ -325,7 +325,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. */ + if (strcmp(info->name, "fallback") != 0) +- get_hw_addr(info->name, &info->hw_address); ++ get_hw_addr(info); + #if defined (USE_SOCKET_FALLBACK) + /* Fallback only registers for send, but may need to receive as + well. */ +@@ -388,7 +388,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", +@@ -498,7 +498,7 @@ if_register6(struct interface_info *info + if (req_multi) + if_register_multicast(info); + +- get_hw_addr(info->name, &info->hw_address); ++ get_hw_addr(info); + + if (!quiet_interface_discovery) { + if (info->shared_network != NULL) { +diff -up dhcp-4.2.4-P2/includes/dhcpd.h.lpf-ib dhcp-4.2.4-P2/includes/dhcpd.h +--- dhcp-4.2.4-P2/includes/dhcpd.h.lpf-ib 2012-11-30 14:05:07.400394142 +0100 ++++ dhcp-4.2.4-P2/includes/dhcpd.h 2012-11-30 14:05:07.409394034 +0100 +@@ -1249,6 +1249,7 @@ struct interface_info { + struct shared_network *shared_network; + /* Networks connected to this interface. */ + struct hardware hw_address; /* Its physical address. */ ++ u_int8_t bcast_addr[20]; /* Infiniband broadcast address */ + struct in_addr *addresses; /* Addresses associated with this + * interface. + */ +@@ -2368,7 +2369,7 @@ void print_dns_status (int, struct dhcp_ + #endif + const char *print_time(TIME); + +-void get_hw_addr(const char *name, struct hardware *hw); ++void get_hw_addr(struct interface_info *info); + + /* socket.c */ + #if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \ diff --git a/dhcp/patches/dhcp-4.2.5-manpages.patch b/dhcp/patches/dhcp-4.2.5-manpages.patch new file mode 100644 index 0000000..fb931bc --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-manpages.patch @@ -0,0 +1,157 @@ +diff -up dhcp-4.2.5b1/client/dhclient.conf.5.man dhcp-4.2.5b1/client/dhclient.conf.5 +--- dhcp-4.2.5b1/client/dhclient.conf.5.man 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/client/dhclient.conf.5 2012-12-17 12:49:52.818451301 +0100 +@@ -202,7 +202,8 @@ responding to the client send the client + options. Only the option names should be specified in the request + statement - not option parameters. By default, the DHCPv4 client + requests the subnet-mask, broadcast-address, time-offset, routers, +-domain-name, domain-name-servers and host-name options while the DHCPv6 ++domain-search, domain-name, domain-name-servers, host-name, nis-domain, ++nis-servers, ntp-servers and interface-mtu options while the DHCPv6 + client requests the dhcp6 name-servers and domain-search options. Note + that if you enter a 'request' statement, you over-ride these defaults + and these options will not be requested. +@@ -688,6 +689,17 @@ know the DHCP service(s) anycast MAC add + client. The \fIlink-type\fR and \fImac-address\fR parameters are configured + in a similar manner to the \fBhardware\fR statement. + .PP ++ \fBbootp-broadcast-always;\fR ++.PP ++The ++.B bootp-broadcast-always ++statement instructs dhclient to always set the bootp broadcast flag in ++request packets, so that servers will always broadcast replies. ++This is equivalent to supplying the dhclient -B argument, and has ++the same effect as specifying 'always-broadcast' in the server's dhcpd.conf. ++This option is provided as an extension to enable dhclient to work ++on IBM s390 Linux guests. ++.PP + .SH SAMPLE + The following configuration file is used on a laptop running NetBSD + 1.3. The laptop has an IP alias of 192.5.5.213, and has one +@@ -713,7 +725,7 @@ interface "ep0" { + supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com"; + prepend domain-name-servers 127.0.0.1; + request subnet-mask, broadcast-address, time-offset, routers, +- domain-name, domain-name-servers, host-name; ++ domain-search, domain-name, domain-name-servers, host-name; + require subnet-mask, domain-name-servers; + script "CLIENTBINDIR/dhclient-script"; + media "media 10baseT/UTP", "media 10base2/BNC"; +diff -up dhcp-4.2.5b1/client/dhclient-script.8.man dhcp-4.2.5b1/client/dhclient-script.8 +--- dhcp-4.2.5b1/client/dhclient-script.8.man 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/client/dhclient-script.8 2012-12-17 12:47:48.410130998 +0100 +@@ -48,7 +48,7 @@ customizations are needed, they should b + exit hooks provided (see HOOKS for details). These hooks will allow the + user to override the default behaviour of the client in creating a + .B /etc/resolv.conf +-file. ++file, and to handle DHCP options not handled by default. + .PP + No standard client script exists for some operating systems, even though + the actual client may work, so a pioneering user may well need to create +@@ -92,6 +92,26 @@ present. The + .B ETCDIR/dhclient-exit-hooks + script can modify the valid of exit_status to change the exit status + of dhclient-script. ++.PP ++Immediately after dhclient brings an interface UP with a new IP address, ++subnet mask, and routes, in the REBOOT/BOUND states, it will check for the ++existence of an executable ++.B ETCDIR/dhclient-up-hooks ++script, and source it if found. This script can handle DHCP options in ++the environment that are not handled by default. A per-interface. ++.B ETCDIR/dhclient-${IF}-up-hooks ++script will override the generic script and be sourced when interface ++$IF has been brought up. ++.PP ++Immediately before dhclient brings an interface DOWN, removing its IP ++address, subnet mask, and routes, in the STOP/RELEASE states, it will ++check for the existence of an executable ++.B ETCDIR/dhclient-down-hooks ++script, and source it if found. This script can handle DHCP options in ++the environment that are not handled by default. A per-interface ++.B ETCDIR/dhclient-${IF}-down-hooks ++script will override the generic script and be sourced when interface ++$IF is about to be brought down. + .SH OPERATION + When dhclient needs to invoke the client configuration script, it + defines a set of variables in the environment, and then invokes +diff -up dhcp-4.2.5b1/common/dhcp-options.5.man dhcp-4.2.5b1/common/dhcp-options.5 +--- dhcp-4.2.5b1/common/dhcp-options.5.man 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/common/dhcp-options.5 2012-12-17 12:47:48.411130985 +0100 +@@ -914,6 +914,21 @@ classless IP routing - it does not inclu + classless IP routing is now the most widely deployed routing standard, + this option is virtually useless, and is not implemented by any of the + popular DHCP clients, for example the Microsoft DHCP client. ++.PP ++NOTE to Fedora dhclient users: ++.br ++dhclient-script interprets trailing 0 octets of the target as indicating ++the subnet class of the route, so for the following static-routes value: ++.br ++ option static-routes 172.0.0.0 172.16.2.254, ++.br ++ 192.168.0.0 192.168.2.254; ++.br ++dhclient-script will create routes: ++.br ++ 172/8 via 172.16.2.254 dev $interface ++.br ++ 192.168/16 via 192.168.2.254 dev $interface + .RE + .PP + .nf +diff -up dhcp-4.2.5b1/server/dhcpd.conf.5.man dhcp-4.2.5b1/server/dhcpd.conf.5 +--- dhcp-4.2.5b1/server/dhcpd.conf.5.man 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/server/dhcpd.conf.5 2012-12-17 12:50:52.117650542 +0100 +@@ -519,6 +519,9 @@ pool { + }; + .fi + .PP ++Dynamic BOOTP leases are not compatible with failover, and, as such, ++you need to disallow BOOTP in pools that you are using failover for. ++.PP + The server currently does very little sanity checking, so if you + configure it wrong, it will just fail in odd ways. I would recommend + therefore that you either do failover or don't do failover, but don't +@@ -533,9 +536,9 @@ primary server might look like this: + failover peer "foo" { + primary; + address anthrax.rc.vix.com; +- port 519; ++ port 647; + peer address trantor.rc.vix.com; +- peer port 520; ++ peer port 847; + max-response-delay 60; + max-unacked-updates 10; + mclt 3600; +@@ -1318,7 +1321,7 @@ the zone containing PTR records - for IS + .PP + .nf + key DHCP_UPDATER { +- algorithm HMAC-MD5.SIG-ALG.REG.INT; ++ algorithm hmac-md5; + secret pRP5FapFoJ95JEL06sv4PQ==; + }; + +@@ -1341,7 +1344,7 @@ dhcpd.conf file: + .PP + .nf + key DHCP_UPDATER { +- algorithm HMAC-MD5.SIG-ALG.REG.INT; ++ algorithm hmac-md5; + secret pRP5FapFoJ95JEL06sv4PQ==; + }; + +@@ -2555,7 +2558,8 @@ statement + The \fInext-server\fR statement is used to specify the host address of + the server from which the initial boot file (specified in the + \fIfilename\fR statement) is to be loaded. \fIServer-name\fR should +-be a numeric IP address or a domain name. ++be a numeric IP address or a domain name. If no \fInext-server\fR statement ++applies to a given client, the address 0.0.0.0 is used. + .RE + .PP + The diff --git a/dhcp/patches/dhcp-4.2.5-next-server.patch b/dhcp/patches/dhcp-4.2.5-next-server.patch new file mode 100644 index 0000000..c903bd1 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-next-server.patch @@ -0,0 +1,72 @@ +From f113ad7822fcd691e72f61cab7412595951222db Mon Sep 17 00:00:00 2001 +From: Tomas Hozza thozza@redhat.com +Date: Wed, 3 Apr 2013 10:20:18 +0200 +Subject: [PATCH] Expose next-server DHCPv4 option to dhclient script + +Currently dhclient does not exposes next-server option +to the dhclient script. this patch fixes this. + +Signed-off-by: Tomas Hozza thozza@redhat.com +--- + client/dhclient.c | 14 +++++++++++--- + includes/dhcpd.h | 2 +- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/client/dhclient.c b/client/dhclient.c +index 551ccbf..e8df320 100644 +--- a/client/dhclient.c ++++ b/client/dhclient.c +@@ -993,7 +993,7 @@ void state_selecting (cpp) + client -> state = S_REQUESTING; + + /* Bind to the address we received. */ +- bind_lease (client); ++ bind_lease (client, NULL); + return; + } + +@@ -1183,11 +1183,12 @@ void dhcpack (packet) + if (client -> new -> rebind < cur_time) + client -> new -> rebind = TIME_MAX; + +- bind_lease (client); ++ bind_lease (client, &packet -> raw -> siaddr); + } + +-void bind_lease (client) ++void bind_lease (client, siaddr) + struct client_state *client; ++ struct in_addr *siaddr; + { + struct timeval tv; + +@@ -1209,6 +1210,13 @@ void bind_lease (client) + if (client -> alias) + script_write_params (client, "alias_", client -> alias); + ++ if (siaddr) { ++ char buf[INET_ADDRSTRLEN]; ++ ++ if (inet_ntop (AF_INET, (void *) siaddr, buf, sizeof (buf))) ++ client_envadd (client, "new_", "next_server", "%s", buf); ++ } ++ + /* If the BOUND/RENEW code detects another machine using the + offered address, it exits nonzero. We need to send a + DHCPDECLINE and toss the lease. */ +diff --git a/includes/dhcpd.h b/includes/dhcpd.h +index 12ed2ba..4e93e68 100644 +--- a/includes/dhcpd.h ++++ b/includes/dhcpd.h +@@ -2712,7 +2712,7 @@ void state_bound (void *); + void state_stop (void *); + void state_panic (void *); + +-void bind_lease (struct client_state *); ++void bind_lease (struct client_state *, struct in_addr *); + + void make_client_options (struct client_state *, + struct client_lease *, u_int8_t *, +-- +1.8.1.4 + diff --git a/dhcp/patches/dhcp-4.2.5-paranoia.patch b/dhcp/patches/dhcp-4.2.5-paranoia.patch new file mode 100644 index 0000000..05affdd --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-paranoia.patch @@ -0,0 +1,202 @@ +diff -up dhcp-4.2.5/client/dhclient.c.paranoia dhcp-4.2.5/client/dhclient.c +--- dhcp-4.2.5/client/dhclient.c.paranoia 2013-03-26 13:14:50.574542083 +0100 ++++ dhcp-4.2.5/client/dhclient.c 2013-03-26 13:14:50.584541964 +0100 +@@ -1698,11 +1698,6 @@ int write_host (host) + return 0; + } + +-void db_startup (testp) +- int testp; +-{ +-} +- + void bootp (packet) + struct packet *packet; + { +diff -up dhcp-4.2.5/includes/dhcpd.h.paranoia dhcp-4.2.5/includes/dhcpd.h +--- dhcp-4.2.5/includes/dhcpd.h.paranoia 2013-03-26 13:14:50.576542059 +0100 ++++ dhcp-4.2.5/includes/dhcpd.h 2013-03-26 13:14:50.585541952 +0100 +@@ -2798,7 +2798,11 @@ void commit_leases_timeout (void *); + void commit_leases_readerdry(void *); + int commit_leases (void); + int commit_leases_timed (void); ++#if defined (PARANOIA) ++void db_startup (int, uid_t, gid_t); ++#else + void db_startup (int); ++#endif /* PARANOIA */ + int new_lease_file (void); + int group_writer (struct group_object *); + int write_ia(const struct ia_xx *); +diff -up dhcp-4.2.5/server/confpars.c.paranoia dhcp-4.2.5/server/confpars.c +--- dhcp-4.2.5/server/confpars.c.paranoia 2013-03-26 13:14:50.522542705 +0100 ++++ dhcp-4.2.5/server/confpars.c 2013-03-26 13:14:50.587541928 +0100 +@@ -224,7 +224,11 @@ void trace_conf_input (trace_type_t *tty + } + + if (!leaseconf_initialized && ttype == trace_readleases_type) { ++#if defined (PARANOIA) ++ db_startup (0, 0, 0); ++#else + db_startup (0); ++#endif /* PARANOIA */ + leaseconf_initialized = 1; + postdb_startup (); + } +diff -up dhcp-4.2.5/server/db.c.paranoia dhcp-4.2.5/server/db.c +--- dhcp-4.2.5/server/db.c.paranoia 2013-03-26 13:14:50.522542705 +0100 ++++ dhcp-4.2.5/server/db.c 2013-03-26 13:14:50.588541916 +0100 +@@ -47,6 +47,10 @@ static int counting = 0; + static int count = 0; + TIME write_time; + int lease_file_is_corrupt = 0; ++#if defined (PARANOIA) ++uid_t global_set_uid = 0; ++gid_t global_set_gid = 0; ++#endif /* PARANOIA */ + + /* Write a single binding scope value in parsable format. + */ +@@ -1026,8 +1030,11 @@ int commit_leases_timed() + return (1); + } + +-void db_startup (testp) +- int testp; ++#if defined (PARANOIA) ++void db_startup (int testp, uid_t set_uid, gid_t set_gid) ++#else ++void db_startup (int testp) ++#endif /* PARANOIA */ + { + isc_result_t status; + +@@ -1046,6 +1053,11 @@ void db_startup (testp) + } + #endif + ++#if defined (PARANOIA) ++ global_set_uid = set_uid; ++ global_set_gid = set_gid; ++#endif /* PARANOIA */ ++ + #if defined (TRACING) + /* If we're playing back, there is no lease file, so we can't + append it, so we create one immediately (maybe this isn't +@@ -1108,6 +1120,17 @@ int new_lease_file () + log_error ("Can't create new lease file: %m"); + return 0; + } ++ ++#if defined (PARANOIA) ++ if (global_set_uid && !geteuid() && ++ global_set_gid && !getegid()) ++ if (fchown(db_fd, global_set_uid, global_set_gid)) { ++ log_fatal ("Can't chown new lease file: %m"); ++ close(db_fd); ++ goto fdfail; ++ } ++#endif /* PARANOIA */ ++ + if ((new_db_file = fdopen(db_fd, "we")) == NULL) { + log_error("Can't fdopen new lease file: %m"); + close(db_fd); +diff -up dhcp-4.2.5/server/dhcpd.8.paranoia dhcp-4.2.5/server/dhcpd.8 +--- dhcp-4.2.5/server/dhcpd.8.paranoia 2013-01-03 01:02:25.000000000 +0100 ++++ dhcp-4.2.5/server/dhcpd.8 2013-03-26 13:28:16.576604471 +0100 +@@ -82,6 +82,18 @@ dhcpd - Dynamic Host Configuration Proto + .I trace-output-file + ] + [ ++.B -user ++.I user ++] ++[ ++.B -group ++.I group ++] ++[ ++.B -chroot ++.I dir ++] ++[ + .B -play + .I trace-playback-file + ] +@@ -269,6 +281,15 @@ lease file. + .TP + .BI --version + Print version number and exit. ++.TP ++.BI -user \ user ++Setuid to user after completing privileged operations, such as creating sockets that listen on privileged ports. ++.TP ++.BI -group \ group ++Setgid to group after completing privileged operations, such as creating sockets that listen on privileged ports. ++.TP ++.BI -chroot \ dir ++Chroot to directory after processing the command line arguments, but before reading the configuration file. + .PP + .I Modifying default file locations: + The following options can be used to modify the locations +diff -up dhcp-4.2.5/server/dhcpd.c.paranoia dhcp-4.2.5/server/dhcpd.c +--- dhcp-4.2.5/server/dhcpd.c.paranoia 2013-03-26 13:14:50.523542693 +0100 ++++ dhcp-4.2.5/server/dhcpd.c 2013-03-26 13:14:50.589541904 +0100 +@@ -702,7 +702,11 @@ main(int argc, char **argv) { + group_write_hook = group_writer; + + /* Start up the database... */ ++#if defined (PARANOIA) ++ db_startup (lftest, set_uid, set_gid); ++#else + db_startup (lftest); ++#endif /* PARANOIA */ + + if (lftest) + exit (0); +@@ -773,22 +777,6 @@ main(int argc, char **argv) { + exit (0); + } + +-#if defined (PARANOIA) +- /* change uid to the specified one */ +- +- if (set_gid) { +- if (setgroups (0, (void *)0)) +- log_fatal ("setgroups: %m"); +- if (setgid (set_gid)) +- log_fatal ("setgid(%d): %m", (int) set_gid); +- } +- +- if (set_uid) { +- if (setuid (set_uid)) +- log_fatal ("setuid(%d): %m", (int) set_uid); +- } +-#endif /* PARANOIA */ +- + /* + * Deal with pid files. If the user told us + * not to write a file we don't read one either +@@ -825,6 +813,22 @@ main(int argc, char **argv) { + } + } + ++#if defined (PARANOIA) ++ /* change uid to the specified one */ ++ ++ if (set_gid) { ++ if (setgroups (0, (void *)0)) ++ log_fatal ("setgroups: %m"); ++ if (setgid (set_gid)) ++ log_fatal ("setgid(%d): %m", (int) set_gid); ++ } ++ ++ if (set_uid) { ++ if (setuid (set_uid)) ++ log_fatal ("setuid(%d): %m", (int) set_uid); ++ } ++#endif /* PARANOIA */ ++ + /* If we were requested to log to stdout on the command line, + keep doing so; otherwise, stop. */ + if (log_perror == -1) diff --git a/dhcp/patches/dhcp-4.2.5-range6.patch b/dhcp/patches/dhcp-4.2.5-range6.patch new file mode 100644 index 0000000..754d899 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-range6.patch @@ -0,0 +1,42 @@ +diff --git a/server/confpars.c b/server/confpars.c +index 12ab0e6..4454be9 100644 +--- a/server/confpars.c ++++ b/server/confpars.c +@@ -3756,6 +3756,19 @@ add_ipv6_pool_to_subnet(struct subnet *subnet, u_int16_t type, + share->ipv6_pools[num_pools+1] = NULL; + } + ++static void ++check_addr_in_subnet(struct subnet *subnet, struct iaddr *addr) { ++ char lowbuf [INET6_ADDRSTRLEN], netbuf [INET6_ADDRSTRLEN]; ++ ++ if (!addr_eq(subnet->net, subnet_number(*addr, subnet->netmask))) { ++ strcpy(lowbuf, piaddr(*addr)); ++ strcpy(netbuf, piaddr(subnet->net)); ++ log_fatal("bad range6, address %s not in subnet6 %s/%d", ++ lowbuf, netbuf, subnet->prefix_len); ++ } ++ ++} ++ + /* address-range6-declaration :== ip-address6 ip-address6 SEMI + | ip-address6 SLASH number SEMI + | ip-address6 [SLASH number] TEMPORARY SEMI */ +@@ -3788,6 +3801,8 @@ parse_address_range6(struct parse *cfile, struct group *group) { + return; + } + ++ check_addr_in_subnet(group->subnet, &lo); ++ + /* + * See if we we're using range or CIDR notation or TEMPORARY + */ +@@ -3855,6 +3870,8 @@ parse_address_range6(struct parse *cfile, struct group *group) { + return; + } + ++ check_addr_in_subnet(group->subnet, &hi); ++ + /* + * Convert our range to a set of CIDR networks. + */ diff --git a/dhcp/patches/dhcp-4.2.5-remove-bind.patch b/dhcp/patches/dhcp-4.2.5-remove-bind.patch new file mode 100644 index 0000000..d3ef6b7 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-remove-bind.patch @@ -0,0 +1,164 @@ +diff -up dhcp-4.2.5b1/client/Makefile.am.remove-bind dhcp-4.2.5b1/client/Makefile.am +--- dhcp-4.2.5b1/client/Makefile.am.remove-bind 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/client/Makefile.am 2012-12-17 16:20:58.692538252 +0100 +@@ -5,7 +5,7 @@ dhclient_SOURCES = clparse.c dhclient.c + scripts/netbsd scripts/nextstep scripts/openbsd \ + scripts/solaris scripts/openwrt + dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ +- ../bind/lib/libdns.a ../bind/lib/libisc.a ++ $(BIND9_LIBDIR) -ldns-export -lisc-export + man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 + EXTRA_DIST = $(man_MANS) + +diff -up dhcp-4.2.5b1/common/tests/Makefile.am.remove-bind dhcp-4.2.5b1/common/tests/Makefile.am +--- dhcp-4.2.5b1/common/tests/Makefile.am.remove-bind 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/common/tests/Makefile.am 2012-12-17 16:20:58.693538239 +0100 +@@ -13,8 +13,8 @@ ATF_TESTS += alloc_unittest + alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c + alloc_unittest_LDADD = $(ATF_LDFLAGS) + alloc_unittest_LDADD += ../libdhcp.a \ +- ../../omapip/libomapi.a ../../bind/lib/libdns.a \ +- ../../bind/lib/libisc.a ++ ../../omapip/libomapi.a \ ++ $(BIND9_LIBDIR) -ldns-export -lisc-export + + check: $(ATF_TESTS) + atf-run | atf-report +diff -up dhcp-4.2.5b1/configure.ac.remove-bind dhcp-4.2.5b1/configure.ac +--- dhcp-4.2.5b1/configure.ac.remove-bind 2012-12-05 02:18:44.000000000 +0100 ++++ dhcp-4.2.5b1/configure.ac 2012-12-17 16:20:58.693538239 +0100 +@@ -581,20 +581,37 @@ AC_CHECK_MEMBER(struct msghdr.msg_contro + libbind= + AC_ARG_WITH(libbind, + AC_HELP_STRING([--with-libbind=PATH], +- [bind includes and libraries are in PATH +- (default is ./bind)]), ++ [bind includes are in PATH ++ (default is ./bind/includes)]), + use_libbind="$withval", use_libbind="no") + case "$use_libbind" in ++yes|no) ++ libbind="${top_srcdir}/bind/include" ++ ;; ++*) ++ libbind="$use_libbind" ++ ;; ++esac ++ ++BIND9_LIBDIR='-L$(top_builddir)/bind/lib' ++AC_ARG_WITH(libbind-libs, ++ AC_HELP_STRING([--with-libbind-libs=PATH], ++ [bind9 export libraries are in PATH]), ++ [libbind_libs="$withval"], [libbind_libs='no']) ++case "$libbind_libs" in + yes) +- libbind="${top_srcdir}/bind" ++ AC_MSG_ERROR([Specify path to bind9 libraries]) + ;; + no) +- libbind="${top_srcdir}/bind" ++ BUNDLED_BIND=yes + ;; + *) +- libbind="$use_libbind" ++ BIND9_LIBDIR="-L$libbind_libs" ++ BUNDLED_BIND=no + ;; + esac ++AM_CONDITIONAL([BUNDLED_BIND], [test "$BUNDLED_BIND" = yes]) ++AC_SUBST([BIND9_LIBDIR]) + + # OpenLDAP support. + AC_ARG_WITH(ldap, +@@ -631,7 +648,7 @@ fi + CFLAGS="$CFLAGS $STD_CWARNINGS" + + # Try to add the bind include directory +-CFLAGS="$CFLAGS -I$libbind/include" ++CFLAGS="$CFLAGS -I$libbind" + + AC_C_FLEXIBLE_ARRAY_MEMBER + +diff -up dhcp-4.2.5b1/dhcpctl/Makefile.am.remove-bind dhcp-4.2.5b1/dhcpctl/Makefile.am +--- dhcp-4.2.5b1/dhcpctl/Makefile.am.remove-bind 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/dhcpctl/Makefile.am 2012-12-17 16:20:58.693538239 +0100 +@@ -6,10 +6,10 @@ EXTRA_DIST = $(man_MANS) + + omshell_SOURCES = omshell.c + omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ +- ../bind/lib/libdns.a ../bind/lib/libisc.a ++ $(BIND9_LIBDIR) -ldns-export -lisc-export + + libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c + + cltest_SOURCES = cltest.c + cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ +- ../bind/lib/libdns.a ../bind/lib/libisc.a +\ No newline at end of file ++ $(BIND9_LIBDIR) -ldns-export -lisc-export +diff -up dhcp-4.2.5b1/Makefile.am.remove-bind dhcp-4.2.5b1/Makefile.am +--- dhcp-4.2.5b1/Makefile.am.remove-bind 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/Makefile.am 2012-12-17 16:20:58.693538239 +0100 +@@ -22,7 +22,13 @@ EXTRA_DIST = RELNOTES LICENSE \ + bind/Makefile bind/bind.tar.gz bind/version.tmp \ + common/tests/Atffile server/tests/Atffile + +-SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server ++if BUNDLED_BIND ++SUBDIRS = bind ++else ++SUBDIRS = ++endif ++ ++SUBDIRS += includes tests common dst omapip client dhcpctl relay server + + nobase_include_HEADERS = dhcpctl/dhcpctl.h + +diff -up dhcp-4.2.5b1/omapip/Makefile.am.remove-bind dhcp-4.2.5b1/omapip/Makefile.am +--- dhcp-4.2.5b1/omapip/Makefile.am.remove-bind 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/omapip/Makefile.am 2012-12-17 16:20:58.693538239 +0100 +@@ -10,5 +10,5 @@ man_MANS = omapi.3 + EXTRA_DIST = $(man_MANS) + + svtest_SOURCES = test.c +-svtest_LDADD = libomapi.a ../bind/lib/libdns.a ../bind/lib/libisc.a ++svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export + +diff -up dhcp-4.2.5b1/relay/Makefile.am.remove-bind dhcp-4.2.5b1/relay/Makefile.am +--- dhcp-4.2.5b1/relay/Makefile.am.remove-bind 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/relay/Makefile.am 2012-12-17 16:20:58.694538225 +0100 +@@ -3,7 +3,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst + sbin_PROGRAMS = dhcrelay + dhcrelay_SOURCES = dhcrelay.c + dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ +- ../bind/lib/libdns.a ../bind/lib/libisc.a ++ $(BIND9_LIBDIR) -ldns-export -lisc-export + man_MANS = dhcrelay.8 + EXTRA_DIST = $(man_MANS) + +diff -up dhcp-4.2.5b1/server/Makefile.am.remove-bind dhcp-4.2.5b1/server/Makefile.am +--- dhcp-4.2.5b1/server/Makefile.am.remove-bind 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/server/Makefile.am 2012-12-17 16:20:58.694538225 +0100 +@@ -14,8 +14,7 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c + + dhcpd_CFLAGS = $(LDAP_CFLAGS) + dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ +- ../dhcpctl/libdhcpctl.a ../bind/lib/libdns.a \ +- ../bind/lib/libisc.a ++ ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export + + man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 + EXTRA_DIST = $(man_MANS) +diff -up dhcp-4.2.5b1/server/tests/Makefile.am.remove-bind dhcp-4.2.5b1/server/tests/Makefile.am +--- dhcp-4.2.5b1/server/tests/Makefile.am.remove-bind 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/server/tests/Makefile.am 2012-12-17 16:26:01.093346768 +0100 +@@ -18,8 +18,7 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpa + ../ldap.c ../ldap_casa.c ../dhcpd.c + + DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \ +- $(top_builddir)/dhcpctl/libdhcpctl.a $(top_builddir)/bind/lib/libdns.a \ +- $(top_builddir)/bind/lib/libisc.a ++ $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export + + ATF_TESTS = + TESTS = diff --git a/dhcp/patches/dhcp-4.2.5-rfc3442-classless-static-routes.patch b/dhcp/patches/dhcp-4.2.5-rfc3442-classless-static-routes.patch new file mode 100644 index 0000000..62a2b69 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-rfc3442-classless-static-routes.patch @@ -0,0 +1,405 @@ +diff -up dhcp-4.2.5b1/client/clparse.c.rfc3442 dhcp-4.2.5b1/client/clparse.c +--- dhcp-4.2.5b1/client/clparse.c.rfc3442 2012-12-17 13:23:34.387564654 +0100 ++++ dhcp-4.2.5b1/client/clparse.c 2012-12-17 13:23:34.437563996 +0100 +@@ -37,7 +37,7 @@ + + struct client_config top_level_config; + +-#define NUM_DEFAULT_REQUESTED_OPTS 14 ++#define NUM_DEFAULT_REQUESTED_OPTS 15 + struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1]; + + static void parse_client_default_duid(struct parse *cfile); +@@ -90,7 +90,11 @@ isc_result_t read_client_conf () + dhcp_universe.code_hash, &code, 0, MDL); + + /* 4 */ +- code = DHO_ROUTERS; ++ /* The Classless Static Routes option code MUST appear in the parameter ++ * request list prior to both the Router option code and the Static ++ * Routes option code, if present. (RFC3442) ++ */ ++ code = DHO_CLASSLESS_STATIC_ROUTES; + option_code_hash_lookup(&default_requested_options[3], + dhcp_universe.code_hash, &code, 0, MDL); + +@@ -144,6 +148,11 @@ isc_result_t read_client_conf () + option_code_hash_lookup(&default_requested_options[13], + dhcp_universe.code_hash, &code, 0, MDL); + ++ /* 15 */ ++ code = DHO_ROUTERS; ++ option_code_hash_lookup(&default_requested_options[14], ++ dhcp_universe.code_hash, &code, 0, MDL); ++ + for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) { + if (default_requested_options[code] == NULL) + log_fatal("Unable to find option definition for " +diff -up dhcp-4.2.5b1/common/dhcp-options.5.rfc3442 dhcp-4.2.5b1/common/dhcp-options.5 +--- dhcp-4.2.5b1/common/dhcp-options.5.rfc3442 2012-12-17 13:23:34.376564797 +0100 ++++ dhcp-4.2.5b1/common/dhcp-options.5 2012-12-17 13:25:18.435141385 +0100 +@@ -116,6 +116,26 @@ hexadecimal, separated by colons. For e + or + option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f; + .fi ++.PP ++The ++.B destination-descriptor ++describe the IP subnet number and subnet mask ++of a particular destination using a compact encoding. This encoding ++consists of one octet describing the width of the subnet mask, ++followed by all the significant octets of the subnet number. ++The following table contains some examples of how various subnet ++number/mask combinations can be encoded: ++.nf ++.sp 1 ++Subnet number Subnet mask Destination descriptor ++0 0 0 ++10.0.0.0 255.0.0.0 8.10 ++10.0.0.0 255.255.255.0 24.10.0.0 ++10.17.0.0 255.255.0.0 16.10.17 ++10.27.129.0 255.255.255.0 24.10.27.129 ++10.229.0.128 255.255.255.128 25.10.229.0.128 ++10.198.122.47 255.255.255.255 32.10.198.122.47 ++.fi + .SH SETTING OPTION VALUES USING EXPRESSIONS + Sometimes it's helpful to be able to set the value of a DHCP option + based on some value that the client has sent. To do this, you can +@@ -932,6 +952,29 @@ dhclient-script will create routes: + .RE + .PP + .nf ++.B option \fBclassless-static-routes\fR \fIdestination-descriptor ip-address\fR ++ [\fB,\fR \fIdestination-descriptor ip-address\fR...]\fB;\fR ++.fi ++.RS 0.25i ++.PP ++This option (see RFC3442) specifies a list of classless static routes ++that the client should install in its routing cache. ++.PP ++This option can contain one or more static routes, each of which ++consists of a destination descriptor and the IP address of the router ++that should be used to reach that destination. ++.PP ++Many clients may not implement the Classless Static Routes option. ++DHCP server administrators should therefore configure their DHCP ++servers to send both a Router option and a Classless Static Routes ++option, and should specify the default router(s) both in the Router ++option and in the Classless Static Routes option. ++.PP ++If the DHCP server returns both a Classless Static Routes option and ++a Router option, the DHCP client ignores the Router option. ++.RE ++.PP ++.nf + .B option \fBstreettalk-directory-assistance-server\fR \fIip-address\fR + [\fB,\fR \fIip-address\fR...]\fB;\fR + .fi +diff -up dhcp-4.2.5b1/common/inet.c.rfc3442 dhcp-4.2.5b1/common/inet.c +--- dhcp-4.2.5b1/common/inet.c.rfc3442 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/common/inet.c 2012-12-17 13:23:34.440563957 +0100 +@@ -528,6 +528,60 @@ free_iaddrcidrnetlist(struct iaddrcidrne + return ISC_R_SUCCESS; + } + ++static const char * ++inet_ntopdd(const unsigned char *src, unsigned srclen, char *dst, size_t size) ++{ ++ char tmp[sizeof("32.255.255.255.255")]; ++ int len; ++ ++ switch (srclen) { ++ case 2: ++ len = sprintf (tmp, "%u.%u", src[0], src[1]); ++ break; ++ case 3: ++ len = sprintf (tmp, "%u.%u.%u", src[0], src[1], src[2]); ++ break; ++ case 4: ++ len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]); ++ break; ++ case 5: ++ len = sprintf (tmp, "%u.%u.%u.%u.%u", src[0], src[1], src[2], src[3], src[4]); ++ break; ++ default: ++ return NULL; ++ } ++ if (len < 0) ++ return NULL; ++ ++ if (len > size) { ++ errno = ENOSPC; ++ return NULL; ++ } ++ ++ return strcpy (dst, tmp); ++} ++ ++/* pdestdesc() turns an iaddr structure into a printable dest. descriptor */ ++const char * ++pdestdesc(const struct iaddr addr) { ++ static char pbuf[sizeof("255.255.255.255.255")]; ++ ++ if (addr.len == 0) { ++ return "<null destination descriptor>"; ++ } ++ if (addr.len == 1) { ++ return "0"; ++ } ++ if ((addr.len >= 2) && (addr.len <= 5)) { ++ return inet_ntopdd(addr.iabuf, addr.len, pbuf, sizeof(pbuf)); ++ } ++ ++ log_fatal("pdestdesc():%s:%d: Invalid destination descriptor length %d.", ++ MDL, addr.len); ++ /* quell compiler warnings */ ++ return NULL; ++} ++ + /* piaddr() turns an iaddr structure into a printable address. */ + /* XXX: should use a const pointer rather than passing the structure */ + const char * +diff -up dhcp-4.2.5b1/common/options.c.rfc3442 dhcp-4.2.5b1/common/options.c +--- dhcp-4.2.5b1/common/options.c.rfc3442 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/common/options.c 2012-12-17 13:29:38.961536040 +0100 +@@ -713,7 +713,11 @@ cons_options(struct packet *inpacket, st + * packet. + */ + priority_list[priority_len++] = DHO_SUBNET_MASK; +- priority_list[priority_len++] = DHO_ROUTERS; ++ if (lookup_option(&dhcp_universe, cfg_options, ++ DHO_CLASSLESS_STATIC_ROUTES)) ++ priority_list[priority_len++] = DHO_CLASSLESS_STATIC_ROUTES; ++ else ++ priority_list[priority_len++] = DHO_ROUTERS; + priority_list[priority_len++] = DHO_DOMAIN_NAME_SERVERS; + priority_list[priority_len++] = DHO_HOST_NAME; + priority_list[priority_len++] = DHO_FQDN; +@@ -1694,6 +1698,7 @@ const char *pretty_print_option (option, + unsigned long tval; + isc_boolean_t a_array = ISC_FALSE; + int len_used; ++ unsigned int octets = 0; + + if (emit_commas) + comma = ','; +@@ -1702,6 +1707,7 @@ const char *pretty_print_option (option, + + memset (enumbuf, 0, sizeof enumbuf); + ++ if (option->format[0] != 'R') { /* see explanation lower */ + /* Figure out the size of the data. */ + for (l = i = 0; option -> format [i]; i++, l++) { + if (l >= sizeof(fmtbuf) - 1) +@@ -1876,6 +1882,33 @@ const char *pretty_print_option (option, + if (numhunk < 0) + numhunk = 1; + ++ } else { /* option->format[i] == 'R') */ ++ /* R (destination descriptor) has variable length. ++ * We can find it only in classless static route option, ++ * so we are for sure parsing classless static route option now. ++ * We go through whole the option to check whether there are no ++ * missing/extra bytes. ++ * I didn't find out how to improve the existing code and that's the ++ * reason for this separate 'else' where I do my own checkings. ++ * I know it's little bit unsystematic, but it works. ++ */ ++ numhunk = 0; ++ numelem = 2; /* RI */ ++ fmtbuf[0]='R'; fmtbuf[1]='I'; fmtbuf[2]=0; ++ for (i =0; i < len; i = i + octets + 5) { ++ if (data[i] > 32) { /* subnet mask width */ ++ log_error ("wrong subnet mask width in destination descriptor"); ++ break; ++ } ++ numhunk++; ++ octets = ((data[i]+7) / 8); ++ } ++ if (i != len) { ++ log_error ("classless static routes option has wrong size or " ++ "there's some garbage in format"); ++ } ++ } ++ + /* Cycle through the array (or hunk) printing the data. */ + for (i = 0; i < numhunk; i++) { + if ((a_array == ISC_TRUE) && (i != 0) && (numelem > 0)) { +@@ -2031,6 +2064,20 @@ const char *pretty_print_option (option, + strcpy(op, piaddr(iaddr)); + dp += 4; + break; ++ ++ case 'R': ++ if (dp[0] <= 32) ++ iaddr.len = (((dp[0]+7)/8)+1); ++ else { ++ log_error ("wrong subnet mask width in destination descriptor"); ++ return "<error>"; ++ } ++ ++ memcpy(iaddr.iabuf, dp, iaddr.len); ++ strcpy(op, pdestdesc(iaddr)); ++ dp += iaddr.len; ++ break; ++ + case '6': + iaddr.len = 16; + memcpy(iaddr.iabuf, dp, 16); +diff -up dhcp-4.2.5b1/common/parse.c.rfc3442 dhcp-4.2.5b1/common/parse.c +--- dhcp-4.2.5b1/common/parse.c.rfc3442 2012-12-17 13:23:34.408564378 +0100 ++++ dhcp-4.2.5b1/common/parse.c 2012-12-17 13:23:34.444563905 +0100 +@@ -341,6 +341,39 @@ int parse_ip_addr (cfile, addr) + } + + /* ++ * destination-descriptor :== NUMBER DOT NUMBER | ++ * NUMBER DOT NUMBER DOT NUMBER | ++ * NUMBER DOT NUMBER DOT NUMBER DOT NUMBER | ++ * NUMBER DOT NUMBER DOT NUMBER DOT NUMBER DOT NUMBER ++ */ ++ ++int parse_destination_descriptor (cfile, addr) ++ struct parse *cfile; ++ struct iaddr *addr; ++{ ++ unsigned int mask_width, dest_dest_len; ++ addr -> len = 0; ++ if (parse_numeric_aggregate (cfile, addr -> iabuf, ++ &addr -> len, DOT, 10, 8)) { ++ mask_width = (unsigned int)addr->iabuf[0]; ++ dest_dest_len = (((mask_width+7)/8)+1); ++ if (mask_width > 32) { ++ parse_warn (cfile, ++ "subnet mask width (%u) greater than 32.", mask_width); ++ } ++ else if (dest_dest_len != addr->len) { ++ parse_warn (cfile, ++ "destination descriptor with subnet mask width %u " ++ "should have %u octets, but has %u octets.", ++ mask_width, dest_dest_len, addr->len); ++ } ++ ++ return 1; ++ } ++ return 0; ++} ++ ++/* + * Return true if every character in the string is hexadecimal. + */ + static int +@@ -719,8 +752,10 @@ unsigned char *parse_numeric_aggregate ( + if (count) { + token = peek_token (&val, (unsigned *)0, cfile); + if (token != separator) { +- if (!*max) ++ if (!*max) { ++ *max = count; + break; ++ } + if (token != RBRACE && token != LBRACE) + token = next_token (&val, + (unsigned *)0, +@@ -1660,6 +1695,9 @@ int parse_option_code_definition (cfile, + case IP_ADDRESS: + type = 'I'; + break; ++ case DESTINATION_DESCRIPTOR: ++ type = 'R'; ++ break; + case IP6_ADDRESS: + type = '6'; + break; +@@ -5418,6 +5456,15 @@ int parse_option_token (rv, cfile, fmt, + } + break; + ++ case 'R': /* destination descriptor */ ++ if (!parse_destination_descriptor (cfile, &addr)) { ++ return 0; ++ } ++ if (!make_const_data (&t, addr.iabuf, addr.len, 0, 1, MDL)) { ++ return 0; ++ } ++ break; ++ + case '6': /* IPv6 address. */ + if (!parse_ip6_addr(cfile, &addr)) { + return 0; +@@ -5695,6 +5742,13 @@ int parse_option_decl (oc, cfile) + goto exit; + len = ip_addr.len; + dp = ip_addr.iabuf; ++ goto alloc; ++ ++ case 'R': /* destination descriptor */ ++ if (!parse_destination_descriptor (cfile, &ip_addr)) ++ goto exit; ++ len = ip_addr.len; ++ dp = ip_addr.iabuf; + + alloc: + if (hunkix + len > sizeof hunkbuf) { +diff -up dhcp-4.2.5b1/common/tables.c.rfc3442 dhcp-4.2.5b1/common/tables.c +--- dhcp-4.2.5b1/common/tables.c.rfc3442 2012-12-17 13:23:34.398564508 +0100 ++++ dhcp-4.2.5b1/common/tables.c 2012-12-17 13:23:34.445563891 +0100 +@@ -52,6 +52,7 @@ HASH_FUNCTIONS (option_code, const unsig + Format codes: + + I - IPv4 address ++ R - destination descriptor (RFC3442) + 6 - IPv6 address + l - 32-bit signed integer + L - 32-bit unsigned integer +@@ -210,6 +211,7 @@ static struct option dhcp_options[] = { + { "default-url", "t", &dhcp_universe, 114, 1 }, + { "subnet-selection", "I", &dhcp_universe, 118, 1 }, + { "domain-search", "D", &dhcp_universe, 119, 1 }, ++ { "classless-static-routes", "RIA", &dhcp_universe, 121, 1 }, + { "vivco", "Evendor-class.", &dhcp_universe, 124, 1 }, + { "vivso", "Evendor.", &dhcp_universe, 125, 1 }, + #if 0 +diff -up dhcp-4.2.5b1/includes/dhcpd.h.rfc3442 dhcp-4.2.5b1/includes/dhcpd.h +--- dhcp-4.2.5b1/includes/dhcpd.h.rfc3442 2012-12-17 13:23:34.382564719 +0100 ++++ dhcp-4.2.5b1/includes/dhcpd.h 2012-12-17 13:23:34.446563877 +0100 +@@ -2678,6 +2678,7 @@ isc_result_t range2cidr(struct iaddrcidr + const struct iaddr *lo, const struct iaddr *hi); + isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result); + const char *piaddr (struct iaddr); ++const char *pdestdesc (struct iaddr); + char *piaddrmask(struct iaddr *, struct iaddr *); + char *piaddrcidr(const struct iaddr *, unsigned int); + u_int16_t validate_port(char *); +@@ -2887,6 +2888,7 @@ void parse_client_lease_declaration (str + int parse_option_decl (struct option_cache **, struct parse *); + void parse_string_list (struct parse *, struct string_list **, int); + int parse_ip_addr (struct parse *, struct iaddr *); ++int parse_destination_descriptor (struct parse *, struct iaddr *); + int parse_ip_addr_with_subnet(struct parse *, struct iaddrmatch *); + void parse_reject_statement (struct parse *, struct client_config *); + +diff -up dhcp-4.2.5b1/includes/dhcp.h.rfc3442 dhcp-4.2.5b1/includes/dhcp.h +--- dhcp-4.2.5b1/includes/dhcp.h.rfc3442 2012-10-23 21:02:13.000000000 +0200 ++++ dhcp-4.2.5b1/includes/dhcp.h 2012-12-17 13:23:34.446563877 +0100 +@@ -163,6 +163,7 @@ struct dhcp_packet { + #define DHO_ASSOCIATED_IP 92 + #define DHO_SUBNET_SELECTION 118 /* RFC3011! */ + #define DHO_DOMAIN_SEARCH 119 /* RFC3397 */ ++#define DHO_CLASSLESS_STATIC_ROUTES 121 /* RFC3442 */ + #define DHO_VIVCO_SUBOPTIONS 124 + #define DHO_VIVSO_SUBOPTIONS 125 + +diff -up dhcp-4.2.5b1/includes/dhctoken.h.rfc3442 dhcp-4.2.5b1/includes/dhctoken.h +--- dhcp-4.2.5b1/includes/dhctoken.h.rfc3442 2012-12-17 13:23:34.348565167 +0100 ++++ dhcp-4.2.5b1/includes/dhctoken.h 2012-12-17 13:23:34.446563877 +0100 +@@ -365,7 +365,8 @@ enum dhcp_token { + PRIMARY6 = 666, + SECONDARY6 = 667, + TOKEN_INFINIBAND = 668, +- BOOTP_BROADCAST_ALWAYS = 669 ++ BOOTP_BROADCAST_ALWAYS = 669, ++ DESTINATION_DESCRIPTOR = 670 + }; + + #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/dhcp/patches/dhcp-4.2.5-rfc5970-dhcpv6-options-for-network-boot.patch b/dhcp/patches/dhcp-4.2.5-rfc5970-dhcpv6-options-for-network-boot.patch new file mode 100644 index 0000000..3b844e0 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-rfc5970-dhcpv6-options-for-network-boot.patch @@ -0,0 +1,89 @@ +diff -up dhcp-4.2.5b1/common/dhcp-options.5.rfc5970 dhcp-4.2.5b1/common/dhcp-options.5 +--- dhcp-4.2.5b1/common/dhcp-options.5.rfc5970 2012-12-17 13:43:44.000000000 +0100 ++++ dhcp-4.2.5b1/common/dhcp-options.5 2012-12-17 13:45:18.777638579 +0100 +@@ -1771,7 +1771,48 @@ The \fBlq-relay-data\fR option is used i + The \fBlq-client-link\fR option is used internally by for lease query. + .RE + .PP ++ ++.B option ++.B dhcp6.bootfile-url ++.I string ++.B ; ++.RS 0.25i ++.PP ++The server sends this option to inform the client about a URL to a ++boot file. Used primarily for UEFI network booting, it contains an RFC3986 ++compliant URI which the client may use to boot an operating system. This option ++is defined in RFC5970 + .RE ++.PP ++ ++.B option ++.B dhcp6.arch-type ++.I arch-id \fR[\fB,\fR arch-id\fR...] ++.B ; ++.RS 0.25i ++.PP ++A client will send this option to a server so that the server may make decisions ++on what options and addresses to offer the requesting client. The option ++consists of a list of 16 bit unsigned values that represent the architecture of ++the requesting client. These values corespond to the values available to the ++dhcpv4 option architecture-type, as defined in RFC4578, section 2.1. ++This option is defined in RFC5970 ++ .RE ++.PP ++ ++.B option ++.B dhcp6.net-id ++.I uint8 uint8 uint8 ++.B ; ++.RS 0.25i ++.PP ++A client will send this option to a server to inform it about the clients level ++of UNDI support. The option consists of 3 octets (a type, major and minor ++value). Specific meanings of these values are doumented in section 2.2 of ++RFC4578. ++This option is defined in RFC5970 ++.RE ++.PP + .SH DEFINING NEW OPTIONS + The Internet Systems Consortium DHCP client and server provide the + capability to define new options. Each DHCP option has a name, a +diff -up dhcp-4.2.5b1/common/tables.c.rfc5970 dhcp-4.2.5b1/common/tables.c +--- dhcp-4.2.5b1/common/tables.c.rfc5970 2012-12-17 13:43:44.204939024 +0100 ++++ dhcp-4.2.5b1/common/tables.c 2012-12-17 13:43:44.286937948 +0100 +@@ -463,6 +463,18 @@ static struct option dhcpv6_options[] = + { "lq-relay-data", "6X", &dhcpv6_universe, 47, 1 }, + { "lq-client-link", "6A", &dhcpv6_universe, 48, 1 }, + ++ /* RFC5970 OPTIONS */ ++ ++ { "bootfile-url", "t", &dhcpv6_universe, 59, 1}, ++#if 0 ++ /* Can't implement this until arrays of strings with length "StA" ++ * are implemented ++ */ ++ { "bootfile-param", "StA", &dhcpv6_universe, 60, 1}, ++#endif ++ { "arch-type", "Sa", &dhcpv6_universe, 61, 1}, ++ { "net-id", "BBB", &dhcpv6_universe, 62, 1}, ++ + { NULL, NULL, NULL, 0, 0 } + }; + +diff -up dhcp-4.2.5b1/includes/dhcp6.h.rfc5970 dhcp-4.2.5b1/includes/dhcp6.h +--- dhcp-4.2.5b1/includes/dhcp6.h.rfc5970 2012-12-04 20:45:42.000000000 +0100 ++++ dhcp-4.2.5b1/includes/dhcp6.h 2012-12-17 13:43:44.286937948 +0100 +@@ -75,6 +75,11 @@ + #define D6O_CLT_TIME 46 /* RFC5007 */ + #define D6O_LQ_RELAY_DATA 47 /* RFC5007 */ + #define D6O_LQ_CLIENT_LINK 48 /* RFC5007 */ ++/* 49-58 Not yet assigned */ ++#define D60_BOOT_URL 59 /* RFC5970 */ ++#define D60_BOOT_PARAMS 60 /* RFC5970 */ ++#define D60_CLIENT_ARCH 61 /* RFC5970 */ ++#define D60_CLIENT_NII 62 /* RFC5970 */ + + /* + * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007. diff --git a/dhcp/patches/dhcp-4.2.5-sendDecline.patch b/dhcp/patches/dhcp-4.2.5-sendDecline.patch new file mode 100644 index 0000000..0853730 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-sendDecline.patch @@ -0,0 +1,231 @@ +diff -up dhcp-4.2.5b1/client/dhc6.c.sendDecline dhcp-4.2.5b1/client/dhc6.c +--- dhcp-4.2.5b1/client/dhc6.c.sendDecline 2012-12-05 02:17:38.000000000 +0100 ++++ dhcp-4.2.5b1/client/dhc6.c 2012-12-17 13:21:16.922444939 +0100 +@@ -96,6 +96,8 @@ void do_select6(void *input); + void do_refresh6(void *input); + static void do_release6(void *input); + static void start_bound(struct client_state *client); ++static void start_decline6(struct client_state *client); ++static void do_decline6(void *input); + static void start_informed(struct client_state *client); + void informed_handler(struct packet *packet, struct client_state *client); + void bound_handler(struct packet *packet, struct client_state *client); +@@ -2080,6 +2082,7 @@ start_release6(struct client_state *clie + cancel_timeout(do_select6, client); + cancel_timeout(do_refresh6, client); + cancel_timeout(do_release6, client); ++ cancel_timeout(do_decline6, client); + client->state = S_STOPPED; + + /* +@@ -2713,6 +2716,7 @@ dhc6_check_reply(struct client_state *cl + break; + + case S_STOPPED: ++ case S_DECLINED: + action = dhc6_stop_action; + break; + +@@ -2814,6 +2818,7 @@ dhc6_check_reply(struct client_state *cl + break; + + case S_STOPPED: ++ case S_DECLINED: + /* Nothing critical to do at this stage. */ + break; + +@@ -3804,17 +3809,23 @@ reply_handler(struct packet *packet, str + cancel_timeout(do_select6, client); + cancel_timeout(do_refresh6, client); + cancel_timeout(do_release6, client); ++ cancel_timeout(do_decline6, client); + + /* If this is in response to a Release/Decline, clean up and return. */ +- if (client->state == S_STOPPED) { +- if (client->active_lease == NULL) +- return; ++ if ((client->state == S_STOPPED) || ++ (client->state == S_DECLINED)) { ++ ++ if (client->active_lease != NULL) { ++ dhc6_lease_destroy(&client->active_lease, MDL); ++ client->active_lease = NULL; ++ /* We should never wait for nothing!? */ ++ if (stopping_finished()) ++ exit(0); ++ } ++ ++ if (client->state == S_DECLINED) ++ start_init6(client); + +- dhc6_lease_destroy(&client->active_lease, MDL); +- client->active_lease = NULL; +- /* We should never wait for nothing!? */ +- if (stopping_finished()) +- exit(0); + return; + } + +@@ -4342,7 +4353,11 @@ start_bound(struct client_state *client) + dhc6_marshall_values("new_", client, lease, ia, addr); + script_write_requested6(client); + +- script_go(client); ++ // when script returns 3, DAD failed ++ if (script_go(client) == 3) { ++ start_decline6(client); ++ return; ++ } + } + + /* XXX: maybe we should loop on the old values instead? */ +@@ -4390,6 +4405,149 @@ start_bound(struct client_state *client) + dhc6_check_times(client); + } + ++/* ++ * Decline addresses. ++ */ ++void ++start_decline6(struct client_state *client) ++{ ++ /* Cancel any pending transmissions */ ++ cancel_timeout(do_confirm6, client); ++ cancel_timeout(do_select6, client); ++ cancel_timeout(do_refresh6, client); ++ cancel_timeout(do_release6, client); ++ cancel_timeout(do_decline6, client); ++ client->state = S_DECLINED; ++ ++ if (client->active_lease == NULL) ++ return; ++ ++ /* Set timers per RFC3315 section 18.1.7. */ ++ client->IRT = DEC_TIMEOUT * 100; ++ client->MRT = 0; ++ client->MRC = DEC_MAX_RC; ++ client->MRD = 0; ++ ++ dhc6_retrans_init(client); ++ client->v6_handler = reply_handler; ++ ++ client->refresh_type = DHCPV6_DECLINE; ++ do_decline6(client); ++} ++ ++/* ++ * do_decline6() creates a Decline packet and transmits it. ++ */ ++static void ++do_decline6(void *input) ++{ ++ struct client_state *client; ++ struct data_string ds; ++ int send_ret; ++ struct timeval elapsed, tv; ++ ++ client = input; ++ ++ if ((client->active_lease == NULL) || !active_prefix(client)) ++ return; ++ ++ if ((client->MRC != 0) && (client->txcount > client->MRC)) { ++ log_info("Max retransmission count exceeded."); ++ goto decline_done; ++ } ++ ++ /* ++ * Start_time starts at the first transmission. ++ */ ++ if (client->txcount == 0) { ++ client->start_time.tv_sec = cur_tv.tv_sec; ++ client->start_time.tv_usec = cur_tv.tv_usec; ++ } ++ ++ /* elapsed = cur - start */ ++ elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec; ++ elapsed.tv_usec = cur_tv.tv_usec - client->start_time.tv_usec; ++ if (elapsed.tv_usec < 0) { ++ elapsed.tv_sec -= 1; ++ elapsed.tv_usec += 1000000; ++ } ++ ++ memset(&ds, 0, sizeof(ds)); ++ if (!buffer_allocate(&ds.buffer, 4, MDL)) { ++ log_error("Unable to allocate memory for Decline."); ++ goto decline_done; ++ } ++ ++ ds.data = ds.buffer->data; ++ ds.len = 4; ++ ds.buffer->data[0] = DHCPV6_DECLINE; ++ memcpy(ds.buffer->data + 1, client->dhcpv6_transaction_id, 3); ++ ++ /* Form an elapsed option. */ ++ /* Maximum value is 65535 1/100s coded as 0xffff. */ ++ if ((elapsed.tv_sec < 0) || (elapsed.tv_sec > 655) || ++ ((elapsed.tv_sec == 655) && (elapsed.tv_usec > 350000))) { ++ client->elapsed = 0xffff; ++ } else { ++ client->elapsed = elapsed.tv_sec * 100; ++ client->elapsed += elapsed.tv_usec / 10000; ++ } ++ ++ client->elapsed = htons(client->elapsed); ++ ++ log_debug("XMT: Forming Decline."); ++ make_client6_options(client, &client->sent_options, ++ client->active_lease, DHCPV6_DECLINE); ++ dhcpv6_universe.encapsulate(&ds, NULL, NULL, client, NULL, ++ client->sent_options, &global_scope, ++ &dhcpv6_universe); ++ ++ /* Append IA's (but don't release temporary addresses). */ ++ if (wanted_ia_na && ++ dhc6_add_ia_na(client, &ds, client->active_lease, ++ DHCPV6_DECLINE) != ISC_R_SUCCESS) { ++ data_string_forget(&ds, MDL); ++ goto decline_done; ++ } ++ if (wanted_ia_pd && ++ dhc6_add_ia_pd(client, &ds, client->active_lease, ++ DHCPV6_DECLINE) != ISC_R_SUCCESS) { ++ data_string_forget(&ds, MDL); ++ goto decline_done; ++ } ++ ++ /* Transmit and wait. */ ++ log_info("XMT: Decline on %s, interval %ld0ms.", ++ client->name ? client->name : client->interface->name, ++ (long int)client->RT); ++ ++ send_ret = send_packet6(client->interface, ds.data, ds.len, ++ &DHCPv6DestAddr); ++ if (send_ret != ds.len) { ++ log_error("dhc6: sendpacket6() sent %d of %d bytes", ++ send_ret, ds.len); ++ } ++ ++ data_string_forget(&ds, MDL); ++ ++ /* Wait RT */ ++ tv.tv_sec = cur_tv.tv_sec + client->RT / 100; ++ tv.tv_usec = cur_tv.tv_usec + (client->RT % 100) * 10000; ++ if (tv.tv_usec >= 1000000) { ++ tv.tv_sec += 1; ++ tv.tv_usec -= 1000000; ++ } ++ add_timeout(&tv, do_decline6, client, NULL, NULL); ++ dhc6_retrans_advance(client); ++ return; ++ ++decline_done: ++ dhc6_lease_destroy(&client->active_lease, MDL); ++ client->active_lease = NULL; ++ start_init6(client); ++ return; ++} ++ + /* While bound, ignore packets. In the future we'll want to answer + * Reconfigure-Request messages and the like. + */ diff --git a/dhcp/patches/dhcp-4.2.5-sharedlib.patch b/dhcp/patches/dhcp-4.2.5-sharedlib.patch new file mode 100644 index 0000000..d543ab7 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-sharedlib.patch @@ -0,0 +1,120 @@ +diff -up dhcp-4.2.5b1/client/Makefile.am.sharedlib dhcp-4.2.5b1/client/Makefile.am +--- dhcp-4.2.5b1/client/Makefile.am.sharedlib 2012-12-17 16:26:53.350623790 +0100 ++++ dhcp-4.2.5b1/client/Makefile.am 2012-12-17 16:26:53.384623342 +0100 +@@ -4,7 +4,7 @@ dhclient_SOURCES = clparse.c dhclient.c + scripts/bsdos scripts/freebsd scripts/linux scripts/macos \ + scripts/netbsd scripts/nextstep scripts/openbsd \ + scripts/solaris scripts/openwrt +-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ ++dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ + $(BIND9_LIBDIR) -ldns-export -lisc-export $(CAPNG_LDADD) + man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 + EXTRA_DIST = $(man_MANS) +diff -up dhcp-4.2.5b1/common/tests/Makefile.am.sharedlib dhcp-4.2.5b1/common/tests/Makefile.am +--- dhcp-4.2.5b1/common/tests/Makefile.am.sharedlib 2012-12-17 16:26:53.271624835 +0100 ++++ dhcp-4.2.5b1/common/tests/Makefile.am 2012-12-17 16:26:53.384623342 +0100 +@@ -13,7 +13,7 @@ ATF_TESTS += alloc_unittest + alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c + alloc_unittest_LDADD = $(ATF_LDFLAGS) + alloc_unittest_LDADD += ../libdhcp.a \ +- ../../omapip/libomapi.a \ ++ ../../omapip/libomapi.la \ + $(BIND9_LIBDIR) -ldns-export -lisc-export + + check: $(ATF_TESTS) +diff -up dhcp-4.2.5b1/configure.ac.sharedlib dhcp-4.2.5b1/configure.ac +--- dhcp-4.2.5b1/configure.ac.sharedlib 2012-12-17 16:26:53.350623790 +0100 ++++ dhcp-4.2.5b1/configure.ac 2012-12-17 16:26:53.384623342 +0100 +@@ -37,7 +37,8 @@ fi + # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API. + AC_USE_SYSTEM_EXTENSIONS + +-AC_PROG_RANLIB ++# Use libtool to simplify building of shared libraries ++AC_PROG_LIBTOOL + AC_CONFIG_HEADERS([includes/config.h]) + + # we sometimes need to know byte order for building packets +diff -up dhcp-4.2.5b1/dhcpctl/Makefile.am.sharedlib dhcp-4.2.5b1/dhcpctl/Makefile.am +--- dhcp-4.2.5b1/dhcpctl/Makefile.am.sharedlib 2012-12-17 16:26:53.271624835 +0100 ++++ dhcp-4.2.5b1/dhcpctl/Makefile.am 2012-12-17 16:26:53.385623329 +0100 +@@ -1,15 +1,15 @@ + bin_PROGRAMS = omshell +-lib_LIBRARIES = libdhcpctl.a ++lib_LTLIBRARIES = libdhcpctl.la + noinst_PROGRAMS = cltest + man_MANS = omshell.1 dhcpctl.3 + EXTRA_DIST = $(man_MANS) + + omshell_SOURCES = omshell.c +-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ ++omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ + $(BIND9_LIBDIR) -ldns-export -lisc-export + +-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c ++libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c + + cltest_SOURCES = cltest.c +-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \ ++cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \ + $(BIND9_LIBDIR) -ldns-export -lisc-export +diff -up dhcp-4.2.5b1/omapip/Makefile.am.sharedlib dhcp-4.2.5b1/omapip/Makefile.am +--- dhcp-4.2.5b1/omapip/Makefile.am.sharedlib 2012-12-17 16:26:53.272624822 +0100 ++++ dhcp-4.2.5b1/omapip/Makefile.am 2012-12-17 16:26:53.385623329 +0100 +@@ -1,7 +1,7 @@ +-lib_LIBRARIES = libomapi.a ++lib_LTLIBRARIES = libomapi.la + noinst_PROGRAMS = svtest + +-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ ++libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \ + errwarn.c listener.c dispatch.c generic.c support.c \ + handle.c message.c convert.c hash.c auth.c inet_addr.c \ + array.c trace.c toisc.c iscprint.c isclib.c +@@ -10,5 +10,5 @@ man_MANS = omapi.3 + EXTRA_DIST = $(man_MANS) + + svtest_SOURCES = test.c +-svtest_LDADD = libomapi.a $(BIND9_LIBDIR) -ldns-export -lisc-export ++svtest_LDADD = libomapi.la $(BIND9_LIBDIR) -ldns-export -lisc-export + +diff -up dhcp-4.2.5b1/relay/Makefile.am.sharedlib dhcp-4.2.5b1/relay/Makefile.am +--- dhcp-4.2.5b1/relay/Makefile.am.sharedlib 2012-12-17 16:26:53.351623777 +0100 ++++ dhcp-4.2.5b1/relay/Makefile.am 2012-12-17 16:26:53.385623329 +0100 +@@ -2,7 +2,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst + + sbin_PROGRAMS = dhcrelay + dhcrelay_SOURCES = dhcrelay.c +-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ ++dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ + $(BIND9_LIBDIR) -ldns-export -lisc-export $(CAPNG_LDADD) + man_MANS = dhcrelay.8 + EXTRA_DIST = $(man_MANS) +diff -up dhcp-4.2.5b1/server/Makefile.am.sharedlib dhcp-4.2.5b1/server/Makefile.am +--- dhcp-4.2.5b1/server/Makefile.am.sharedlib 2012-12-17 16:26:53.272624822 +0100 ++++ dhcp-4.2.5b1/server/Makefile.am 2012-12-17 16:26:53.385623329 +0100 +@@ -13,8 +13,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c + dhcpv6.c mdb6.c ldap.c ldap_casa.c + + dhcpd_CFLAGS = $(LDAP_CFLAGS) +-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \ +- ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export ++dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ ++ ../dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export + + man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 + EXTRA_DIST = $(man_MANS) +diff -up dhcp-4.2.5b1/server/tests/Makefile.am.sharedlib dhcp-4.2.5b1/server/tests/Makefile.am +--- dhcp-4.2.5b1/server/tests/Makefile.am.sharedlib 2012-12-17 16:26:53.000000000 +0100 ++++ dhcp-4.2.5b1/server/tests/Makefile.am 2012-12-17 16:28:25.898349545 +0100 +@@ -17,8 +17,8 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpa + ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \ + ../ldap.c ../ldap_casa.c ../dhcpd.c + +-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \ +- $(top_builddir)/dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export ++DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \ ++ $(top_builddir)/dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export + + ATF_TESTS = + TESTS = diff --git a/dhcp/patches/dhcp-4.2.5-systemtap.patch b/dhcp/patches/dhcp-4.2.5-systemtap.patch new file mode 100644 index 0000000..ad774ad --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5-systemtap.patch @@ -0,0 +1,822 @@ +diff -up dhcp-4.2.5b1/configure.ac.systemtap dhcp-4.2.5b1/configure.ac +--- dhcp-4.2.5b1/configure.ac.systemtap 2012-12-17 16:56:40.563881316 +0100 ++++ dhcp-4.2.5b1/configure.ac 2012-12-17 16:56:40.597880870 +0100 +@@ -554,6 +554,35 @@ else + AC_MSG_RESULT(no) + fi + ++AC_MSG_CHECKING([whether to include systemtap tracing support]) ++AC_ARG_ENABLE([systemtap], ++ [AS_HELP_STRING([--enable-systemtap], ++ [Enable inclusion of systemtap trace support])], ++ [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no']) ++AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes]) ++AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) ++ ++if test "x${ENABLE_SYSTEMTAP}" = xyes; then ++ # Additional configuration for --enable-systemtap is HERE ++ AC_CHECK_PROGS(DTRACE, dtrace) ++ if test -z "$DTRACE"; then ++ AC_MSG_ERROR([dtrace not found]) ++ fi ++ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'], ++ [SDT_H_FOUND='no'; ++ AC_MSG_ERROR([systemtap support needs sys/sdt.h header])]) ++ AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using SystemTap probes.]) ++ AC_ARG_WITH([tapset-install-dir], ++ [AS_HELP_STRING([--with-tapset-install-dir], ++ [The absolute path where the tapset dir will be installed])], ++ [if test "x${withval}" = x; then ++ ABS_TAPSET_DIR="$(datadir)/systemtap/tapset" ++ else ++ ABS_TAPSET_DIR="${withval}" ++ fi], [ABS_TAPSET_DIR="$(datadir)/systemtap/tapset"]) ++ AC_SUBST(ABS_TAPSET_DIR) ++fi ++ + # Solaris needs some libraries for functions + AC_SEARCH_LIBS(socket, [socket]) + AC_SEARCH_LIBS(inet_ntoa, [nsl]) +@@ -701,6 +730,7 @@ AC_OUTPUT([ + tests/Makefile + server/tests/Makefile + doc/devel/doxyfile ++ tapset/Makefile + ]) + + sh util/bindvar.sh +diff -up dhcp-4.2.5b1/Makefile.am.systemtap dhcp-4.2.5b1/Makefile.am +--- dhcp-4.2.5b1/Makefile.am.systemtap 2012-12-17 16:56:40.461882654 +0100 ++++ dhcp-4.2.5b1/Makefile.am 2012-12-17 16:56:40.597880870 +0100 +@@ -30,5 +30,8 @@ endif + + SUBDIRS += includes tests common omapip client dhcpctl relay server + ++SUBDIRS += tapset ++#DIST_SUBDIRS = $(SUBDIRS) ++ + nobase_include_HEADERS = dhcpctl/dhcpctl.h + +diff -up dhcp-4.2.5b1/server/dhcp.c.systemtap dhcp-4.2.5b1/server/dhcp.c +--- dhcp-4.2.5b1/server/dhcp.c.systemtap 2012-12-17 16:56:40.483882364 +0100 ++++ dhcp-4.2.5b1/server/dhcp.c 2012-12-17 16:56:40.599880842 +0100 +@@ -36,7 +36,7 @@ + #include <errno.h> + #include <limits.h> + #include <sys/time.h> +- ++#include "trace.h" + static void commit_leases_ackout(void *foo); + static void maybe_return_agent_options(struct packet *packet, + struct option_state *options); +@@ -275,6 +275,8 @@ void dhcpdiscover (packet, ms_nulltp) + dhcp_failover_state_t *peer; + #endif + ++ TRACE(DHCPD_DISCOVER_START()); ++ + find_lease (&lease, packet, packet -> shared_network, + 0, &peer_has_leases, (struct lease *)0, MDL); + +@@ -399,6 +401,8 @@ void dhcpdiscover (packet, ms_nulltp) + out: + if (lease) + lease_dereference (&lease, MDL); ++ ++ TRACE(DHCPD_DISCOVER_DONE()); + } + + void dhcprequest (packet, ms_nulltp, ip_lease) +@@ -421,6 +425,8 @@ void dhcprequest (packet, ms_nulltp, ip_ + #endif + int have_requested_addr = 0; + ++ TRACE(DHCPD_REQUEST_START()); ++ + oc = lookup_option (&dhcp_universe, packet -> options, + DHO_DHCP_REQUESTED_ADDRESS); + memset (&data, 0, sizeof data); +@@ -700,6 +706,9 @@ void dhcprequest (packet, ms_nulltp, ip_ + log_info ("%s: unknown lease %s.", msgbuf, piaddr (cip)); + + out: ++ ++ TRACE(DHCPD_REQUEST_DONE()); ++ + if (subnet) + subnet_dereference (&subnet, MDL); + if (lease) +@@ -718,6 +727,7 @@ void dhcprelease (packet, ms_nulltp) + const char *s; + char msgbuf [1024], cstr[16]; /* XXX */ + ++ TRACE(DHCPD_RELEASE_START()); + + /* DHCPRELEASE must not specify address in requested-address + option, but old protocol specs weren't explicit about this, +@@ -842,6 +852,8 @@ void dhcprelease (packet, ms_nulltp) + #endif + if (lease) + lease_dereference (&lease, MDL); ++ ++ TRACE(DHCPD_RELEASE_DONE()); + } + + void dhcpdecline (packet, ms_nulltp) +@@ -859,6 +871,8 @@ void dhcpdecline (packet, ms_nulltp) + struct option_cache *oc; + struct data_string data; + ++ TRACE(DHCPD_DECLINE_START()); ++ + /* DHCPDECLINE must specify address. */ + if (!(oc = lookup_option (&dhcp_universe, packet -> options, + DHO_DHCP_REQUESTED_ADDRESS))) +@@ -970,6 +984,8 @@ void dhcpdecline (packet, ms_nulltp) + option_state_dereference (&options, MDL); + if (lease) + lease_dereference (&lease, MDL); ++ ++ TRACE(DHCPD_DECLINE_DONE()); + } + + void dhcpinform (packet, ms_nulltp) +@@ -993,6 +1009,8 @@ void dhcpinform (packet, ms_nulltp) + struct interface_info *interface; + int result; + ++ TRACE(DHCPD_INFORM_START()); ++ + /* The client should set ciaddr to its IP address, but apparently + it's common for clients not to do this, so we'll use their IP + source address if they didn't set ciaddr. */ +@@ -1350,6 +1368,8 @@ void dhcpinform (packet, ms_nulltp) + + if (subnet) + subnet_dereference (&subnet, MDL); ++ ++ TRACE(DHCPD_INFORM_DONE()); + } + + void nak_lease (packet, cip) +@@ -1366,6 +1386,8 @@ void nak_lease (packet, cip) + struct option_state *options = (struct option_state *)0; + struct option_cache *oc = (struct option_cache *)0; + ++ TRACE(DHCPD_NAK_LEASE_START()); ++ + option_state_allocate (&options, MDL); + memset (&outgoing, 0, sizeof outgoing); + memset (&raw, 0, sizeof raw); +@@ -1532,6 +1554,7 @@ void nak_lease (packet, cip) + packet->interface->name); + } + ++ TRACE(DHCPD_NAK_LEASE_DONE()); + } + + void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) +@@ -1573,6 +1596,8 @@ void ack_lease (packet, lease, offer, wh + if (lease -> state) + return; + ++ TRACE(DHCPD_ACK_LEASE_START()); ++ + /* Save original cltt for comparison later. */ + lease_cltt = lease->cltt; + +@@ -2936,6 +2961,8 @@ void ack_lease (packet, lease, offer, wh + #endif + dhcp_reply(lease); + } ++ ++ TRACE(DHCPD_ACK_LEASE_DONE()); + } + + /* +@@ -3088,6 +3115,8 @@ void dhcp_reply (lease) + if (!state) + log_fatal ("dhcp_reply was supplied lease with no state!"); + ++ TRACE(DHCPD_REPLY_START()); ++ + /* Compose a response for the client... */ + memset (&raw, 0, sizeof raw); + memset (&d1, 0, sizeof d1); +@@ -3309,6 +3338,8 @@ void dhcp_reply (lease) + + free_lease_state (state, MDL); + lease -> state = (struct lease_state *)0; ++ ++ TRACE(DHCPD_REPLY_DONE()); + } + + int find_lease (struct lease **lp, +@@ -3331,6 +3362,8 @@ int find_lease (struct lease **lp, + struct data_string client_identifier; + struct hardware h; + ++ TRACE(DHCPD_FIND_LEASE_START()); ++ + #if defined(FAILOVER_PROTOCOL) + /* Quick check to see if the peer has leases. */ + if (peer_has_leases) { +@@ -4058,6 +4091,9 @@ int find_lease (struct lease **lp, + #if defined (DEBUG_FIND_LEASE) + log_info ("Not returning a lease."); + #endif ++ ++ TRACE(DHCPD_FIND_LEASE_DONE()); ++ + return 0; + } + +diff -up dhcp-4.2.5b1/server/dhcpd.c.systemtap dhcp-4.2.5b1/server/dhcpd.c +--- dhcp-4.2.5b1/server/dhcpd.c.systemtap 2012-12-17 16:56:40.578881119 +0100 ++++ dhcp-4.2.5b1/server/dhcpd.c 2012-12-17 16:56:40.599880842 +0100 +@@ -58,6 +58,8 @@ static const char url [] = + # undef group + #endif /* PARANOIA */ + ++#include "trace.h" ++ + #ifndef UNIT_TEST + static void usage(void); + #endif +@@ -865,6 +867,7 @@ main(int argc, char **argv) { + omapi_set_int_value ((omapi_object_t *)dhcp_control_object, + (omapi_object_t *)0, "state", server_running); + ++ TRACE(DHCPD_MAIN()); + /* Receive packets and dispatch them... */ + dispatch (); + +diff -up dhcp-4.2.5b1/server/dhcpv6.c.systemtap dhcp-4.2.5b1/server/dhcpv6.c +--- dhcp-4.2.5b1/server/dhcpv6.c.systemtap 2012-12-17 16:56:40.571881210 +0100 ++++ dhcp-4.2.5b1/server/dhcpv6.c 2012-12-17 16:56:40.601880816 +0100 +@@ -15,6 +15,7 @@ + */ + + #include "dhcpd.h" ++#include "trace.h" + + #ifdef DHCPv6 + +@@ -4212,6 +4213,8 @@ static void + dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) { + struct data_string client_id; + ++ TRACE(DHCPD_6_SOLICIT_START()); ++ + /* + * Validate our input. + */ +@@ -4225,6 +4228,8 @@ dhcpv6_solicit(struct data_string *reply + * Clean up. + */ + data_string_forget(&client_id, MDL); ++ ++ TRACE(DHCPD_6_SOLICIT_DONE()); + } + + /* +@@ -4238,6 +4243,8 @@ dhcpv6_request(struct data_string *reply + struct data_string client_id; + struct data_string server_id; + ++ TRACE(DHCPD_6_REQUEST_START()); ++ + /* + * Validate our input. + */ +@@ -4255,6 +4262,8 @@ dhcpv6_request(struct data_string *reply + */ + data_string_forget(&client_id, MDL); + data_string_forget(&server_id, MDL); ++ ++ TRACE(DHCPD_6_REQUEST_DONE()); + } + + /* Find a DHCPv6 packet's shared network from hints in the packet. +@@ -4367,6 +4376,8 @@ dhcpv6_confirm(struct data_string *reply + struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data; + int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options)); + ++ TRACE(DHCPD_6_CONFIRM_START()); ++ + /* + * Basic client message validation. + */ +@@ -4553,6 +4564,8 @@ exit: + option_state_dereference(&cli_enc_opt_state, MDL); + if (opt_state != NULL) + option_state_dereference(&opt_state, MDL); ++ ++ TRACE(DHCPD_6_CONFIRM_DONE()); + } + + /* +@@ -4567,6 +4580,8 @@ dhcpv6_renew(struct data_string *reply, + struct data_string client_id; + struct data_string server_id; + ++ TRACE(DHCPD_6_RENEW_START()); ++ + /* + * Validate the request. + */ +@@ -4584,6 +4599,8 @@ dhcpv6_renew(struct data_string *reply, + */ + data_string_forget(&server_id, MDL); + data_string_forget(&client_id, MDL); ++ ++ TRACE(DHCPD_6_RENEW_DONE()); + } + + /* +@@ -4597,6 +4614,8 @@ static void + dhcpv6_rebind(struct data_string *reply, struct packet *packet) { + struct data_string client_id; + ++ TRACE(DHCPD_6_REBIND_START()); ++ + if (!valid_client_msg(packet, &client_id)) { + return; + } +@@ -4604,6 +4623,8 @@ dhcpv6_rebind(struct data_string *reply, + lease_to_client(reply, packet, &client_id, NULL); + + data_string_forget(&client_id, MDL); ++ ++ TRACE(DHCPD_6_REBIND_DONE()); + } + + static void +@@ -5048,6 +5069,8 @@ dhcpv6_decline(struct data_string *reply + struct data_string client_id; + struct data_string server_id; + ++ TRACE(DHCPD_6_DECLINE_START()); ++ + /* + * Validate our input. + */ +@@ -5068,6 +5091,8 @@ dhcpv6_decline(struct data_string *reply + + data_string_forget(&server_id, MDL); + data_string_forget(&client_id, MDL); ++ ++ TRACE(DHCPD_6_DECLINE_DONE()); + } + + static void +@@ -5516,6 +5541,8 @@ dhcpv6_release(struct data_string *reply + struct data_string client_id; + struct data_string server_id; + ++ TRACE(DHCPD_6_RELEASE_START()); ++ + /* + * Validate our input. + */ +@@ -5537,6 +5564,8 @@ dhcpv6_release(struct data_string *reply + + data_string_forget(&server_id, MDL); + data_string_forget(&client_id, MDL); ++ ++ TRACE(DHCPD_6_RELEASE_DONE()); + } + + /* +@@ -5549,6 +5578,8 @@ dhcpv6_information_request(struct data_s + struct data_string client_id; + struct data_string server_id; + ++ TRACE(DHCPD_6_INFORMATION_REQUEST_START()); ++ + /* + * Validate our input. + */ +@@ -5580,6 +5611,8 @@ dhcpv6_information_request(struct data_s + data_string_forget(&client_id, MDL); + } + data_string_forget(&server_id, MDL); ++ ++ TRACE(DHCPD_6_INFORMATION_REQUEST_DONE()); + } + + /* +@@ -5608,6 +5641,8 @@ dhcpv6_relay_forw(struct data_string *re + struct dhcpv6_relay_packet *reply; + int reply_ofs; + ++ TRACE(DHCPD_6_RELAY_FORW_START()); ++ + /* + * Initialize variables for early exit. + */ +@@ -5867,6 +5902,8 @@ exit: + if (enc_packet != NULL) { + packet_dereference(&enc_packet, MDL); + } ++ ++ TRACE(DHCPD_6_RELAY_FORW_DONE()); + } + + static void +diff -up dhcp-4.2.5b1/server/failover.c.systemtap dhcp-4.2.5b1/server/failover.c +--- dhcp-4.2.5b1/server/failover.c.systemtap 2012-12-05 02:17:39.000000000 +0100 ++++ dhcp-4.2.5b1/server/failover.c 2012-12-17 16:56:40.603880790 +0100 +@@ -36,6 +36,8 @@ + #include "dhcpd.h" + #include <omapip/omapip_p.h> + ++#include "trace.h" ++ + #if defined (FAILOVER_PROTOCOL) + dhcp_failover_state_t *failover_states; + static isc_result_t do_a_failover_option (omapi_object_t *, +@@ -1712,6 +1714,8 @@ isc_result_t dhcp_failover_set_state (dh + struct lease *l; + struct timeval tv; + ++ TRACE(DHCPD_FAILOVER_SET_STATE_START(state->me.state, new_state)); ++ + /* If we're in certain states where we're sending updates, and the peer + * state changes, we need to re-schedule any pending updates just to + * be on the safe side. This results in retransmission. +@@ -1939,6 +1943,8 @@ isc_result_t dhcp_failover_set_state (dh + break; + } + ++ TRACE(DHCPD_FAILOVER_SET_STATE_DONE()); ++ + return ISC_R_SUCCESS; + } + +@@ -2422,6 +2428,8 @@ dhcp_failover_pool_dobalance(dhcp_failov + if (state -> me.state != normal) + return 0; + ++ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_START()); ++ + state->last_balance = cur_time; + + for (s = shared_networks ; s ; s = s->next) { +@@ -2582,6 +2590,8 @@ dhcp_failover_pool_dobalance(dhcp_failov + if (leases_queued) + commit_leases(); + ++ TRACE(DHCPD_FAILOVER_POOL_DOBALANCE_DONE()); ++ + return leases_queued; + } + +diff -up dhcp-4.2.5b1/server/Makefile.am.systemtap dhcp-4.2.5b1/server/Makefile.am +--- dhcp-4.2.5b1/server/Makefile.am.systemtap 2012-12-17 16:56:40.563881316 +0100 ++++ dhcp-4.2.5b1/server/Makefile.am 2012-12-17 16:56:40.603880790 +0100 +@@ -10,7 +10,7 @@ dist_sysconf_DATA = dhcpd.conf.example + sbin_PROGRAMS = dhcpd + dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \ + omapi.c mdb.c stables.c salloc.c ddns.c dhcpleasequery.c \ +- dhcpv6.c mdb6.c ldap.c ldap_casa.c ++ dhcpv6.c mdb6.c ldap.c ldap_casa.c probes.d trace.h + + dhcpd_CFLAGS = $(LDAP_CFLAGS) + dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \ +@@ -19,3 +19,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma + man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 + EXTRA_DIST = $(man_MANS) + ++if ENABLE_SYSTEMTAP ++BUILT_SOURCES = probes.h ++probes.h: probes.d ++ $(DTRACE) -C -h -s $< -o $@ ++ ++probes.o: probes.d ++ $(DTRACE) -C -G -s $< -o $@ ++ ++dhcpd_LDADD += probes.o ++endif +diff -up dhcp-4.2.5b1/server/probes.d.systemtap dhcp-4.2.5b1/server/probes.d +--- dhcp-4.2.5b1/server/probes.d.systemtap 2012-12-17 16:56:40.603880790 +0100 ++++ dhcp-4.2.5b1/server/probes.d 2012-12-17 16:56:40.603880790 +0100 +@@ -0,0 +1,43 @@ ++provider dhcpd { ++ probe main(); ++ probe discover_start() ++ probe discover_done() ++ probe request_start() ++ probe request_done() ++ probe release_start() ++ probe release_done() ++ probe decline_start() ++ probe decline_done() ++ probe inform_start() ++ probe inform_done() ++ probe nak_lease_start() ++ probe nak_lease_done() ++ probe ack_lease_start() ++ probe ack_lease_done() ++ probe reply_start() ++ probe reply_done() ++ probe find_lease_start() ++ probe find_lease_done() ++ probe 6_solicit_start() ++ probe 6_solicit_done() ++ probe 6_request_start() ++ probe 6_request_done() ++ probe 6_confirm_start() ++ probe 6_confirm_done() ++ probe 6_renew_start() ++ probe 6_renew_done() ++ probe 6_rebind_start() ++ probe 6_rebind_done() ++ probe 6_decline_start() ++ probe 6_decline_done() ++ probe 6_release_start() ++ probe 6_release_done() ++ probe 6_information_request_start() ++ probe 6_information_request_done() ++ probe 6_relay_forw_start() ++ probe 6_relay_forw_done() ++ probe failover_pool_dobalance_start() ++ probe failover_pool_dobalance_done() ++ probe failover_set_state_start(int, int) /* state, new_state */ ++ probe failover_set_state_done() ++}; +diff -up dhcp-4.2.5b1/server/tests/Makefile.am.systemtap dhcp-4.2.5b1/server/tests/Makefile.am +--- dhcp-4.2.5b1/server/tests/Makefile.am.systemtap 2012-12-17 16:56:40.564881302 +0100 ++++ dhcp-4.2.5b1/server/tests/Makefile.am 2012-12-17 16:56:57.505650518 +0100 +@@ -20,6 +20,10 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpa + DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \ + $(top_builddir)/dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export + ++if ENABLE_SYSTEMTAP ++DHCPLIBS += ../probes.o ++endif ++ + ATF_TESTS = + TESTS = + if HAVE_ATF +diff -up dhcp-4.2.5b1/server/trace.h.systemtap dhcp-4.2.5b1/server/trace.h +--- dhcp-4.2.5b1/server/trace.h.systemtap 2012-12-17 16:56:40.604880777 +0100 ++++ dhcp-4.2.5b1/server/trace.h 2012-12-17 16:56:40.604880777 +0100 +@@ -0,0 +1,11 @@ ++// trace.h ++ ++#include "config.h" ++#ifdef HAVE_SYSTEMTAP ++// include the generated probes header and put markers in code ++#include "probes.h" ++#define TRACE(probe) probe ++#else ++// Wrap the probe to allow it to be removed when no systemtap available ++#define TRACE(probe) ++#endif +diff -up dhcp-4.2.5b1/tapset/dhcpd.stp.systemtap dhcp-4.2.5b1/tapset/dhcpd.stp +--- dhcp-4.2.5b1/tapset/dhcpd.stp.systemtap 2012-12-17 16:56:40.604880777 +0100 ++++ dhcp-4.2.5b1/tapset/dhcpd.stp 2012-12-17 16:56:40.604880777 +0100 +@@ -0,0 +1,212 @@ ++/* dhcpd tapset ++ Copyright (C) 2011, Red Hat Inc. ++ */ ++ ++probe dhcpd_main = process("dhcpd").mark("main") ++{ ++ probestr = sprintf("%s(locals: %s)", $$name, $$locals); ++ ++} ++ ++probe dhcpd_discover_start = process("dhcpd").mark("discover_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_discover_done = process("dhcpd").mark("discover_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_request_start = process("dhcpd").mark("request_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_request_done = process("dhcpd").mark("request_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_release_start = process("dhcpd").mark("release_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_release_done = process("dhcpd").mark("release_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_decline_start = process("dhcpd").mark("decline_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_decline_done = process("dhcpd").mark("decline_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_inform_start = process("dhcpd").mark("inform_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_inform_done = process("dhcpd").mark("inform_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_nak_lease_start = process("dhcpd").mark("nak_lease_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_nak_lease_done = process("dhcpd").mark("nak_lease_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_ack_lease_start = process("dhcpd").mark("ack_lease_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_ack_lease_done = process("dhcpd").mark("ack_lease_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_reply_start = process("dhcpd").mark("reply_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_reply_done = process("dhcpd").mark("reply_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_find_lease_start = process("dhcpd").mark("find_lease_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_find_lease_done = process("dhcpd").mark("find_lease_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_solicit_start = process("dhcpd").mark("6_solicit_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_solicit_done = process("dhcpd").mark("6_solicit_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_request_start = process("dhcpd").mark("6_request_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_request_done = process("dhcpd").mark("6_request_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_confirm_start = process("dhcpd").mark("6_confirm_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_confirm_done = process("dhcpd").mark("6_confirm_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_renew_start = process("dhcpd").mark("6_renew_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_renew_done = process("dhcpd").mark("6_renew_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_rebind_start = process("dhcpd").mark("6_rebind_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_rebind_done = process("dhcpd").mark("6_rebind_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_decline_start = process("dhcpd").mark("6_decline_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_decline_done = process("dhcpd").mark("6_decline_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_release_start = process("dhcpd").mark("6_release_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_release_done = process("dhcpd").mark("6_release_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_information_request_start = process("dhcpd").mark("6_information_request_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_information_request_done = process("dhcpd").mark("6_information_request_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_relay_forw_start = process("dhcpd").mark("6_relay_forw_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_6_relay_forw_done = process("dhcpd").mark("6_relay_forw_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_failover_pool_dobalance_start = process("dhcpd").mark("failover_pool_dobalance_start") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++probe dhcpd_failover_pool_dobalance_done = process("dhcpd").mark("failover_pool_dobalance_done") ++{ ++ probestr = sprintf("%s", $$name); ++} ++ ++ ++probe dhcpd_failover_set_state_start = process("dhcpd").mark("failover_set_state_start") ++{ ++ state = $arg1; ++ new_state = $arg2; ++ probestr = sprintf("%s(state=%d, new_state=%d)", $$name, state, new_state); ++} ++ ++probe dhcpd_failover_set_state_done = process("dhcpd").mark("failover_set_state_done") ++{ ++ probestr = sprintf("%s", $$name); ++} +diff -up dhcp-4.2.5b1/tapset/Makefile.am.systemtap dhcp-4.2.5b1/tapset/Makefile.am +--- dhcp-4.2.5b1/tapset/Makefile.am.systemtap 2012-12-17 16:56:40.604880777 +0100 ++++ dhcp-4.2.5b1/tapset/Makefile.am 2012-12-17 16:56:40.604880777 +0100 +@@ -0,0 +1,26 @@ ++# Makefile.am for dhcp/tapset ++# Jiri Popelka ++ ++.PHONY: clean-local install-data-hook uninstall-local ++ ++# ++EXTRA_DIST = dhcpd.stp ++TAPSET_FILES = $(EXTRA_DIST) ++TAPSET_INSTALL_DIR = $(DESTDIR)@ABS_TAPSET_DIR@ ++ ++if ENABLE_SYSTEMTAP ++all-local: $(TAPSET_FILES) ++ ++clean-local: ++ ++install-data-hook: ++ $(MKDIR_P) $(TAPSET_INSTALL_DIR) ++ $(INSTALL_DATA) $(TAPSET_FILES) $(TAPSET_INSTALL_DIR) ++ ++uninstall-local: ++ @list='$(TAPSET_FILES)'; for p in $$list; do \ ++ echo " rm -f '$(TAPSET_INSTALL_DIR)/$$p'"; \ ++ rm -f "$(TAPSET_INSTALL_DIR)/$$p"; \ ++ done ++endif ++ diff --git a/dhcp/patches/dhcp-4.2.5b1-atf-pkgconfig.patch b/dhcp/patches/dhcp-4.2.5b1-atf-pkgconfig.patch new file mode 100644 index 0000000..73f1f55 --- /dev/null +++ b/dhcp/patches/dhcp-4.2.5b1-atf-pkgconfig.patch @@ -0,0 +1,23 @@ +diff -up dhcp-4.2.5b1/configure.ac.pkgconfig dhcp-4.2.5b1/configure.ac +--- dhcp-4.2.5b1/configure.ac.pkgconfig 2012-12-05 02:18:44.000000000 +0100 ++++ dhcp-4.2.5b1/configure.ac 2012-12-17 15:45:33.769128387 +0100 +@@ -194,6 +194,9 @@ if test "$atf_path" != "no" ; then + if test -f $atf_path/lib/pkgconfig/atf-c.pc ; then + atf_pcp=$atf_path/lib/pkgconfig + fi ++ if test -f $atf_path/lib64/pkgconfig/atf-c.pc ; then ++ atf_pcp=$atf_path/lib64/pkgconfig ++ fi + else + # Not specified, try some common paths + atf_dirs="/usr /usr/local /usr/pkg /opt /opt/local" +@@ -202,6 +205,9 @@ if test "$atf_path" != "no" ; then + if test -f $d/lib/pkgconfig/atf-c.pc ; then + atf_pcp=$d/lib/pkgconfig + fi ++ if test -f $d/lib64/pkgconfig/atf-c.pc ; then ++ atf_pcp=$d/lib64/pkgconfig ++ fi + done + fi + if test "$atf_pcp" = "" ; then diff --git a/iproute2/iproute2.nm b/iproute2/iproute2.nm index c466ebc..03da2ce 100644 --- a/iproute2/iproute2.nm +++ b/iproute2/iproute2.nm @@ -5,7 +5,7 @@
name = iproute2 version = 3.5.1 -release = 2 +release = 3
groups = Networking/Tools url = http://www.linuxfoundation.org/en/Net:Iproute2 @@ -28,7 +28,7 @@ build flex libnl-devel linux-atm-devel >= 2.5.1 - iptables-devel + iptables-devel >= 1.4.19 end
prepare_cmds diff --git a/iptables/iptables.nm b/iptables/iptables.nm index 3ec7773..0350b17 100644 --- a/iptables/iptables.nm +++ b/iptables/iptables.nm @@ -4,7 +4,7 @@ ###############################################################################
name = iptables -version = 1.4.17 +version = 1.4.19.1 release = 1
groups = Networking/Tools diff --git a/keepalived/keepalived.nm b/keepalived/keepalived.nm index 8c825a3..1220727 100644 --- a/keepalived/keepalived.nm +++ b/keepalived/keepalived.nm @@ -4,8 +4,8 @@ ###############################################################################
name = keepalived -version = 1.2.2 -release = 2 +version = 1.2.7 +release = 1
groups = Applications/System url = http://www.keepalived.org/ @@ -29,15 +29,16 @@ source_dl = http://www.keepalived.org/software/
build requires + kernel-devel + net-snmp-devel >= 5.7.2-2 libnl-devel openssl-devel popt-devel end
configure_options += \ - --sysconfdir=/etc - -# --with-kernel-dir=$(ls -1d --sort t /lib/modules/*/build | head 1) + --enable-snmp \ + --enable-vrrp
make_targets += STRIP=/bin/true
diff --git a/keepalived/patches/keepalived-1.1.14-installmodules.patch b/keepalived/patches/keepalived-1.1.14-installmodules.patch deleted file mode 100644 index a5fc93c..0000000 --- a/keepalived/patches/keepalived-1.1.14-installmodules.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Naupr keepalived-1.1.14.orig/keepalived/Makefile.in keepalived-1.1.14/keepalived/Makefile.in ---- keepalived-1.1.14.orig/keepalived/Makefile.in 2007-09-13 15:44:39.000000000 +0200 -+++ keepalived-1.1.14/keepalived/Makefile.in 2007-09-14 12:38:43.000000000 +0200 -@@ -99,13 +99,13 @@ uninstall: - - install: - install -d $(DESTDIR)$(sbindir) -- install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/ -+ install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/ - install -d $(DESTDIR)$(init_dir) - install -m 755 etc/init.d/keepalived.init $(DESTDIR)$(init_dir)/keepalived - install -d $(DESTDIR)$(sysconf_dir) -- install -m 755 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived -+ install -m 644 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived - install -d $(DESTDIR)$(sysconfdir)/keepalived/samples -- install -m 644 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/ -+ install -m 640 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/ - install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/ - install -d $(DESTDIR)$(mandir)/man5 - install -d $(DESTDIR)$(mandir)/man8 diff --git a/keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch b/keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch deleted file mode 100644 index 912914b..0000000 --- a/keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naupr keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c keepalived-1.1.19/keepalived/check/ipvswrapper.c ---- keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c 2009-09-28 13:03:40.000000000 +0200 -+++ keepalived-1.1.19/keepalived/check/ipvswrapper.c 2009-11-24 22:41:56.220195007 +0100 -@@ -789,7 +789,7 @@ string_to_number(const char *s, int min, - static int - modprobe_ipvs(void) - { -- char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL }; -+ char *argv[] = { "/sbin/modprobe", "-s", "--", "ip_vs", NULL }; - int child; - int status; - int rc; diff --git a/keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch b/keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch deleted file mode 100644 index 468fc0e..0000000 --- a/keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up keepalived-1.2.2/configure.pathfix keepalived-1.2.2/configure ---- keepalived-1.2.2/configure.pathfix 2011-09-19 12:31:19.615258629 -0400 -+++ keepalived-1.2.2/configure 2011-09-19 12:31:38.872000057 -0400 -@@ -3973,7 +3973,7 @@ $as_echo "$as_me: WARNING: Cannot determ - - IPVS_SUPPORT="_WITHOUT_LVS_" - if test "$enable_lvs" != "no"; then -- ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default" -+ ac_fn_c_check_header_mongrel "$LINENO" "linux/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default" - if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then : - IPVS_SUPPORT="_WITH_LVS_" - else diff --git a/keepalived/patches/keepalived-1.2.7-dont-respawn-children.patch b/keepalived/patches/keepalived-1.2.7-dont-respawn-children.patch new file mode 100644 index 0000000..f03df93 --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-dont-respawn-children.patch @@ -0,0 +1,109 @@ +From 12e58a6c40b3bfa18f0db5db9e36ed09f68d7a0c Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 29 Oct 2012 14:10:57 -0500 +Subject: [PATCH 01/10] Add option to prevent respawn of child processes. + +This patch adds a command-line option (--dont-respawn, -R) that will +prevent the child processes from respawning. When this option is +specified, if either the checker or vrrp child processes exit the +parent process will raise the SIGTERM signal and exit. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/check/check_daemon.c | 9 +++++++-- + keepalived/core/main.c | 10 +++++++++- + keepalived/vrrp/vrrp_daemon.c | 9 +++++++-- + 3 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/keepalived/check/check_daemon.c b/keepalived/check/check_daemon.c +index 1119075..68759f4 100644 +--- a/keepalived/check/check_daemon.c ++++ b/keepalived/check/check_daemon.c +@@ -227,8 +227,13 @@ check_respawn_thread(thread_t * thread) + } + + /* We catch a SIGCHLD, handle it */ +- log_message(LOG_ALERT, "Healthcheck child process(%d) died: Respawning", pid); +- start_check_child(); ++ if (!(debug & 64)) { ++ log_message(LOG_ALERT, "Healthcheck child process(%d) died: Respawning", pid); ++ start_check_child(); ++ } else { ++ log_message(LOG_ALERT, "Healthcheck child process(%d) died: Exiting", pid); ++ raise(SIGTERM); ++ } + return 0; + } + +diff --git a/keepalived/core/main.c b/keepalived/core/main.c +index 57fa134..9445a4c 100644 +--- a/keepalived/core/main.c ++++ b/keepalived/core/main.c +@@ -146,6 +146,7 @@ usage(const char *prog) + " %s --check -C Only run with Health-checker subsystem.\n" + " %s --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.\n" + " %s --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.\n" ++ " %s --dont-respawn -R Dont respawn child processes.\n" + " %s --dont-fork -n Dont fork the daemon process.\n" + " %s --use-file -f Use the specified configuration file.\n" + " Default is /etc/keepalived/keepalived.conf.\n" +@@ -165,7 +166,7 @@ usage(const char *prog) + #ifdef _WITH_SNMP_ + prog, + #endif +- prog, prog, prog, prog, prog, prog, prog); ++ prog, prog, prog, prog, prog, prog, prog, prog); + } + + /* Command line parser */ +@@ -184,6 +185,7 @@ parse_cmdline(int argc, char **argv) + {"log-facility", 'S', POPT_ARG_STRING, &option_arg, 'S'}, + {"dont-release-vrrp", 'V', POPT_ARG_NONE, NULL, 'V'}, + {"dont-release-ipvs", 'I', POPT_ARG_NONE, NULL, 'I'}, ++ {"dont-respawn", 'R', POPT_ARG_NONE, NULL, 'R'}, + {"dont-fork", 'n', POPT_ARG_NONE, NULL, 'n'}, + {"dump-conf", 'd', POPT_ARG_NONE, NULL, 'd'}, + {"use-file", 'f', POPT_ARG_STRING, &option_arg, 'f'}, +@@ -232,6 +234,9 @@ parse_cmdline(int argc, char **argv) + case 'D': + debug |= 32; + break; ++ case 'R': ++ debug |= 64; ++ break; + case 'S': + log_facility = LOG_FACILITY[atoi(option_arg)].facility; + break; +@@ -282,6 +287,9 @@ parse_cmdline(int argc, char **argv) + case 'D': + debug |= 32; + break; ++ case 'R': ++ debug |= 64; ++ break; + case 'S': + log_facility = LOG_FACILITY[atoi(option_arg)].facility; + break; +diff --git a/keepalived/vrrp/vrrp_daemon.c b/keepalived/vrrp/vrrp_daemon.c +index 23ff09f..cee6c80 100644 +--- a/keepalived/vrrp/vrrp_daemon.c ++++ b/keepalived/vrrp/vrrp_daemon.c +@@ -249,8 +249,13 @@ vrrp_respawn_thread(thread_t * thread) + } + + /* We catch a SIGCHLD, handle it */ +- log_message(LOG_ALERT, "VRRP child process(%d) died: Respawning", pid); +- start_vrrp_child(); ++ if (!(debug & 64)) { ++ log_message(LOG_ALERT, "VRRP child process(%d) died: Respawning", pid); ++ start_vrrp_child(); ++ } else { ++ log_message(LOG_ALERT, "VRRP child process(%d) died: Exiting", pid); ++ raise(SIGTERM); ++ } + return 0; + } + +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-fix-error-message.patch b/keepalived/patches/keepalived-1.2.7-fix-error-message.patch new file mode 100644 index 0000000..b6f19be --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-fix-error-message.patch @@ -0,0 +1,40 @@ +From c04dfcae58d6449980e38ed5a555d1a86f363f71 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 19 Nov 2012 10:09:11 -0600 +Subject: [PATCH 07/10] Fix typo in error messages. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/vrrp/vrrp_ipaddress.c | 2 +- + keepalived/vrrp/vrrp_iproute.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/keepalived/vrrp/vrrp_ipaddress.c b/keepalived/vrrp/vrrp_ipaddress.c +index c003b1a..51cd488 100644 +--- a/keepalived/vrrp/vrrp_ipaddress.c ++++ b/keepalived/vrrp/vrrp_ipaddress.c +@@ -165,7 +165,7 @@ alloc_ipaddress(list ip_list, vector_t *strvec, interface *ifp) + ifp_local = if_get_by_ifname(vector_slot(strvec, ++i)); + if (!ifp_local) { + log_message(LOG_INFO, "VRRP is trying to assign VIP to unknown %s" +- " interface !!! go out and fixe your conf !!!", ++ " interface !!! go out and fix your conf !!!", + (char *)vector_slot(strvec, i)); + FREE(new); + return; +diff --git a/keepalived/vrrp/vrrp_iproute.c b/keepalived/vrrp/vrrp_iproute.c +index a8feec4..464259c 100644 +--- a/keepalived/vrrp/vrrp_iproute.c ++++ b/keepalived/vrrp/vrrp_iproute.c +@@ -203,7 +203,7 @@ alloc_route(list rt_list, vector_t *strvec) + ifp = if_get_by_ifname(vector_slot(strvec, ++i)); + if (!ifp) { + log_message(LOG_INFO, "VRRP is trying to assign VROUTE to unknown " +- "%s interface !!! go out and fixe your conf !!!", ++ "%s interface !!! go out and fix your conf !!!", + (char *)vector_slot(strvec, i)); + FREE(new); + return; +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-fix-pointer-arithmetic-vrrp-packet.patch b/keepalived/patches/keepalived-1.2.7-fix-pointer-arithmetic-vrrp-packet.patch new file mode 100644 index 0000000..c4f942e --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-fix-pointer-arithmetic-vrrp-packet.patch @@ -0,0 +1,32 @@ +From f9264a16d6a651a15731ba43d917f0b311257d47 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Fri, 16 Nov 2012 14:54:37 -0600 +Subject: [PATCH 05/10] Fix pointer arithmetic for VRRP packet + +When using IPSEC AH authentication, the pointer arithmetic used to get +the location of the VRRP packet is incorrect. The address of the IPSEC +header must be cast as (char *) in order to get correct address of the +VRRP packet. Without this patch, vrrp_in_chk() will fail to verify +incoming VRRP packets when IPSEC AH is enabled. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/vrrp/vrrp.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c +index 1248fb8..0a8bc3f 100644 +--- a/keepalived/vrrp/vrrp.c ++++ b/keepalived/vrrp/vrrp.c +@@ -238,7 +238,7 @@ vrrp_in_chk(vrrp_rt * vrrp, char *buffer) + + if (vrrp->auth_type == VRRP_AUTH_AH) { + ah = (ipsec_ah *) (buffer + ihl); +- hd = (vrrp_pkt *) (ah + vrrp_ipsecah_len()); ++ hd = (vrrp_pkt *) ((char *) ah + vrrp_ipsecah_len()); + } else { + hd = (vrrp_pkt *) (buffer + ihl); + } +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-fix-primary-ip-address-comparison.patch b/keepalived/patches/keepalived-1.2.7-fix-primary-ip-address-comparison.patch new file mode 100644 index 0000000..f2743ec --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-fix-primary-ip-address-comparison.patch @@ -0,0 +1,34 @@ +From 6e52cb884e3cab75ca5597b59027a11d982593ab Mon Sep 17 00:00:00 2001 +From: Boon Ang boon.s.ang@gmail.com +Date: Thu, 6 Dec 2012 11:01:55 -0600 +Subject: [PATCH 09/10] Fix comparison of primary IP addresses. + +If a router in the master state receives an advertisement with +priority equal to the local priority, it must also compare the primary +IP addresses (RFC 3768, section 6.4.3). The code to handle this was +comparing two IP addresses with different byte-ordering, resulting in +multiple routers in the master state. This patches resolves the +problem by coverting the local primary IP address to network byte +order for the comparison. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/vrrp/vrrp.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c +index 0a8bc3f..a88deb3 100644 +--- a/keepalived/vrrp/vrrp.c ++++ b/keepalived/vrrp/vrrp.c +@@ -923,7 +923,7 @@ vrrp_state_master_rx(vrrp_rt * vrrp, char *buf, int buflen) + } else if (vrrp->family == AF_INET) { + if (hd->priority > vrrp->effective_priority || + (hd->priority == vrrp->effective_priority && +- ntohl(saddr) > VRRP_PKT_SADDR(vrrp))) { ++ ntohl(saddr) > ntohl(VRRP_PKT_SADDR(vrrp)))) { + log_message(LOG_INFO, "VRRP_Instance(%s) Received higher prio advert" + , vrrp->iname); + if (proto == IPPROTO_IPSEC_AH) { +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-fix-ssl-certificate-load.patch b/keepalived/patches/keepalived-1.2.7-fix-ssl-certificate-load.patch new file mode 100644 index 0000000..8251d89 --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-fix-ssl-certificate-load.patch @@ -0,0 +1,34 @@ +From 3cc70656961f0384b1db030e0697a00af0b30e65 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 19 Nov 2012 09:51:50 -0600 +Subject: [PATCH 06/10] Load SSL certificate correctly. + +This patch fixes a problem where keepalived will attempt to load an +SSL keyfile as a certificate, resulting in failure to initialize SSL +context. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/check/check_ssl.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/keepalived/check/check_ssl.c b/keepalived/check/check_ssl.c +index 618d9a4..574ba30 100644 +--- a/keepalived/check/check_ssl.c ++++ b/keepalived/check/check_ssl.c +@@ -86,10 +86,10 @@ build_ssl_ctx(void) + } + + /* Load our keys and certificates */ +- if (check_data->ssl->keyfile) ++ if (check_data->ssl->certfile) + if (! + (SSL_CTX_use_certificate_chain_file +- (ssl->ctx, check_data->ssl->keyfile))) { ++ (ssl->ctx, check_data->ssl->certfile))) { + log_message(LOG_INFO, + "SSL error : Cant load certificate file..."); + return 0; +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-remove-debug-messages.patch b/keepalived/patches/keepalived-1.2.7-remove-debug-messages.patch new file mode 100644 index 0000000..87cc85a --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-remove-debug-messages.patch @@ -0,0 +1,46 @@ +From fd8665b424457accfa37703d4c9456be22ab8b53 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 10 Dec 2012 13:25:01 -0600 +Subject: [PATCH 10/10] Remove log_message calls from if_get_by_ifname. + +The if_get_by_ifname function would log a message if either the +if_queue list was empty or if the interface name was not present in +the list. Since if_get_by_ifname is called to check for the existence +of an interface before adding it to the list, the "No such interface" +message is logged whenever adding a new interface to this list. This +is normal but can be confusing. Since if_get_by_ifname returns NULL +when the interface does not exist, the caller should be responsible +for logging any error messages. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + keepalived/vrrp/vrrp_if.c | 6 +----- + 1 files changed, 1 insertions(+), 5 deletions(-) + +diff --git a/keepalived/vrrp/vrrp_if.c b/keepalived/vrrp/vrrp_if.c +index df38d9d..6d5735e 100644 +--- a/keepalived/vrrp/vrrp_if.c ++++ b/keepalived/vrrp/vrrp_if.c +@@ -85,18 +85,14 @@ if_get_by_ifname(const char *ifname) + interface *ifp; + element e; + +- if (LIST_ISEMPTY(if_queue)) { +- log_message(LOG_ERR, "Interface queue is empty"); ++ if (LIST_ISEMPTY(if_queue)) + return NULL; +- } + + for (e = LIST_HEAD(if_queue); e; ELEMENT_NEXT(e)) { + ifp = ELEMENT_DATA(e); + if (!strcmp(ifp->ifname, ifname)) + return ifp; + } +- +- log_message(LOG_ERR, "No such interface, %s", ifname); + return NULL; + } + +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-update-gpl-license.patch b/keepalived/patches/keepalived-1.2.7-update-gpl-license.patch new file mode 100644 index 0000000..a4eae91 --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-update-gpl-license.patch @@ -0,0 +1,146 @@ +From a6630f9e2e9d05261a5a6b880c5d452bc49e9808 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 19 Nov 2012 10:28:40 -0600 +Subject: [PATCH 08/10] Update GPLv2 license. + +This GPLv2 license found in COPYING had a couple errors, including an +incorrect address for the Free Software Foundation. This patch updates +the GPLv2 license to match the license that can be found at: +http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + COPYING | 42 +++++++++++++++++++++--------------------- + 1 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/COPYING b/COPYING +index a43ea21..d159169 100644 +--- a/COPYING ++++ b/COPYING +@@ -1,12 +1,12 @@ +- GNU GENERAL PUBLIC LICENSE +- Version 2, June 1991 ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 + +- Copyright (C) 1989, 1991 Free Software Foundation, Inc. +- 675 Mass Ave, Cambridge, MA 02139, USA ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +- Preamble ++ Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public +@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by +-the GNU Library General Public License instead.) You can apply it to ++the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not +@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. +- +- GNU GENERAL PUBLIC LICENSE ++ ++ GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) +- ++ + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in +@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. +- ++ + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is +@@ -225,7 +225,7 @@ impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. +- ++ + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License +@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + +- NO WARRANTY ++ NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + +- END OF TERMS AND CONDITIONS +- +- Appendix: How to Apply These Terms to Your New Programs ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it +@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> +- Copyright (C) 19yy <name of author> ++ Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +- You should have received a copy of the GNU General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ You should have received a copy of the GNU General Public License along ++ with this program; if not, write to the Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + +- Gnomovision version 69, Copyright (C) 19yy name of author ++ Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. +@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names: + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the +-library. If this is what you want to do, use the GNU Library General ++library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. +-- +1.7.1 + diff --git a/keepalived/patches/keepalived-1.2.7-update-keepalived-man-page.patch b/keepalived/patches/keepalived-1.2.7-update-keepalived-man-page.patch new file mode 100644 index 0000000..a69e078 --- /dev/null +++ b/keepalived/patches/keepalived-1.2.7-update-keepalived-man-page.patch @@ -0,0 +1,201 @@ +From 3a0a8643450bf9be6920ae857c03377102fdfd40 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara rohara@redhat.com +Date: Mon, 5 Nov 2012 11:28:21 -0600 +Subject: [PATCH 04/10] Update keepalived man page + +The keepalived(8) was out-of-date and, in some cases, inaccurate. This +patch provides a complete rewrite of the keepalived(8) man page. This +includes updated synopsis, description, and options. + +Signed-off-by: Ryan O'Hara rohara@redhat.com +--- + doc/man/man8/keepalived.8 | 179 ++++++++++++++++++++++++++------------------- + 1 files changed, 104 insertions(+), 75 deletions(-) + +diff --git a/doc/man/man8/keepalived.8 b/doc/man/man8/keepalived.8 +index 861045a..94c366a 100644 +--- a/doc/man/man8/keepalived.8 ++++ b/doc/man/man8/keepalived.8 +@@ -1,75 +1,104 @@ +-." +-." keepalived(8) +-." +-." Copyright (C) 2004 Joseph Mack +-.TH keepalived 8 "Jan 2004" +-.SH NAME +-keepalived. - keepalive demon +-.SH SYNOPSIS +-.B "/usr/sbin/keepalived [-n] [-f keepalived.conf] [-d] [-h] [-v]" +-.SH DESCRIPTION +-The +-.B keepalived +-The keepalived server implements the vrrpd routing demon +-which enables routing failover for a pair (or set) of routers +-(or LVS directors) +-and the keepalived demon which sets up and does the health checking +-of virtual services in a Linux Virtual Servier. +-.SH OPTIONS +-.TP +-.B --vrrp, -P +-Only run the VRRP subsystem. +-.TP +-.B --check, -C +-Only run the healthchecker subsystem. +-.TP +-.B --dont-release-vrrp, -V +-leave (don't remove) VRRP VIPs & VROUTEs on daemon stop. +-.TP +---dont-release-ipvs, -I +-Dont remove IPVS topology on daemon stop. +-.TP +---dont-fork, -n +-Dont fork the daemon process. +-.TP +---use-file, -f keepalived.conf_file +-Use the specified configuration file. +-.TP +---wdog-vrrp, -R +-Define VRRP watchdog polling delay (default=5s) +-.TP +---wdog-check, -H +-Define healthchecker's watchdog polling delay (default=5s) +-.TP +---dump-conf, -d +-Dump the configuration data. +-.TP +---log-console, -l +-Log messages to local console. +-.TP +---log-detail, -D +-Detailed log messages (the default with the rc script provided). +-.TP +---log-facility, -S +-0-7 Set syslog facility to LOG_LOCAL[0-7] (default=LOG_DAEMON) +-.TP +---snmp, -x +-Enable SNMP support +-.TP +---help, -h +-Display a short inlined help screen. +-.TP +---version, -v +-Display the version number. +- +-.SH FILES +-.BR /etc/keepalived/keepalived.conf +-.SH SEE ALSO +-.BR keepalived.conf(5) +-.SH AUTHORS +-.br +-Joseph Mack +-.br +-from inspection of the output of +-.I keepalived --help +-from keepalived-1.1.4 ++.TH KEEPALIVED "8" "November 2012" ++ ++.na ++.nh ++ ++.SH "NAME" ++keepalived - load-balancing and high-availability service ++ ++.SH "SYNOPSIS" ++\fBkeepalived\fP ++[\fB-f\fP|\fB--use-file\fP=FILE] ++[\fB-P\fP|\fB--vrrp\fP] ++[\fB-C\fP|\fB--check\fP] ++[\fB-l\fP|\fB--log-console\fP] ++[\fB-D\fP|\fB--log-detail\fP] ++[\fB-S\fP|\fB--log-facility\fP={0-7}] ++[\fB-V\fP|\fB--dont-release-vrrp\fP] ++[\fB-I\fP|\fB--dont-release-ipvs\fP] ++[\fB-R\fP|\fB--dont-respawn\fP] ++[\fB-n\fP|\fB--dont-fork\fP] ++[\fB-d\fP|\fB--dump-conf\fP] ++[\fB-p\fP|\fB--pid\fP=FILE] ++[\fB-r\fP|\fB--vrrp_pid\fP=FILE] ++[\fB-c\fP|\fB--checkers_pid\fP=FILE] ++[\fB-v\fP|\fB--version\fP] ++[\fB-h\fP|\fB--help\fP] ++ ++.SH "DESCRIPTION" ++Keepalived provides simple and robust facilities for load-balancing ++and high-availability. The load-balancing framework relies on ++well-known and widely used Linux Virtual Server (IPVS) kernel module ++providing Layer4 load-balancing. Keepalived implements a set of ++checkers to dynamically and adaptively maintain and manage ++load-balanced server pool according their health. Keepalived also ++implements the VRRPv2 protocol to achieve high-availability with ++director failover. ++ ++.SH "OPTIONS" ++.TP ++\fB -f, --use-file\fP=FILE ++Use the specified configuration file. The default configuration file ++is "/etc/keepalived/keepalived.conf". ++.TP ++\fB -P, --vrrp\fP ++Only run the VRRP subsystem. This is useful for configurations that do ++not use IPVS load balancer. ++.TP ++\fB -C, --check\fP ++Only run the healthcheck subsystem. This is useful for configurations ++that use the IPVS load balancer with a single director with no failover. ++.TP ++\fB -l, --log-console\fP ++Log messages to the local console. The default behavior is to log ++messages to syslog. ++.TP ++\fB -D, --log-detail\fP ++Detailed log messages. ++.TP ++\fB -S, --log-facility\fP=[0-7] ++Set syslog facility to LOG_LOCAL[0-7]. The default syslog facility is LOG_DAEMON. ++.TP ++\fB -V, --dont-release-vrrp\fP ++Don't remove VRRP VIPs and VROUTEs on daemon stop. The default ++behavior is to remove all VIPs and VROUTEs when keepalived exits ++.TP ++\fB -I, --dont-release-ipvs\fP ++Don't remove IPVS topology on daemon stop. The default behavior it to ++remove all entries from the IPVS virtual server table on when ++keepalived exits. ++.TP ++\fB -R, --dont-respawn\fP ++Don't respawn child processes. The default behavior is to restart the ++VRRP and checker processes if either process exits. ++.TP ++\fB -n, --dont-fork\fP ++Don't fork the daemon process. This option will cause keepalived to ++run in the foreground. ++.TP ++\fB -d, --dump-conf\fP ++Dump the configuration data. ++.TP ++\fB -p, --pid\fP=FILE ++Use specified pidfile for parent keepalived process. The default ++pidfile for keepalived is "/var/run/keepalived.pid". ++.TP ++\fB -r, --vrrp_pid\fP=FILE ++Use specified pidfile for VRRP child process. The default pidfile for ++the VRRP child process is "/var/run/keepalived_vrrp.pid". ++.TP ++\fB -c, --checkers_pid\fP=FILE ++Use specified pidfile for checkers child process. The default pidfile ++for the checker child process is "/var/run/keepalived_checkers.pid". ++.TP ++\fB -v, --version\fP ++Display the version and exit. ++.TP ++\fB -h, --help\fP ++Display this help message and exit. ++ ++.SH "SEE ALSO" ++\fBkeepalived.conf\fP(5), \fBipvsadm\fP(8) ++ ++.SH "AUTHOR" ++This man page was written by Ryan O'Hara rohara@redhat.com +-- +1.7.1 + diff --git a/keepalived/systemd/keepalived.service b/keepalived/systemd/keepalived.service index 438ed78..0ab6efe 100644 --- a/keepalived/systemd/keepalived.service +++ b/keepalived/systemd/keepalived.service @@ -4,7 +4,9 @@ After=syslog.target network.target
[Service] Type=forking +KillMode=process ExecStart=/usr/sbin/keepalived +ExecReload=/bin/kill -HUP $MAINPID
[Install] WantedBy=multi-user.target diff --git a/net-snmp/net-snmp.nm b/net-snmp/net-snmp.nm index 5bc5ec2..8b2a7fa 100644 --- a/net-snmp/net-snmp.nm +++ b/net-snmp/net-snmp.nm @@ -5,7 +5,7 @@
name = net-snmp version = 5.7.2 -release = 1 +release = 2
groups = Networking/Daemons url = http://net-snmp.sourceforge.net @@ -115,7 +115,7 @@ build mkdir -pv %{BUILDROOT}%{localstatedir}/{lib,run}/net-snmp
# Remove more RPATHs. - find %{BUILDROOT}{%{bindir},%{sbindir},%{libdir}} -type f -print \ + find %{BUILDROOT}%{bindir} -type f -print \ -exec chrpath --delete {} ; end end @@ -163,6 +163,10 @@ packages
package %{name}-devel template DEVEL + + requires + lm-sensors-devel + end end
package %{name}-debuginfo
hooks/post-receive -- IPFire 3.x development tree