SHA256
1
0
forked from pool/dhcp
OBS User unknown 2008-11-17 15:46:10 +00:00 committed by Git OBS Bridge
parent c0482096e0
commit 24f17c8601
4 changed files with 111 additions and 51 deletions

View File

@ -1,6 +1,6 @@
--- client/dhclient.conf --- client/dhclient.conf
+++ client/dhclient.conf 2008/09/08 14:57:18 +++ client/dhclient.conf 2008/11/11 09:12:22
@@ -1,36 +1,46 @@ @@ -1,36 +1,48 @@
-send host-name "andare.fugue.com"; -send host-name "andare.fugue.com";
-send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; -send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
+# +#
@ -35,10 +35,12 @@
-require subnet-mask, domain-name-servers; -require subnet-mask, domain-name-servers;
+ +
+# Request several well known/usefull dhcp options. +# Request several well known/usefull dhcp options.
+request subnet-mask, broadcast-address, routers, +request subnet-mask, network-number, broadcast-address,
+ host-name, domain-name, domain-name-servers, + routers, interface-mtu, host-name, domain-name,
+ nis-domain, nis-servers, netbios-name-servers, + domain-name-servers, nis-domain, nis-servers,
+ ntp-servers, time-offset; + nds-context, nds-servers, nds-tree-name,
+ netbios-name-servers, netbios-dd-server,
+ netbios-node-type, netbios-scope, ntp-servers;
+ +
+# We request above options, require only the IP configuration: +# We request above options, require only the IP configuration:
+require subnet-mask; +require subnet-mask;

View File

