diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 87adef9cc..2d6e5e243 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -2530,20 +2530,6 @@ function filter_rules_generate(&$FilterIflist) foreach ($FilterIflist as $on => $oc) { - - if (isset($config['system']['ipv6allow']) && isset($oc['type6']) && ($oc['type6'] == "slaac" || $oc['type6'] == "dhcp6")) { - $ipfrules .= <<getInterfaceMapping() as $intf => $intfinfo) { + // allow DHCPv6 client out + if (isset($config['system']['ipv6allow']) && in_array($intfinfo['ipaddrv6'], array("slaac","dhcp6"))) { + $fw->registerFilterRule(5, + array('protocol' => 'udp', 'from' => 'fe80::/10', 'from_port' => 546, 'to' => 'fe80::/10', + 'interface' => $intf, 'to_port' => 546, 'label' =>'allow dhcpv6 client in ' . $intfinfo['descr']), + $defaults['pass'] + ); + $fw->registerFilterRule(5, + array('protocol' => 'udp', 'from_port' => 547,'to_port' => 546, 'direction' => 'in', + 'interface' => $intf, 'label' =>'allow dhcpv6 client in ' . $intfinfo['descr']), + $defaults['pass'] + ); + $fw->registerFilterRule(5, + array('protocol' => 'udp', 'from_port' => 546,'to_port' => 547, 'direction' => 'out', + 'interface' => $intf, 'label' =>'allow dhcpv6 client in ' . $intfinfo['descr']), + $defaults['pass'] + ); + } + } }