diff --git a/dhcp-3.0.6-dhclient-config-no-script.patch b/dhcp-3.0.6-dhclient-conf-no-script.patch similarity index 100% rename from dhcp-3.0.6-dhclient-config-no-script.patch rename to dhcp-3.0.6-dhclient-conf-no-script.patch diff --git a/dhcp-3.0.6-dhclient-requests-conf.patch b/dhcp-3.0.6-dhclient-conf-requests.patch similarity index 100% rename from dhcp-3.0.6-dhclient-requests-conf.patch rename to dhcp-3.0.6-dhclient-conf-requests.patch diff --git a/dhcp-3.0.6-dhclient-conf-requires.patch b/dhcp-3.0.6-dhclient-conf-requires.patch new file mode 100644 index 0000000..c3e9f38 --- /dev/null +++ b/dhcp-3.0.6-dhclient-conf-requires.patch @@ -0,0 +1,14 @@ +--- dhcp-3.0.6/client/dhclient.conf ++++ dhcp-3.0.6/client/dhclient.conf 2008/03/03 13:14:44 +@@ -26,7 +26,10 @@ + request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, host-name, nis-domain, + nis-servers, ntp-servers, netbios-name-servers; +-require subnet-mask, domain-name-servers; ++# We request above options, require only the IP configuration: ++require subnet-mask; ++# To enforce the availability of the dns server list, set to: ++#require subnet-mask, domain-name-servers; + timeout 60; + retry 60; + reboot 10; diff --git a/dhcp-3.0.6-dhclient-script-default-gw.patch b/dhcp-3.0.6-dhclient-script-default-gw.patch new file mode 100644 index 0000000..46650ff --- /dev/null +++ b/dhcp-3.0.6-dhclient-script-default-gw.patch @@ -0,0 +1,27 @@ +--- dhcp-3.0.6/client/scripts/linux ++++ dhcp-3.0.6/client/scripts/linux 2008/04/04 07:38:57 +@@ -284,7 +284,23 @@ + route add -net $new_network_number $new_subnet_arg dev $interface + fi + for router in $new_routers; do +- route add default gw $router ++ err=`route add default gw $router 2>&1` && break || \ ++ case "$err" in ++ SIOCADDRT:*) ++ # The gateway seems to be not reachable via local network ++ # route (implicitely created by ifconfig based on the IP ++ # an netmask provided by dhcp). ++ # Check this, set an explicit host route to the gateway ++ # over the current interface and try again (bnc#266215). ++ matches=$(test -x /sbin/ip && \ ++ /sbin/ip -f inet -o route list match $router | \ ++ grep -v ^default | grep -c -v "^$" 2>/dev/null) ++ if test -n "$matches" -a $(($matches)) -eq 0 ; then ++ route add -host $router dev $interface && \ ++ route add default gw $router && break ++ fi ++ ;; ++ esac + done + fi + fi diff --git a/dhcp-3.0.6-dhclient-script-ntp-runtime.patch b/dhcp-3.0.6-dhclient-script-ntp-runtime.patch index 98d2691..db6b37b 100644 --- a/dhcp-3.0.6-dhclient-script-ntp-runtime.patch +++ b/dhcp-3.0.6-dhclient-script-ntp-runtime.patch @@ -1,15 +1,31 @@ -Index: dhcp-3.0.6/client/scripts/linux -=================================================================== ---- dhcp-3.0.6.orig/client/scripts/linux -+++ dhcp-3.0.6/client/scripts/linux -@@ -103,6 +103,28 @@ make_resolv_conf() { +--- dhcp-3.0.6/client/scripts/linux ++++ dhcp-3.0.6/client/scripts/linux 2008/04/04 07:37:35 +@@ -103,6 +103,54 @@ done } ++remove_ntp_runtime_conf() { ++ if test -f "/var/run/ntp/servers.${interface}" ; then ++ rm -f "/var/run/ntp/servers.${interface}" ++ ++ if test -x /etc/init.d/ntp ; then ++ /etc/init.d/ntp try-restart ++ fi ++ fi ++} ++ +make_ntp_runtime_conf() { + if [ "x$new_ntp_servers" != "x" ]; then ++ local restart=no ++ if test -f "/var/run/ntp/servers.${interface}" ; then ++ . "/var/run/ntp/servers.${interface}" ++ test "x$RUNTIME_SERVERS" = "x$new_ntp_servers" && return 0 + -+ cat > /var/run/ntp/servers << EOF ++ restart=yes ++ rm -f "/var/run/ntp/servers.${interface}" ++ fi ++ ++ cat > "/var/run/ntp/servers.${interface}" << EOF +### BEGIN INFO +# +# Modified_by: dhclient-script @@ -17,21 +33,29 @@ Index: dhcp-3.0.6/client/scripts/linux +# Process_id: $(pidof dhclient) +# Script: /sbin/dhclient-script +# -+# Info: This is a temporary autogenerated config by the NTP init script. ++# Info: This is a temporary generated config by the dhclient-script. +# In the case of a restart these infomrmations are used to -+# configure ntpd during runtime. ++# add the ntp servers at runtime. +### END INFO + +RUNTIME_SERVERS="$new_ntp_servers" + +EOF ++ ++ if test -x /etc/init.d/ntp ; then ++ if test "$restart" = "no" ; then ++ /etc/init.d/ntp addserver $new_ntp_servers ++ else ++ /etc/init.d/ntp try-restart ++ fi ++ fi + fi +} + function write_informational_resolv_conf_header() { cat > /etc/resolv.conf << EOF ### BEGIN INFO -@@ -250,6 +272,7 @@ if [ x$reason = xBOUND ] || [ x$reason = +@@ -250,6 +298,7 @@ fi if [ -z "${dhc_dbus}" ] || (( ( dhc_dbus & 1 ) != 1 )); then make_resolv_conf @@ -39,7 +63,7 @@ Index: dhcp-3.0.6/client/scripts/linux eval `grep --no-filename "^DHCLIENT_SET_HOSTNAME=" /etc/sysconfig/network/dhcp` if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then -@@ -311,6 +334,7 @@ if [ x$reason = xTIMEOUT ]; then +@@ -311,6 +360,7 @@ route add default gw $router done make_resolv_conf @@ -47,3 +71,11 @@ Index: dhcp-3.0.6/client/scripts/linux exit_with_hooks 0 fi ifconfig $interface inet 0 down +@@ -321,5 +371,7 @@ + if test -f /etc/resolv.conf.saved.by.dhclient ; then + mv /etc/resolv.conf.saved.by.dhclient /etc/resolv.conf + fi ++# remove runtime ntp conf ++remove_ntp_runtime_conf + + exit_with_hooks 0 diff --git a/dhcp.changes b/dhcp.changes index 1898282..57e95f5 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri Apr 4 16:43:21 CEST 2008 - mt@suse.de + +- Changed the list of dhcp options required by the dhcp-client in + the server response to not to enforce the domain-name-servers + option availiability (bnc#331964). +- Fixed too long error messages server init script (bnc#353589). +- Renamed/renumbered patches modifying the dhclient.conf file. +- Fixed the dhclient-script to add explicit host route to default + gateway when it is not reachable via interface route created by + ifconfig based on the IP and netmask (e.g. /32) values provided + by dhcp server (bnc#266215). +- Fixed ntp configuration feature in dhclient-script to try-restart + the ntp service to apply the server changes. Changed to use new + per interface server list to avoid merge problems (bnc#375746). + ------------------------------------------------------------------- Tue Apr 1 16:07:04 CEST 2008 - mkoenig@suse.de diff --git a/dhcp.spec b/dhcp.spec index f39954a..94ce4e0 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -24,7 +24,7 @@ License: BSD 3-Clause Group: Productivity/Networking/Boot/Servers AutoReqProv: on Version: 3.0.6 -Release: 69 +Release: 72 Summary: Common Files Used by ISC DHCP Software Url: http://www.isc.org/isc/dhcp.html Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz @@ -82,10 +82,12 @@ Patch70: dhcp-3.0.3b1-pie.dif # Add support for dhcdbd Patch80: dhcp-3.0.2-extended_option_environment.patch Patch81: dhcp-3.0.3-dhclient-script-dhcdbd.patch -Patch83: dhcp-3.0.6-dhclient-requests-conf.patch -Patch84: dhcp-3.0.6-dhclient-script-ntp-runtime.patch -Patch85: dhcp-send-hostname-rml.patch -Patch86: dhcp-3.0.6-dhclient-config-no-script.patch +Patch82: dhcp-3.0.6-dhclient-script-ntp-runtime.patch +Patch83: dhcp-3.0.6-dhclient-script-default-gw.patch +Patch84: dhcp-send-hostname-rml.patch +Patch85: dhcp-3.0.6-dhclient-conf-requests.patch +Patch86: dhcp-3.0.6-dhclient-conf-no-script.patch +Patch87: dhcp-3.0.6-dhclient-conf-requires.patch Obsoletes: dhcp-base Provides: dhcp-base:/usr/bin/omshell PreReq: /bin/touch /sbin/chkconfig @@ -215,10 +217,12 @@ Authors: %endif %patch80 -p1 %patch81 -p1 +%patch82 -p1 %patch83 -p1 %patch84 -p1 %patch85 -p1 %patch86 -p1 +%patch87 -p1 find . -type f -name \*.cat\* -exec rm -f {} \; cp -p %{S:2} %{S:3} %{S:11} %{S:12} %{S:14} %{S:32} %{S:33} . for i in README LIESMICH; do @@ -486,6 +490,19 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi %doc %{_mandir}/man3/dhcpctl.3.gz %changelog +* Fri Apr 04 2008 mt@suse.de +- Changed the list of dhcp options required by the dhcp-client in + the server response to not to enforce the domain-name-servers + option availiability (bnc#331964). +- Fixed too long error messages server init script (bnc#353589). +- Renamed/renumbered patches modifying the dhclient.conf file. +- Fixed the dhclient-script to add explicit host route to default + gateway when it is not reachable via interface route created by + ifconfig based on the IP and netmask (e.g. /32) values provided + by dhcp server (bnc#266215). +- Fixed ntp configuration feature in dhclient-script to try-restart + the ntp service to apply the server changes. Changed to use new + per interface server list to avoid merge problems (bnc#375746). * Tue Apr 01 2008 mkoenig@suse.de - remove dir /usr/share/omc/svcinfo.d as it is provided now by filesystem diff --git a/rc.dhcpd b/rc.dhcpd index 4e98172..912b01c 100644 --- a/rc.dhcpd +++ b/rc.dhcpd @@ -107,7 +107,7 @@ case "$1" in ## If there is no conf file, skip starting of dhcpd ## and return with "program not configured" if ! [ -f $DAEMON_CONF ]; then - echo -e -n "... no configuration file found"; + echo -n "... no configuration file found"; # Tell the user this has skipped rc_status -s # service is not configured @@ -117,7 +117,7 @@ case "$1" in ## If the interfaces are not set, skip starting of dhcpd ## and return with "program not configured" if [ -z "$DHCPD_INTERFACE" ]; then - echo -n "... cannot... DHCPD_INTERFACE in /etc/sysconfig/dhcpd is empty!" + echo -n "... set DHCPD_INTERFACE in /etc/sysconfig/dhcpd" # Tell the user this has skipped rc_status -s # service is not configured @@ -290,9 +290,9 @@ case "$1" in ## Like force-reload, but if daemon does not support ## signalling, do nothing (!) + echo -n "Reload service $DAEMON" if [ "$SUPPORTS_HUP" = "yes" ]; then # If it supports signalling: - echo -n "Reload service $DAEMON" killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN #touch $DAEMON_PIDFILE rc_status -v