2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-02 07:15:44 +00:00

Client Script fixes

[ISC-Bugs #23045] Typos in client/scripts/openbsd
[ISC-Bugs #23565] In the client scripts add a zone id (interface id) if
the domain search address is link local.
[ISC-Bugs #1277] In some of the client scripts add code to handle the
case of the default router information being changed without the address
being changed.
This commit is contained in:
Shawn Routhier
2011-05-18 19:55:44 +00:00
parent 5c09391c07
commit 4f55e11bd4
9 changed files with 173 additions and 11 deletions

View File

@@ -49,9 +49,19 @@ make_resolv_conf() {
if [ "x${new_dhcp6_domain_search}" != x ] ; then
echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
fi
shopt -s nocasematch
for nameserver in ${new_dhcp6_name_servers} ; do
echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6
# If the nameserver has a link-local address
# add a <zone_id> (interface name) to it.
if [[ "$nameserver" =~ ^fe80:: ]]
then
zone_id="%$interface"
else
zone_id=
fi
echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
done
shopt -u nocasematch
mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
fi
@@ -161,6 +171,21 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
fi
route add default gw $router $metric_arg dev $interface
done
else
# we haven't changed the address, have we changed other options
# that we wish to update?
if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
# if we've changed routers delete the old and add the new.
for router in $old_routers; do
route del default gw $router
done
for router in $new_routers; do
if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
route add -host $router dev $interface
fi
route add default gw $router $metric_arg dev $interface
done
fi
fi
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
then