s/ping/arping/ in dhclient-script to handle not-on-local-net gateway in ARP-less device (#524298)

This commit is contained in:
Jiri Popelka 2010-10-07 17:48:46 +02:00
parent 290660e57a
commit b112ec7432
2 changed files with 15 additions and 11 deletions

View File

@ -215,24 +215,24 @@ is_router_reachable() {
router="${1}" router="${1}"
routersubnet="$(get_network_address ${router} ${new_subnet_mask})" routersubnet="$(get_network_address ${router} ${new_subnet_mask})"
mysubnet="$(get_network_address ${new_ip_address} ${new_subnet_mask})" mysubnet="$(get_network_address ${new_ip_address} ${new_subnet_mask})"
unreachable=0
if [ ! "${routersubnet}" = "${mysubnet}" ]; then if [ ! "${routersubnet}" = "${mysubnet}" ]; then
unreachable=1 ip -4 route add ${router}/32 dev ${interface}
if arping -f -q -I ${interface} -w2 ${router}; then if [ $? -eq 0 ]; then
ip -4 route add ${router}/32 dev ${interface} if ping -q -c1 -w2 -I ${interface} ${router}; then
if [ $? -eq 0 ]; then return 0
unreachable=0
else else
logmessage "failed to create host router for unreachable router ${router} not on subnet ${mysubnet}" logmessage "DHCP router ${router} is unreachable on DHCP subnet ${mysubnet} router subnet ${routersubnet}"
ip route del ${router}/32 dev ${interface}
return 1
fi fi
else else
unreachable=1 logmessage "failed to create host router for unreachable router ${router} not on subnet ${mysubnet}"
logmessage "DHCP router ${router} is unreachable on DHCP subnet ${mysubnet} router subnet ${routersubnet}" return 1
fi fi
fi fi
return ${unreachable} return 0
} }
add_default_gateway() { add_default_gateway() {

View File

@ -7,7 +7,7 @@
Summary: Dynamic host configuration protocol software Summary: Dynamic host configuration protocol software
Name: dhcp Name: dhcp
Version: 4.2.0 Version: 4.2.0
Release: 10%{?dist} Release: 11%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and # 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. # that's why it is at 12 now. It should have never been used, but it was.
@ -520,6 +520,10 @@ fi
%attr(0644,root,root) %{_mandir}/man3/omapi.3.gz %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz
%changelog %changelog
* Thu Oct 07 2010 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.0-11
- Use ping instead of arping in dhclient-script to handle
not-on-local-net gateway in ARP-less device (#524298)
* Thu Oct 07 2010 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.0-10 * Thu Oct 07 2010 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.0-10
- Check whether there is any unexpired address in previous lease - Check whether there is any unexpired address in previous lease
prior to confirming (INIT-REBOOT) the lease (#585418) prior to confirming (INIT-REBOOT) the lease (#585418)