summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-06 18:53:48 +0000
committerErmal <eri@pfsense.org>2010-12-06 18:53:48 +0000
commit7afd6325f5aa14bfd6f5a0685ab475c8e2b95985 (patch)
tree043d6518ef69cedabe5fe2cc836c087837204f09 /sbin
parent6706a83a06d00d7e0c504139f308b77c3e2c79c0 (diff)
downloadpfsense-7afd6325f5aa14bfd6f5a0685ab475c8e2b95985.zip
pfsense-7afd6325f5aa14bfd6f5a0685ab475c8e2b95985.tar.gz
Modify dhclient-script to call rc.newwanip after all the changes to system have been done so races and no stale information can be extracted from the later.
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/dhclient-script18
1 files changed, 8 insertions, 10 deletions
diff --git a/sbin/dhclient-script b/sbin/dhclient-script
index 01dfc78..515191a 100755
--- a/sbin/dhclient-script
+++ b/sbin/dhclient-script
@@ -59,7 +59,7 @@ arp_flush() {
}
delete_old_address() {
- rm -f /var/db/${interface}_ip
+ /bin/rm -f /var/db/${interface}_ip
$IFCONFIG $interface inet -alias $old_ip_address $medium
}
@@ -82,8 +82,6 @@ add_new_address() {
echo $new_routers > /tmp/${interface}_router
echo $new_ip_address > /var/db/${interface}_ip
- /usr/local/sbin/pfSctl -c "interface newip $interface"
-
}
delete_old_alias() {
@@ -226,7 +224,7 @@ add_new_resolv_conf() {
done
fi
if [ -n "$new_domain_name_servers" ]; then
- rm -f /var/etc/nameserver_$interface
+ /bin/rm -f /var/etc/nameserver_$interface
for nameserver in $new_domain_name_servers; do
# Add a route to the nameserver out the correct interface
# so that mulitple wans work correctly with multiple dns
@@ -235,7 +233,6 @@ add_new_resolv_conf() {
$ROUTE add $nameserver -iface $interface
done
echo $new_domain_name >/var/etc/searchdomain_$interface
- /usr/local/sbin/pfSctl -c 'service reload dns'
fi
return 0
@@ -243,6 +240,7 @@ add_new_resolv_conf() {
# Notify rc.newwanip of changes to an interface
notify_rc_newwanip() {
+ /usr/local/sbin/pfSctl -c "interface newip $interface"
}
#
@@ -287,17 +285,17 @@ ARPCHECK|ARPSEND)
BOUND|RENEW|REBIND|REBOOT)
check_hostname
- changes=no
+ changes="no"
if [ -n "$old_ip_address" ]; then
if [ -n "$alias_ip_address" ] && \
[ "$old_ip_address" != "$alias_ip_address" ]; then
delete_old_alias
- changes=yes
+ changes="yes"
fi
if [ "$old_ip_address" != "$new_ip_address" ]; then
delete_old_address
delete_old_routes
- changes=yes
+ changes="yes"
fi
fi
if [ "$reason" = BOUND ] || \
@@ -306,12 +304,12 @@ BOUND|RENEW|REBIND|REBOOT)
[ "$old_ip_address" != "$new_ip_address" ]; then
add_new_address
add_new_routes
- changes=yes
+ changes="yes"
fi
if [ -n "$alias_ip_address" ] && \
[ "$new_ip_address" != "$alias_ip_address" ]; then
add_new_alias
- changes=yes
+ changes="yes"
fi
add_new_resolv_conf
if [ "$changes" = "yes" ] ; then
OpenPOWER on IntegriCloud