Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178187300
D62222.1796217631.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D62222.1796217631.diff
View Options
diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c
--- a/sys/netinet6/ip6_fastfwd.c
+++ b/sys/netinet6/ip6_fastfwd.c
@@ -110,9 +110,13 @@
/*
* Fallback conditions to ip6_input for slow path processing.
+ * A packet this host looped back to one of its own addresses
+ * (M_LOOP) can be for an address in6_localip_fib() does not match,
+ * such as a carp(4) address in BACKUP state; forwarding it would
+ * loop it again.
*/
ip6 = mtod(m, struct ip6_hdr *);
- if ((m->m_flags & (M_BCAST | M_MCAST)) != 0 ||
+ if ((m->m_flags & (M_BCAST | M_MCAST | M_LOOP)) != 0 ||
ip6->ip6_nxt == IPPROTO_HOPOPTS ||
IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) ||
diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh
--- a/tests/sys/netinet/carp.sh
+++ b/tests/sys/netinet/carp.sh
@@ -653,6 +653,51 @@
vnet_cleanup
}
+atf_test_case "backup_local_v6" "cleanup"
+backup_local_v6_head()
+{
+ atf_set descr 'Test that a BACKUP router reaches its own address (IPv6)'
+ atf_set require.user root
+}
+
+backup_local_v6_body()
+{
+ carp_init
+
+ epair=$(vnet_mkepair)
+
+ vnet_mkjail carp_bl_v6_master ${epair}a
+ vnet_mkjail carp_bl_v6_backup ${epair}b
+
+ ifconfig -j carp_bl_v6_master ${epair}a inet6 2001:db8::1/64 up \
+ no_dad
+ ifconfig -j carp_bl_v6_master ${epair}a inet6 add vhid 1 \
+ advskew 0 2001:db8::10/64
+
+ sysctl -j carp_bl_v6_backup net.inet6.ip6.forwarding=1
+ ifconfig -j carp_bl_v6_backup ${epair}b inet6 2001:db8::2/64 up \
+ no_dad
+ ifconfig -j carp_bl_v6_backup ${epair}b inet6 add vhid 1 \
+ advskew 100 2001:db8::10/64
+
+ wait_for_carp carp_bl_v6_master ${epair}a \
+ carp_bl_v6_backup ${epair}b
+ atf_check -o match:'carp: BACKUP' \
+ ifconfig -j carp_bl_v6_backup ${epair}b
+
+ # The ping comes back through lo0 and must not be forwarded again.
+ for redirect in 0 1; do
+ sysctl -j carp_bl_v6_backup net.inet6.ip6.redirect=${redirect}
+ atf_check -o ignore jexec carp_bl_v6_backup \
+ ping -6 -c 1 -W 1 2001:db8::10
+ done
+}
+
+backup_local_v6_cleanup()
+{
+ vnet_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "basic_v4"
@@ -666,4 +711,5 @@
atf_add_test_case "nd6_ns_source_mac"
atf_add_test_case "vrrp_preempt"
atf_add_test_case "switch"
+ atf_add_test_case "backup_local_v6"
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 2, 1:20 PM (9 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42146874
Default Alt Text
D62222.1796217631.diff (2 KB)
Attached To
Mode
D62222: netinet6: Leave looped-back packets to ip6_input() in ip6_tryforward()
Attached
Detach File
Event Timeline