Index: branches/releng-9.0/nanobsd/files/etc/dhclient-exit-hooks
===================================================================
--- branches/releng-9.0/nanobsd/files/etc/dhclient-exit-hooks	(revision 10607)
+++ branches/releng-9.0/nanobsd/files/etc/dhclient-exit-hooks	(revision 10608)
@@ -21,13 +21,17 @@
 
 update_pf_conf() {
-  if is_default_interface; then
-    new_ext_if_gw=`route -n get default | awk '/gateway/ {print $2}'`
-    if [ -n "$new_ext_if_gw" ]; then
-      if [ -a "$new_ext_if_gw" != "$ext_if_gw" ];  then
-        info "Reloading PF firewall to load new ext_if_gw=$ext_if_gw"
-        { grep -v '^ext_if_gw=' $rc_conf_running; echo "ext_if_gw=$new_ext_if_gw"; } > $rc_conf_running
-        /etc/rc.d/pf reload
-      fi
+  $LOGGER "reason: $reason"
+  if is_default_interface 2>/dev/null; then
+    $LOGGER "is_default_interface: TRUE"
+    new_ext_if_gw=`route -n get default 2>/dev/null | awk '/gateway/ {print $2}'`
+    $LOGGER "prev default gateway: $ext_if_gw"
+    $LOGGER "curr default gateway: $new_ext_if_gw"
+    if [ -n "$new_ext_if_gw" -a "$new_ext_if_gw" != "$ext_if_gw" ];  then
+      $LOGGER "Reloading PF firewall to load new ext_if_gw=$new_ext_if_gw"
+      { grep -v '^ext_if_gw=' $rc_conf_running; echo "ext_if_gw=$new_ext_if_gw"; } > $rc_conf_running
+      $LOGGER "`/etc/rc.d/pf reload 2>&1`"
     fi
+  else
+    $LOGGER "is_default_interface: FALSE"
   fi
 
@@ -36,15 +40,14 @@
   checkyesno "service_proxy_ileiden" && return
 
-  if checkyesno "service_proxy_normal" && checkyesno "service_accesspoint"; then
-    warn "Removing default route as machine is marked as service_proxy AND service_accesspoint"
-    route -q del default
+  if [ -n "$new_ext_if_gw" ] && checkyesno "service_proxy_normal" && checkyesno "service_accesspoint"; then
+    $LOGGER "Removing default route as machine is marked as service_proxy AND service_accesspoint"
+    $LOGGER "`route -q del default 2>&1`"
   fi
 }
 
-reason=${reason:-$FORCE}
-
+reason=${reason:-${REASON:-"BOUND"}}
 case $reason in
   BOUND|RENEW|REBIND|REBOOT)
-    update_pf_conf 
+    update_pf_conf
     ;;
   TIMEOUT)