@ -1,5 +1,5 @@
--- client/dhclient-script.8 --- client/dhclient-script.8
+++ client/dhclient-script.8 2008/09/12 11:42:47 +++ client/dhclient-script.8 2008/11/11 09:06:47
@@ -45,9 +45,10 @@ @@ -45,9 +45,10 @@
This script is not meant to be customized by the end user. If local This script is not meant to be customized by the end user. If local
customizations are needed, they should be possible using the enter and customizations are needed, they should be possible using the enter and
@ -72,8 +72,8 @@
.B dhclient-script(8) .B dhclient-script(8)
has been written for Internet Systems Consortium has been written for Internet Systems Consortium
--- client/scripts/linux --- client/scripts/linux
+++ client/scripts/linux 2008/09/12 11:43:12 +++ client/scripts/linux 2008/11/11 09:06:54
@@ -22,25 +22,87 @@ @@ -22,25 +22,97 @@
# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious # 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
# of the $1 in its args. # of the $1 in its args.
@ -104,7 +104,7 @@
+ test -x /sbin/netconfig + test -x /sbin/netconfig
+} +}
+netconfig_modify() { +netconfig_modify() {
+ if test -x /sbin/netconfig ; then + if test -x /sbin/netconfig -a -n "$interface" ; then
+ { + {
+ echo "INTERFACE='$interface'" + echo "INTERFACE='$interface'"
+ for v in ${!new_*}; do + for v in ${!new_*}; do
@ -113,14 +113,24 @@
+ (new_subnet_mask) k='NETMASK' ;; + (new_subnet_mask) k='NETMASK' ;;
+ (new_network_number) k='NETWORK' ;; + (new_network_number) k='NETWORK' ;;
+ (new_broadcast_address) k='BROADCAST' ;; + (new_broadcast_address) k='BROADCAST' ;;
+ (new_interface_mtu) k='MTU' ;;
+ #(new_static_routes) k='ROUTES' ;;
+ (new_routers) k='GATEWAYS' ;; + (new_routers) k='GATEWAYS' ;;
+ (new_host_name) k='HOSTNAME' ;;
+ (new_domain_name) k='DNSDOMAIN' ;; + (new_domain_name) k='DNSDOMAIN' ;;
+ (new_domain_name_servers) k='DNSSERVERS' ;; + (new_domain_name_servers) k='DNSSERVERS' ;;
+ (new_ntp_servers) k='NTPSERVERS' ;; + (new_ntp_servers) k='NTPSERVERS' ;;
+ (new_nis_domain) k='NISDOMAIN' ;; + (new_nis_domain) k='NISDOMAIN' ;;
+ (new_nis_servers) k='NISSERVERS' ;; + (new_nis_servers) k='NISSERVERS' ;;
+ (new_root_path) k='ROOTPATH' ;;
+ (new_dhcp_server_identifier)k='DHCPSID' ;;
+ (new_lpr_servers) k='LPRSERVER' ;;
+ (new_log_servers) k='LOGSERVER' ;;
+ (new_netbios_dd_server) k='NETBIOSDDSERVER' ;;
+ (new_netbios_name_servers) k='NETBIOSNAMESERVER' ;; + (new_netbios_name_servers) k='NETBIOSNAMESERVER' ;;
+ (*) : skip $v ; continue ;; + (new_netbios_node_type) k='NETBIOSNODETYPE' ;;
+ (new_netbios_scope) k='NETBIOSSCOPE' ;;
+ (*) k="dhclient_${v#new_}" ;;
+ esac + esac
+ [ "k${k}" != k ] && echo "${k}='${!v}'" + [ "k${k}" != k ] && echo "${k}='${!v}'"
+ done + done
@ -128,7 +138,7 @@
+ fi + fi
+} +}
+netconfig_remove() { +netconfig_remove() {
+ if test -x /sbin/netconfig ; then + if test -x /sbin/netconfig -a -n "$interface" ; then
+ /sbin/netconfig remove -s "dhclient3" -i "$interface" </dev/null + /sbin/netconfig remove -s "dhclient3" -i "$interface" </dev/null
+ fi + fi
+} +}
@ -168,7 +178,7 @@
# Must be used on exit. Invokes the local dhcp client exit hooks, if any. # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
exit_with_hooks() { exit_with_hooks() {
@@ -97,7 +159,7 @@ @@ -97,7 +169,7 @@
if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ) if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
then then
ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
@ -177,7 +187,7 @@
# Add route to make broadcast work. Do not omit netmask. # Add route to make broadcast work. Do not omit netmask.
route add default dev $interface netmask 0.0.0.0 route add default dev $interface netmask 0.0.0.0
else else
@@ -116,38 +178,45 @@ @@ -116,39 +188,58 @@
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
@ -215,29 +225,44 @@
+ ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then + ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
route add -net $new_network_number $new_subnet_arg dev $interface route add -net $new_network_number $new_subnet_arg dev $interface
fi fi
for router in $new_routers; do - for router in $new_routers; do
- route add default gw $router - route add default gw $router
+ err=`route add default gw $router 2>&1` && break || \ - done
+ case "$err" in +
+ SIOCADDRT:*) + if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
+ # The gateway seems to be not reachable via local network + then
+ # route (implicitely created by ifconfig based on the IP + eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
+ # an netmask provided by dhcp). + /etc/sysconfig/network/dhcp
+ # Check this, set an explicit host route to the gateway + /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ # over the current interface and try again (bnc#266215). + else
+ matches=$(test -x /sbin/ip && \ + eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
+ /sbin/ip -f inet -o route list match $router | \ + /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ grep -v ^default | grep -c -v "^$" 2>/dev/null) + fi
+ if test -n "$matches" -a $(($matches)) -eq 0 ; then + if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then
+ route add -host $router dev $interface && \ + for router in $new_routers; do
+ route add default gw $router && break + err=`route add default gw $router 2>&1` && break || \
+ fi + case "$err" in
+ ;; + SIOCADDRT:*)
+ esac + # The gateway seems to be not reachable via local network
done + # 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 fi
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
@@ -156,7 +225,31 @@ then
@@ -156,7 +247,41 @@
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
route add -host $alias_ip_address $interface:0 route add -host $alias_ip_address $interface:0
fi fi
@ -247,30 +272,40 @@
+ else + else
+ make_resolv_conf + make_resolv_conf
+ fi + fi
+ eval `grep --no-filename "^DHCLIENT_SET_HOSTNAME=" /etc/sysconfig/network/dhcp` + if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
+ then
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
+ /etc/sysconfig/network/dhcp
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ else
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
+ fi
+ if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then + if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
+ +
+ current_hostname=`hostname` + current_hostname=`hostname`
+ if [ x$current_hostname = x ] || \ + if [ "x${current_hostname%%.*}" = x ] || \
+ [ x$current_hostname != x$new_host_name ]; then + [ "x${current_hostname%%.*}" != "x${new_host_name%%.*}" ]; then
+ +
+ if [ x$new_host_name != x ]; then + if [ "x${new_host_name%%.*}" != x ]; then
+ hostname $new_host_name + hostname "${new_host_name%%.*}"
+ else + else
+ if [ -x /usr/bin/host ] ; then + if [ -x /usr/bin/host ] ; then
+ if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then + if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then
+ hostname `echo "$out" | sed 's:^.* ::; s:\..*::'` + _hostname="`echo "$out" | sed 's:^.* ::; s:\..*::'`"
+ if [ "x${_hostname}" != x ]; then
+ hostname "${_hostname}"
+ fi
+ fi + fi
+ fi + fi
+ fi + fi
+
+ fi + fi
+ +
+ fi + fi
exit_with_hooks 0 exit_with_hooks 0
fi fi
@@ -168,7 +261,7 @@ @@ -168,7 +293,7 @@
fi fi
if [ x$old_ip_address != x ]; then if [ x$old_ip_address != x ]; then
# Shut down interface, which will delete routes and clear arp cache. # Shut down interface, which will delete routes and clear arp cache.
@ -279,7 +314,7 @@
fi fi
if [ x$alias_ip_address != x ]; then if [ x$alias_ip_address != x ]; then
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
@@ -182,27 +275,37 @@ @@ -182,27 +307,37 @@
ifconfig $interface:0- inet 0 ifconfig $interface:0- inet 0
fi fi
ifconfig $interface inet $new_ip_address $new_subnet_arg \ ifconfig $interface inet $new_ip_address $new_subnet_arg \

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Nov 11 11:12:23 CET 2008 - mt@suse.de
- Fixed dhclient-script to apply DHCLIENT_SET_HOSTNAME and
SET_DEFAULT_ROUTE policy correctly and inclusive of per
interface setings (bnc#426650).
- Fixed dhclient-script to make sure, the host name is set
as short-name even dhcp provides fqdn (bnc#418168)
- Fixed dhclient-script to translate all known dhcp options
to netconfig variables and unknown with dhclient prefix.
- Fixed dhclient.conf to request all netbios dhcp-options,
added also nds and mtu options.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Sep 12 16:58:22 CEST 2008 - mt@suse.de Fri Sep 12 16:58:22 CEST 2008 - mt@suse.de

View File

@ -31,7 +31,7 @@ License: BSD 3-Clause
Group: Productivity/Networking/Boot/Servers Group: Productivity/Networking/Boot/Servers
AutoReqProv: on AutoReqProv: on
Version: 3.1.1 Version: 3.1.1
Release: 2 Release: 5
Summary: Common Files Used by ISC DHCP Software Summary: Common Files Used by ISC DHCP Software
Url: http://www.isc.org/isc/dhcp.html Url: http://www.isc.org/isc/dhcp.html
Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz
@ -486,6 +486,16 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
%doc %{_mandir}/man3/dhcpctl.3.gz %doc %{_mandir}/man3/dhcpctl.3.gz
%changelog %changelog
* Tue Nov 11 2008 mt@suse.de
- Fixed dhclient-script to apply DHCLIENT_SET_HOSTNAME and
SET_DEFAULT_ROUTE policy correctly and inclusive of per
interface setings (bnc#426650).
- Fixed dhclient-script to make sure, the host name is set
as short-name even dhcp provides fqdn (bnc#418168)
- Fixed dhclient-script to translate all known dhcp options
to netconfig variables and unknown with dhclient prefix.
- Fixed dhclient.conf to request all netbios dhcp-options,
added also nds and mtu options.
* Fri Sep 12 2008 mt@suse.de * Fri Sep 12 2008 mt@suse.de
- Removed one of two option_state_dereference calls in dhclient.c - Removed one of two option_state_dereference calls in dhclient.c
causing null pointer messages (not critical) in the log. causing null pointer messages (not critical) in the log.
@ -751,7 +761,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
- add s390x to the list of platforms to compile with -fsigned-char - add s390x to the list of platforms to compile with -fsigned-char
to avoid the dhclient.conf parse error "expecting a statement" to avoid the dhclient.conf parse error "expecting a statement"
[#171532], [#134590] [#171532], [#134590]
* Fri May 05 2006 rml@suse.de * Thu May 04 2006 rml@suse.de
- Add "-H" flag for setting hostname (Novell major bug #139532) - Add "-H" flag for setting hostname (Novell major bug #139532)
* Wed Mar 29 2006 poeml@suse.de * Wed Mar 29 2006 poeml@suse.de
- fix two further include paths in dhcpctl.3 and omapi.3 - fix two further include paths in dhcpctl.3 and omapi.3
@ -768,7 +778,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
* Sat Jan 14 2006 thoenig@suse.de * Sat Jan 14 2006 thoenig@suse.de
- replaced 'nis-domain-servers' by 'nis-servers' in - replaced 'nis-domain-servers' by 'nis-servers' in
dhcp-3.0.3-dhclient-nis-01-thoenig.patch (follow-up #134160) dhcp-3.0.3-dhclient-nis-01-thoenig.patch (follow-up #134160)
* Sat Jan 14 2006 thoenig@suse.de * Fri Jan 13 2006 thoenig@suse.de
- add 'nis-domain' and 'nis-domain-servers' to 'request' - add 'nis-domain' and 'nis-domain-servers' to 'request'
dhclient.conf (dhcp-3.0.3-dhclient-nis-01-thoenig.patch). If dhclient.conf (dhcp-3.0.3-dhclient-nis-01-thoenig.patch). If
the DHCP reply contains information about NIS, NM will set those. the DHCP reply contains information about NIS, NM will set those.
@ -803,7 +813,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
- build with pie/PIE depending on architecture. - build with pie/PIE depending on architecture.
* Thu Jun 30 2005 gekker@suse.de * Thu Jun 30 2005 gekker@suse.de
- Add -DEXTENDED_NEW_OPTION_INFO to CFLAGS for rml - Add -DEXTENDED_NEW_OPTION_INFO to CFLAGS for rml
* Wed Jun 29 2005 gekker@suse.de * Tue Jun 28 2005 gekker@suse.de
- Add support for dhcdbd, patches from RH via rml - Add support for dhcdbd, patches from RH via rml
* Mon Jun 20 2005 ro@suse.de * Mon Jun 20 2005 ro@suse.de
- build with pie/fpie - build with pie/fpie
@ -1092,7 +1102,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
instead instead
* Sun Jan 11 2004 adrian@suse.de * Sun Jan 11 2004 adrian@suse.de
- build as user - build as user
* Wed Nov 19 2003 poeml@suse.de * Tue Nov 18 2003 poeml@suse.de
- if starting dhcpd in chroot jail, and a pid file is present in - if starting dhcpd in chroot jail, and a pid file is present in
the jail, and the pid file does not contain a pid of a running the jail, and the pid file does not contain a pid of a running
dhcpd process, but that of another _running_ process, remove dhcpd process, but that of another _running_ process, remove
@ -1310,7 +1320,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
correctly set to /sbin --> drop 2 hunks from dhcp-3.0rc10.dif correctly set to /sbin --> drop 2 hunks from dhcp-3.0rc10.dif
* Tue Mar 26 2002 ro@suse.de * Tue Mar 26 2002 ro@suse.de
- Fix handling of initscript links and START_* variable [Bug #13755] - Fix handling of initscript links and START_* variable [Bug #13755]
* Mon Feb 11 2002 poeml@suse.de * Sun Feb 10 2002 poeml@suse.de
- drop the sysconfig/network/dhcp template. It's in the syconfig - drop the sysconfig/network/dhcp template. It's in the syconfig
package now. package now.
- strip /sbin/dhclient - strip /sbin/dhclient
@ -1324,7 +1334,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
filled up into /etc/sysconfig/network/config filled up into /etc/sysconfig/network/config
* Wed Jan 30 2002 poeml@suse.de * Wed Jan 30 2002 poeml@suse.de
- add /sbin/dhclient, accidentally deleted from filelist lately - add /sbin/dhclient, accidentally deleted from filelist lately
* Mon Jan 28 2002 ro@suse.de * Sun Jan 27 2002 ro@suse.de
- remove START_DHCPD on update - remove START_DHCPD on update
- use fillup_only where no initscript is handled - use fillup_only where no initscript is handled
* Sun Jan 27 2002 poeml@suse.de * Sun Jan 27 2002 poeml@suse.de
@ -1594,7 +1604,7 @@ if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
* Wed Jun 23 1999 rolf@suse.de * Wed Jun 23 1999 rolf@suse.de
- new version 2.0 - new version 2.0
- apply fix from Michael Hasenstein - apply fix from Michael Hasenstein
* Tue Mar 09 1999 ro@suse.de * Mon Mar 08 1999 ro@suse.de
- fixed man5-path - fixed man5-path
* Fri Feb 26 1999 rolf@suse.de * Fri Feb 26 1999 rolf@suse.de
- new version 2.0b1pl16 (stable beta) - new version 2.0b1pl16 (stable beta)