From 4a41dff7afe60a6bd228019f2bccd1e5577cdf6e Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 4 Apr 2012 15:53:37 +0200 Subject: [PATCH] Bail out without a valid IPv6 address so we don't generate a invalid dhcpv6 server config --- etc/inc/services.inc | 3 ++- etc/rc.update_bogons.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 22bfb6140b..d6ba3cde9b 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -670,9 +670,10 @@ function services_dhcpdv6_configure() { /* we add a fake entry for interfaces that are set to track6 another WAN */ foreach($Iflist as $ifname) { $realif = get_real_interface($ifname); - $ifcfgipv6 = Net_IPv6::getNetmask(find_interface_ipv6($realif), 64); + $ifcfgipv6 = find_interface_ipv6($realif); if(!is_ipaddrv6($ifcfgipv6)) continue; + $ifcfgipv6 = Net_IPv6::getNetmask($ifcfgipv6, 64); if($config['interfaces'][$ifname]['track6-interface'] <> "") { $trackifname = $config['interfaces'][$ifname]['track6-interface']; $trackcfg = $config['interfaces'][$trackifname]; diff --git a/etc/rc.update_bogons.sh b/etc/rc.update_bogons.sh index aec80a13f3..37d2c6de8c 100755 --- a/etc/rc.update_bogons.sh +++ b/etc/rc.update_bogons.sh @@ -21,22 +21,22 @@ echo "rc.update_bogons.sh is beginning the update cycle." | logger /etc/rc.conf_mount_rw /usr/bin/fetch -q -o /tmp/bogons "http://files.pfsense.org/mirrors/bogon-bn-nonagg.txt" -if [ ! -f /tmp/bogons ]; then - echo "Could not download http://files.pfsense.org/mirrors/bogon-bn-nonagg.txt" | logger - # Relaunch and sleep - sh /etc/rc.update_bogons.sh & - exit -fi - /usr/bin/fetch -q -o /tmp/bogonsv6 "http://files.pfsense.org/mirrors/fullbogons-ipv6.txt" +if [ ! -f /tmp/bogons ]; + echo "Could not download http://files.pfsense.org/mirrors/bogon-bn-nonagg.txt" | logger + dl_error="true" +fi if [ ! -f /tmp/bogonsv6 ]; then echo "Could not download http://files.pfsense.org/mirrors/fullbogons-ipv6.txt" | logger + dl_error="true" +fi + +if [ "$dl_error" != "" ];then # Relaunch and sleep sh /etc/rc.update_bogons.sh & exit fi - BOGON_MD5=`/usr/bin/fetch -q -o - "http://files.pfsense.org/mirrors/bogon-bn-nonagg.txt.md5" | awk '{ print $4 }'` ON_DISK_MD5=`md5 /tmp/bogons | awk '{ print $4 }'` if [ "$BOGON_MD5" = "$ON_DISK_MD5" ]; then