From 8e3d1763ef15bc9b4cb56310d32279fdafa7eaf1 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 3 Nov 2016 16:51:25 +0100 Subject: [PATCH] (filter) move DHCPv6 client rules --- src/etc/inc/filter.inc | 14 -------------- src/etc/inc/filter.lib.inc | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 14 deletions(-) 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'] + ); + } + } }