summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorjim-p <jimp@netgate.com>2018-08-27 11:58:19 -0400
committerjim-p <jimp@netgate.com>2018-08-27 11:58:19 -0400
commit2456ecc9ad7fe6fe5ee7de4a0d44247a29289793 (patch)
treeb9e4a5f1e29f8e3668506b23b8c608bbdd7b1a28 /src/etc
parentc45cac34db914f175dc3cbfed8119d08d08aa519 (diff)
downloadpfsense-2456ecc9ad7fe6fe5ee7de4a0d44247a29289793.zip
pfsense-2456ecc9ad7fe6fe5ee7de4a0d44247a29289793.tar.gz
Fix some integer assumptions with calculate_ipv6_delegation_length()
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/inc/filter.inc2
-rw-r--r--src/etc/inc/pfsense-utils.inc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc
index 5853abe..eb42dd5 100644
--- a/src/etc/inc/filter.inc
+++ b/src/etc/inc/filter.inc
@@ -3714,7 +3714,7 @@ EOD;
$gwv6 = get_interface_gateway_v6($ifdescr);
$stf = get_real_interface($ifdescr, "inet6");
- $pdlen = 64 - calculate_ipv6_delegation_length($ifdescr);
+ $pdlen = 64 - (int) calculate_ipv6_delegation_length($ifdescr);
$routeto = (substr($ifcfg['if'], 0, 5) != "ipsec") ? "route-to ( {$stf} {$gwv6} )" : "";
if (is_ipaddrv6($gwv6) && is_ipaddrv6($ifcfg['ipv6']) && is_subnetv6("{$ifcfg['ipv6']}/{$pdlen}")) {
$ipfrules .= "pass out {$log['pass']} {$routeto} inet6 from {$ifcfg['ipv6']} to !{$ifcfg['ipv6']}/{$pdlen} tracker {$increment_tracker($tracker)} keep state allow-opts label \"let out anything from firewall host itself\"\n";
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc
index 7099d60..6dab50f 100644
--- a/src/etc/inc/pfsense-utils.inc
+++ b/src/etc/inc/pfsense-utils.inc
@@ -3111,7 +3111,7 @@ function calculate_ipv6_delegation_length($if) {
case "6rd":
$rd6cfg = $config['interfaces'][$if];
$rd6plen = explode("/", $rd6cfg['prefix-6rd']);
- $pdlen = (64 - ($rd6plen[1] + (32 - $rd6cfg['prefix-6rd-v4plen'])));
+ $pdlen = (64 - ((int) $rd6plen[1] + (32 - (int) $rd6cfg['prefix-6rd-v4plen'])));
break;
case "dhcp6":
$dhcp6cfg = $config['interfaces'][$if];
OpenPOWER on IntegriCloud