rpms/dhcp/F-10 dhclient-script,1.4,1.5 dhcp.spec,1.229,1.230
David Cantrell
dcantrel at fedoraproject.org
Thu Dec 4 03:40:16 UTC 2008
Author: dcantrel
Update of /cvs/pkgs/rpms/dhcp/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1899
Modified Files:
dhclient-script dhcp.spec
Log Message:
* Wed Dec 03 2008 David Cantrell <dcantrell at redhat.com> - 12:4.0.0-33
- Do not calculate a prefix for an address we did not receive (#473885)
Index: dhclient-script
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-10/dhclient-script,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dhclient-script 11 Nov 2008 22:10:14 -0000 1.4
+++ dhclient-script 4 Dec 2008 03:39:46 -0000 1.5
@@ -215,7 +215,7 @@
[ ! "${old_ip_address}" = "${new_ip_address}" ]; then
# IP address changed. Bringing down the interface will delete all
# routes, and clear the ARP cache.
- ip -family inet addr flush dev ${interface}
+ ip -family inet addr flush dev ${interface} >/dev/null 2>&1
ip -family inet link set dev ${interface} down
fi
@@ -319,7 +319,7 @@
if [ ! "${new_ip_address}" = "${alias_ip_address}" ] &&
[ -n "${alias_ip_address}" ]; then
- ip -family inet addr flush dev ${interface}:0
+ ip -family inet addr flush dev ${interface}:0 >/dev/null 2>&1
ip -family inet addr add ${alias_ip_address}/${alias_prefix} dev ${interface}:0
ip route replace ${alias_ip_address}/32 dev ${interface}:0
fi
@@ -413,6 +413,15 @@
fi
}
+get_prefix() {
+ ip="${1}"
+ nm="${2}"
+
+ if [ -n "${ip}" -a -n "${nm}" ]; then
+ ipcalc -s -p ${ip} ${nm} | cut -d '=' -f 2
+ fi
+}
+
#
# ### MAIN
@@ -450,24 +459,13 @@
. /etc/sysconfig/networking/network
fi
-CONFIG="${interface}"
-if [ -d /etc/sysconfig/network-scripts ]; then
- cd /etc/sysconfig/network-scripts
- need_config ${CONFIG}
- source_config >/dev/null 2>&1
-fi
-
-if [ -n "${new_subnet_mask}" ]; then
- new_prefix="$(ipcalc -p ${new_ip_address} ${new_subnet_mask} | cut -d '=' -f 2)"
-fi
-
-if [ -n "${old_subnet_mask}" ]; then
- old_prefix="$(ipcalc -p ${old_ip_address} ${new_subnet_mask} | cut -d '=' -f 2)"
-fi
-
-if [ -n "${alias_subnet_mask}" ]; then
- alias_prefix="$(ipcalc -p ${alias_ip_address} ${alias_subnet_mask} | cut -d '=' -f 2)"
-fi
+CONFIG="/etc/sysconfig/network-scripts/ifcfg-${interface}"
+need_config ${CONFIG}
+source_config >/dev/null 2>&1
+
+new_prefix="$(get_prefix ${new_ip_address} ${new_subnet_mask})"
+old_prefix="$(get_prefix ${old_ip_address} ${new_subnet_mask})"
+alias_prefix="$(get_prefix ${alias_ip_address} ${alias_subnet_mask})"
case "${reason}" in
MEDIUM)
@@ -484,7 +482,7 @@
if [ "${keep_old_ip}" = "yes" ]; then
ip -family inet link set ${interface} up
else
- ip -family inet addr flush dev ${interface}
+ ip -family inet addr flush dev ${interface} >/dev/null 2>&1
ip -family inet link set ${interface} up
fi
@@ -556,7 +554,7 @@
if [ -n "${old_ip_address}" ]; then
# Shut down interface, which will delete routes and clear arp cache.
- ip -family inet addr flush dev ${interface}
+ ip -family inet addr flush dev ${interface} >/dev/null 2>&1
ip -family inet link set ${interface} down
fi
@@ -571,7 +569,7 @@
TIMEOUT)
if [ -n "${new_routers}" ]; then
if [ -n "${alias_ip_address}" ]; then
- ip -family inet addr flush dev ${interface}:0
+ ip -family inet addr flush dev ${interface}:0 >/dev/null 2>&1
fi
ip -family inet addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface}
@@ -582,7 +580,7 @@
exit_with_hooks 0
fi
- ip -family inet addr flush dev ${interface}
+ ip -family inet addr flush dev ${interface} >/dev/null 2>&1
ip -family inet link set ${interface} down
exit_with_hooks 1
else
Index: dhcp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-10/dhcp.spec,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -r1.229 -r1.230
--- dhcp.spec 11 Nov 2008 22:10:14 -0000 1.229
+++ dhcp.spec 4 Dec 2008 03:39:46 -0000 1.230
@@ -4,7 +4,7 @@
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
Name: dhcp
Version: 4.0.0
-Release: 32%{?dist}
+Release: 33%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and
# that's why it is at 12 now. It should have never been used, but it was.
@@ -449,6 +449,9 @@
%{_libdir}/libdhcp4client.so
%changelog
+* Wed Dec 03 2008 David Cantrell <dcantrell at redhat.com> - 12:4.0.0-33
+- Do not calculate a prefix for an address we did not receive (#473885)
+
* Tue Nov 11 2008 David Cantrell <dcantrell at redhat.com> - 12:4.0.0-32
- Correctly source ifcfg-DEVICE files (#470928)
- Honor $keep_old_ip in dhclient-script (#471127)
More information about the fedora-extras-commits
mailing list