ethernet: check destination mac for L3 in ethernet-input node
When the NIC does not support mac filter, we rely on ethernet-input
node to do the destination mac check, ie, when the interface is in L3,
the mac address for the packet must be the mac address of the
interface where the packet arrives. This works fine in ethernet-input
node when all packets in the frame might have different interfaces, ie,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is not set in the frame. However,
when all packets are having the same interface,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is set, ethernet-input node goes
through the optimized routine eth_input_single_int -> eth_input_process_frame.
That is where dmac check has a bug when all packets in the frame are
either, ip4, ip6, or mpls without vlan tags. Because without vlan tags,
the code handles all packets in fast path and ignores dmac check.
With vlan tags, the code goes to slow path where dmac check is handled
properly.
The fix is to check if we have a bad dmac in the fast path and force the
code to go to slow path which will handle dmac check properly.
Also do a wholesale correction on all the testcases which do not use
the proper dmac when sending L3 packets.
Type: fix
Change-Id: I73153a805cecdc24c4eefcc781676de04737ae2c
Signed-off-by: Steven Luong <sluong@cisco.com>
diff --git a/test/test_abf.py b/test/test_abf.py
index 3baec9f..ec329a0 100644
--- a/test/test_abf.py
+++ b/test/test_abf.py
@@ -391,7 +391,7 @@
# a packet matching the deny rule
#
p_deny = (
- Ether(src=self.pg0.remote_mac, dst=self.pg3.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IP(src=self.pg0.remote_ip4, dst=self.pg3.remote_ip4)
/ UDP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 100)
@@ -402,7 +402,7 @@
# a packet matching the permit rule
#
p_permit = (
- Ether(src=self.pg0.remote_mac, dst=self.pg2.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IP(src=self.pg0.remote_ip4, dst=self.pg2.remote_ip4)
/ UDP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 100)
@@ -454,7 +454,7 @@
# a packet matching the deny rule
#
p_deny = (
- Ether(src=self.pg0.remote_mac, dst=self.pg3.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg3.remote_ip6)
/ UDP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 100)
@@ -465,7 +465,7 @@
# a packet matching the permit rule
#
p_permit = (
- Ether(src=self.pg0.remote_mac, dst=self.pg2.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg2.remote_ip6)
/ UDP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 100)
diff --git a/test/test_flowprobe.py b/test/test_flowprobe.py
index ac0433a..8e3fecf 100644
--- a/test/test_flowprobe.py
+++ b/test/test_flowprobe.py
@@ -559,7 +559,7 @@
# make a tcp packet
self.pkts = [
(
- Ether(src=self.pg3.remote_mac, dst=self.pg4.local_mac)
+ Ether(src=self.pg3.remote_mac, dst=self.pg3.local_mac)
/ IP(src=self.pg3.remote_ip4, dst=self.pg4.remote_ip4)
/ TCP(sport=1234, dport=4321)
/ Raw(b"\xa5" * 50)
diff --git a/test/test_gso.py b/test/test_gso.py
index 1db83be..3d9ce5f 100644
--- a/test/test_gso.py
+++ b/test/test_gso.py
@@ -405,7 +405,7 @@
# IPv4/IPv4 - VXLAN
#
p45 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -424,7 +424,7 @@
inner = rx[VXLAN].payload
self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
- self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+ self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
self.assertEqual(inner[IP].dst, "172.16.3.3")
self.assert_ip_checksum_valid(inner)
@@ -438,7 +438,7 @@
# IPv4/IPv6 - VXLAN
#
p65 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -457,7 +457,7 @@
inner = rx[VXLAN].payload
self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
- self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+ self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
self.assertEqual(inner[IPv6].dst, "fd01:3::3")
self.assert_tcp_checksum_valid(inner)
@@ -483,7 +483,7 @@
# IPv6/IPv4 - VXLAN
#
p46 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -501,7 +501,7 @@
inner = rx[VXLAN].payload
self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
- self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+ self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
self.assertEqual(inner[IP].dst, "172.16.3.3")
self.assert_ip_checksum_valid(inner)
@@ -515,7 +515,7 @@
# IPv6/IPv6 - VXLAN
#
p66 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -533,7 +533,7 @@
inner = rx[VXLAN].payload
self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
- self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+ self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
self.assertEqual(inner[IPv6].dst, "fd01:3::3")
self.assert_tcp_checksum_valid(inner)
@@ -590,7 +590,7 @@
# IPv4/IPv4 - IPIP
#
p47 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -633,7 +633,7 @@
# IPv4/IPv6 - IPIP
#
p67 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -731,7 +731,7 @@
# IPv6/IPv4 - IPIP
#
p48 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -774,7 +774,7 @@
# IPv6/IPv6 - IPIP
#
p68 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -842,7 +842,7 @@
self.ip4_via_gre4_tunnel.add_vpp_config()
pgre4 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -952,7 +952,7 @@
# Create IPv6 packet
#
pgre6 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -1078,7 +1078,7 @@
# IPv4/IPv4 - IPSEC
#
ipsec44 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -1116,7 +1116,7 @@
# IPv4/IPv6 - IPSEC
#
ipsec46 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -1213,7 +1213,7 @@
# IPv6/IPv4 - IPSEC
#
ipsec64 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
@@ -1252,7 +1252,7 @@
# IPv6/IPv6 - IPSEC
#
ipsec66 = (
- Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
/ TCP(sport=1234, dport=1234)
/ Raw(b"\xa5" * 65200)
diff --git a/test/test_gtpu.py b/test/test_gtpu.py
index fd97205..5fe4f36 100644
--- a/test/test_gtpu.py
+++ b/test/test_gtpu.py
@@ -36,7 +36,7 @@
def _check_udp_port_ip4(self, enabled=True):
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4)
/ UDP(sport=self.dport, dport=self.dport, chksum=0)
)
@@ -55,7 +55,7 @@
def _check_udp_port_ip6(self, enabled=True):
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
/ UDP(sport=self.dport, dport=self.dport, chksum=0)
)
diff --git a/test/test_ip6.py b/test/test_ip6.py
index a1cd943..84b060a 100644
--- a/test/test_ip6.py
+++ b/test/test_ip6.py
@@ -3409,9 +3409,11 @@
# Use the specific link-local API on pg1
#
VppIp6LinkLocalAddress(self, self.pg1, ll1).add_vpp_config()
+ p_echo_request_1.dst = self.pg1.local_mac
self.send_and_expect(self.pg1, [p_echo_request_1], self.pg1)
VppIp6LinkLocalAddress(self, self.pg1, ll3).add_vpp_config()
+ p_echo_request_3.dst = self.pg1.local_mac
self.send_and_expect(self.pg1, [p_echo_request_3], self.pg1)
def test_ip6_ll_p2p(self):
diff --git a/test/test_ip6_nd_mirror_proxy.py b/test/test_ip6_nd_mirror_proxy.py
index 6520992..10dc77e 100644
--- a/test/test_ip6_nd_mirror_proxy.py
+++ b/test/test_ip6_nd_mirror_proxy.py
@@ -161,7 +161,7 @@
redirect.add_vpp_config()
echo_reply = (
- Ether(dst=self.pg0.remote_mac, src=self.pg0.local_mac)
+ Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac)
/ IPv6(dst=self.pg0.local_ip6, src=self.pg0.remote_ip6)
/ ICMPv6EchoReply(seq=1, id=id)
)
diff --git a/test/test_ipip.py b/test/test_ipip.py
index 2817d5a..9574c2c 100644
--- a/test/test_ipip.py
+++ b/test/test_ipip.py
@@ -677,7 +677,7 @@
/ Raw(b"0x44" * 100)
)
tx_e = [
- (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / inner)
+ (Ether(dst=self.pg2.local_mac, src=self.pg0.remote_mac) / inner)
for x in range(63)
]
@@ -1454,7 +1454,7 @@
# Tunnel Decap
#
p4 = (
- self.p_ether
+ Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
/ IP(src=self.pg1.remote_ip4, dst=self.pg1.local_ip4)
/ MPLS(label=44, ttl=4)
/ IP(src="1.1.1.1", dst="2.2.2.2")
@@ -1468,7 +1468,7 @@
self.assertEqual(rx[IP].dst, "2.2.2.2")
p6 = (
- self.p_ether
+ Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
/ IPv6(src=self.pg1.remote_ip6, dst=self.pg1.local_ip6)
/ MPLS(label=66, ttl=4)
/ IPv6(src="1::1", dst="2::2")
diff --git a/test/test_l3xc.py b/test/test_l3xc.py
index 351c599..69267b3 100644
--- a/test/test_l3xc.py
+++ b/test/test_l3xc.py
@@ -126,7 +126,7 @@
p_2 = []
for ii in range(NUM_PKTS):
p_2.append(
- Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
+ Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
/ IP(src="1.1.1.1", dst="1.1.1.2")
/ UDP(sport=1000 + ii, dport=1234)
/ Raw(b"\xa5" * 100)
diff --git a/test/test_linux_cp.py b/test/test_linux_cp.py
index a9ff242..95a9f1a 100644
--- a/test/test_linux_cp.py
+++ b/test/test_linux_cp.py
@@ -126,7 +126,7 @@
for phy, host in zip(phys, hosts):
for j in range(N_HOSTS):
p = (
- Ether(src=phy.local_mac, dst=phy.remote_hosts[j].mac)
+ Ether(src=phy.local_mac, dst=host.local_mac)
/ IP(src=phy.local_ip4, dst=phy.remote_hosts[j].ip4)
/ UDP(sport=1234, dport=1234)
/ Raw()
diff --git a/test/test_map.py b/test/test_map.py
index 565f7da..c65c5df 100644
--- a/test/test_map.py
+++ b/test/test_map.py
@@ -494,7 +494,7 @@
#
# Send a v4 packet that will be encapped.
#
- p_ether = Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac)
+ p_ether = Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac)
p_ip4 = IP(src=self.pg0.remote_ip4, dst="192.168.1.1")
p_tcp = TCP(sport=20000, dport=30000, flags="S", options=[("MSS", 1455)])
p4 = p_ether / p_ip4 / p_tcp
diff --git a/test/test_map_br.py b/test/test_map_br.py
index 0de0e31..a2c00d8 100644
--- a/test/test_map_br.py
+++ b/test/test_map_br.py
@@ -280,7 +280,7 @@
def test_map_t_echo_request_ip4_to_ip6(self):
"""MAP-T echo request IPv4 -> IPv6"""
- eth = Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+ eth = Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
icmp = ICMP(type="echo-request", id=self.ipv6_udp_or_tcp_map_port)
payload = "H" * 10
@@ -306,7 +306,7 @@
def test_map_t_echo_reply_ip4_to_ip6(self):
"""MAP-T echo reply IPv4 -> IPv6"""
- eth = Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+ eth = Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
icmp = ICMP(type="echo-reply", id=self.ipv6_udp_or_tcp_map_port)
payload = "H" * 10
diff --git a/test/test_mpls.py b/test/test_mpls.py
index 9c07251..0e747ec 100644
--- a/test/test_mpls.py
+++ b/test/test_mpls.py
@@ -2018,7 +2018,7 @@
binding.add_vpp_config()
tx = (
- Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ MPLS(label=44, ttl=64)
/ IP(src=self.pg0.remote_ip4, dst=self.pg0.remote_ip4)
/ UDP(sport=1234, dport=1234)
diff --git a/test/test_nat44_ed_output.py b/test/test_nat44_ed_output.py
index ad1c561..dbf1dc4 100644
--- a/test/test_nat44_ed_output.py
+++ b/test/test_nat44_ed_output.py
@@ -216,7 +216,7 @@
# send FIN+ACK packet in->out - will cause session to be wiped
# but won't create a new session
p = (
- Ether(src=pg0.remote_mac, dst=pg0.local_mac)
+ Ether(src=pg1.remote_mac, dst=pg1.local_mac)
/ IP(src=local_host, dst=remote_host)
/ TCP(sport=local_sport, dport=remote_dport, flags="FA", seq=300, ack=101)
)
diff --git a/test/test_neighbor.py b/test/test_neighbor.py
index 6fcf13f..d11d4ab 100644
--- a/test/test_neighbor.py
+++ b/test/test_neighbor.py
@@ -2176,6 +2176,7 @@
table_id=1,
).add_vpp_config()
+ p2.dst = self.pg3.local_mac
rxs = self.send_and_expect(self.pg3, [p2], self.pg1)
for rx in rxs:
self.verify_arp_req(rx, self.pg1.local_mac, "10.0.1.2", "10.0.1.128")
diff --git a/test/test_pcap.py b/test/test_pcap.py
index ae3a298..72d215c 100644
--- a/test/test_pcap.py
+++ b/test/test_pcap.py
@@ -135,7 +135,7 @@
self.vapi.cli("classify filter pcap del mask l3 ip4 src")
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
# wrong destination address
/ IP(src=self.pg0.local_ip4, dst=self.pg0.local_ip4, ttl=2)
/ UDP(sport=1234, dport=2345)
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index 6b6745f..98c50f9 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -1647,7 +1647,7 @@
def test_atomic_fragment(self):
"""IPv6 atomic fragment"""
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6, nh=44, plen=65535)
/ IPv6ExtHdrFragment(
offset=8191, m=1, res1=0xFF, res2=0xFF, nh=255, id=0xFFFF
@@ -1669,7 +1669,7 @@
self.send_and_assert_no_replies(self.pg0, [pkt])
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6)
/ ICMPv6EchoRequest()
)
@@ -1678,7 +1678,7 @@
def test_one_fragment(self):
"""whole packet in one fragment processed independently"""
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
/ ICMPv6EchoRequest()
/ Raw("X" * 1600)
@@ -1690,7 +1690,7 @@
# send an atomic fragment with same id - should be reassembled
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
/ IPv6ExtHdrFragment(id=1)
/ ICMPv6EchoRequest()
@@ -1705,7 +1705,7 @@
def test_bunch_of_fragments(self):
"""valid fragments followed by rogue fragments and atomic fragment"""
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
/ ICMPv6EchoRequest()
/ Raw("X" * 1600)
@@ -1723,7 +1723,7 @@
self.send_and_assert_no_replies(self.pg0, inc_frag * 604)
pkt = (
- Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+ Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
/ IPv6ExtHdrFragment(id=1)
/ ICMPv6EchoRequest()
@@ -1738,7 +1738,7 @@
)
self.vapi.ip_local_reass_enable_disable(enable_ip6=True)
pkt = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.src_if.local_ip6)
/ ICMPv6EchoRequest(id=1234)
/ Raw("X" * 1600)
@@ -2184,7 +2184,7 @@
def test_one_fragment(self):
"""whole packet in one fragment processed independently"""
pkt = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
/ ICMPv6EchoRequest()
/ Raw("X" * 1600)
@@ -2196,7 +2196,7 @@
# send an atomic fragment with same id - should be reassembled
pkt = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
/ IPv6ExtHdrFragment(id=1)
/ ICMPv6EchoRequest()
@@ -2209,7 +2209,7 @@
def test_bunch_of_fragments(self):
"""valid fragments followed by rogue fragments and atomic fragment"""
pkt = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
/ ICMPv6EchoRequest()
/ Raw("X" * 1600)
@@ -2218,7 +2218,7 @@
rx = self.send_and_expect(self.src_if, frags, self.dst_if)
rogue = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
/ IPv6ExtHdrFragment(id=1, nh=58, offset=608)
/ Raw("X" * 308)
@@ -2227,7 +2227,7 @@
self.send_and_expect(self.src_if, rogue * 604, self.dst_if)
pkt = (
- Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+ Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
/ IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
/ IPv6ExtHdrFragment(id=1)
/ ICMPv6EchoRequest()
diff --git a/test/test_srv6_mobile.py b/test/test_srv6_mobile.py
index 9d39f19..314dfc1 100644
--- a/test/test_srv6_mobile.py
+++ b/test/test_srv6_mobile.py
@@ -60,7 +60,7 @@
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ IPv6ExtHdrSegmentRouting()
/ IPv6(dst=d, src=s)
@@ -149,7 +149,7 @@
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IP(dst=str(ip4_dst), src=str(ip4_src))
/ UDP(sport=2152, dport=2152)
/ GTP_U_Header(gtp_type="g_pdu", teid=200)
@@ -254,7 +254,7 @@
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ IPv6ExtHdrSegmentRouting(
segleft=1, lastentry=0, tag=0, addresses=["a1::1"]
@@ -344,7 +344,7 @@
pkts = list()
for d, s in inner:
pkt = (
- Ether()
+ Ether(dst=self.pg0.local_mac)
/ IPv6(dst=str(ip6_dst), src=str(ip6_src))
/ UDP(sport=2152, dport=2152)
/ GTP_U_Header(gtp_type="g_pdu", teid=200)
diff --git a/test/test_trace_filter.py b/test/test_trace_filter.py
index 58494cd..c188631 100644
--- a/test/test_trace_filter.py
+++ b/test/test_trace_filter.py
@@ -386,7 +386,7 @@
def __gen_encrypt_pkt(self, scapy_sa, pkt):
return Ether(
- src=self.pg0.local_mac, dst=self.pg0.remote_mac
+ src=self.pg0.remote_mac, dst=self.pg0.local_mac
) / scapy_sa.encrypt(pkt)
def test_encrypted_encap(self):
diff --git a/test/test_vxlan.py b/test/test_vxlan.py
index 6128d10..284e135 100644
--- a/test/test_vxlan.py
+++ b/test/test_vxlan.py
@@ -580,6 +580,7 @@
# Send packets
NUM_PKTS = 128
+ p.dst = self.pg1.local_mac
rx = self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg0)
self.assertEqual(NUM_PKTS, len(rx))