Skip to content

Commit 2916d45

Browse files
authored
fix: ipv6 firewall icmpv6 sources [Backport 5.6.0] (#5973)
* fix(linux.net): Remove source restrictions for critical IPv6 ICMPv6 types ICMPv6 types 133-136 (Router/Neighbor Discovery) are essential for IPv6 connectivity and should not be restricted to fe80::/10 sources only. This restriction was breaking DNS resolution when DNS servers use ULA addresses (fd00::/8) or Global Unicast addresses (2000::/3). - Remove fe80::/10 source restriction for ICMPv6 types 133-136 - Add explanatory comment for the critical nature of these types - Fixes IPv6 connectivity issues with non-link-local DNS servers Tested with DNS servers using ULA addresses like fd63:50cc:f62:8::1 * fix(linux.net): Remove source restrictions for multicast IPv6 ICMPv6 types Extend the IPv6 firewall fix to include multicast-related ICMPv6 types that are essential for IPv6 multicast services and routing protocols. Removed fe80::/10 source restrictions for: - Type 130-132: Multicast Listener Discovery (MLD) - Type 151-153: Multicast Router Discovery This fixes issues with: - Multicast DNS (mDNS) resolution - DHCPv6 multicast communications - IPv6 routing protocols (OSPFv3, RIPng) - Service discovery (Bonjour, Avahi) - IoT protocols (Thread, Matter) using IPv6 multicast Inverse Neighbor Discovery (141-142) and Certificate Path (148-149) remain restricted to fe80::/10 as they are less critical for basic IPv6 connectivity. * Updated version Signed-off-by: MMaiero <[email protected]> * Added coverage tests Signed-off-by: MMaiero <[email protected]> * Tests alignment with develop Signed-off-by: MMaiero <[email protected]> --------- Signed-off-by: MMaiero <[email protected]>
1 parent 57f4bb5 commit 2916d45

File tree

4 files changed

+1162
-18
lines changed

4 files changed

+1162
-18
lines changed

kura/distrib/config/kura.build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ org.eclipse.kura.ble.provider.version=1.6.0
4747
org.eclipse.kura.ble.ibeacon.provider.version=1.6.0
4848
org.eclipse.kura.ble.eddystone.provider.version=1.6.0
4949
org.eclipse.kura.linux.command.version=1.6.0
50-
org.eclipse.kura.linux.net.version=2.6.0
50+
org.eclipse.kura.linux.net.version=2.6.1-SNAPSHOT
5151
org.eclipse.kura.linux.sysv.provider.version=1.6.0
5252
org.eclipse.kura.linux.systemd.provider.version=1.6.0
5353
org.eclipse.kura.linux.debian.provider.version=1.6.0

kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/iptables/IptablesConfigIPv6.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -35,20 +35,23 @@ public class IptablesConfigIPv6 extends IptablesConfig {
3535
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 145 -j ACCEPT",
3636
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 146 -j ACCEPT",
3737
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 147 -j ACCEPT",
38-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 130 -j ACCEPT",
39-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 131 -j ACCEPT",
40-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 132 -j ACCEPT",
41-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 133 -j ACCEPT",
42-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 134 -j ACCEPT",
43-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 135 -j ACCEPT",
44-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 136 -j ACCEPT",
38+
// Multicast Listener Discovery - essential for IPv6 multicast (mDNS, DHCPv6, etc.)
39+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 130 -j ACCEPT",
40+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 131 -j ACCEPT",
41+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 132 -j ACCEPT",
42+
// Critical Neighbor/Router Discovery - no source restriction for IPv6 connectivity
43+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 133 -j ACCEPT",
44+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 134 -j ACCEPT",
45+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 135 -j ACCEPT",
46+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 136 -j ACCEPT",
4547
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 141 -j ACCEPT",
4648
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 142 -j ACCEPT",
4749
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 148 -j ACCEPT",
4850
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 149 -j ACCEPT",
49-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 151 -j ACCEPT",
50-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 152 -j ACCEPT",
51-
"-A input-kura -s fe80::/10 -p ipv6-icmp -m ipv6-icmp --icmpv6-type 153 -j ACCEPT",
51+
// Multicast Router Discovery - essential for IPv6 routing protocols
52+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 151 -j ACCEPT",
53+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 152 -j ACCEPT",
54+
"-A input-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 153 -j ACCEPT",
5255
"-A forward-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 1 -j ACCEPT",
5356
"-A forward-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 2 -j ACCEPT",
5457
"-A forward-kura -p ipv6-icmp -m ipv6-icmp --icmpv6-type 3/0 -j ACCEPT",

0 commit comments

Comments
 (0)