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>
This commit is contained in:
parent
dba5c41942
commit
e4238aa34f
@ -982,8 +982,31 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
else
|
||||
{
|
||||
for (int j = 0; j < 16; j++)
|
||||
if (next[j] == 0)
|
||||
slowpath_indices[n_slowpath++] = i + j;
|
||||
{
|
||||
if (next[j] == 0)
|
||||
slowpath_indices[n_slowpath++] = i + j;
|
||||
else if (dmac_check && main_is_l3 && dmacs_bad[i + j])
|
||||
{
|
||||
next[j] = 0;
|
||||
slowpath_indices[n_slowpath++] = i + j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dmac_check && main_is_l3)
|
||||
{
|
||||
u8x16 dmac_bad = u8x16_load_unaligned (&dmacs_bad[i]);
|
||||
if (!u8x16_is_all_zero (dmac_bad))
|
||||
{
|
||||
for (int j = 0; j < 16; j++)
|
||||
if (dmacs_bad[i + j])
|
||||
{
|
||||
next[j] = 0;
|
||||
slowpath_indices[n_slowpath++] = i + j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -994,7 +1017,12 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (main_is_l3 && etype[0] == et_ip4)
|
||||
if (dmac_check && main_is_l3 && dmacs_bad[i])
|
||||
{
|
||||
next[0] = 0;
|
||||
slowpath_indices[n_slowpath++] = i;
|
||||
}
|
||||
else if (main_is_l3 && etype[0] == et_ip4)
|
||||
next[0] = next_ip4;
|
||||
else if (main_is_l3 && etype[0] == et_ip6)
|
||||
next[0] = next_ip6;
|
||||
@ -1052,7 +1080,7 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* untagged packet with not well known etyertype */
|
||||
/* untagged packet with not well known ethertype */
|
||||
if (last_unknown_etype != etype)
|
||||
{
|
||||
last_unknown_etype = etype;
|
||||
|
@ -391,7 +391,7 @@ class TestAbf(VppTestCase):
|
||||
# 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 @@ class TestAbf(VppTestCase):
|
||||
# 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 @@ class TestAbf(VppTestCase):
|
||||
# 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 @@ class TestAbf(VppTestCase):
|
||||
# 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)
|
||||
|
@ -559,7 +559,7 @@ class Flowprobe(MethodHolder):
|
||||
# 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)
|
||||
|
@ -405,7 +405,7 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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 @@ class TestGSO(VppTestCase):
|
||||
# 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)
|
||||
|
@ -36,7 +36,7 @@ class TestGtpuUDP(VppTestCase):
|
||||
|
||||
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 @@ class TestGtpuUDP(VppTestCase):
|
||||
|
||||
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)
|
||||
)
|
||||
|
@ -3409,9 +3409,11 @@ class TestIP6LinkLocal(VppTestCase):
|
||||
# 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):
|
||||
|
@ -161,7 +161,7 @@ class TestNDPROXY(VppTestCase):
|
||||
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)
|
||||
)
|
||||
|
@ -677,7 +677,7 @@ class TestIPIP(VppTestCase):
|
||||
/ 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 @@ class TestIPIPMPLS(VppTestCase):
|
||||
# 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 @@ class TestIPIPMPLS(VppTestCase):
|
||||
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")
|
||||
|
@ -126,7 +126,7 @@ class TestL3xc(VppTestCase):
|
||||
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)
|
||||
|
@ -126,7 +126,7 @@ class TestLinuxCP(VppTestCase):
|
||||
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()
|
||||
|
@ -494,7 +494,7 @@ class TestMAP(VppTestCase):
|
||||
#
|
||||
# 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
|
||||
|
@ -280,7 +280,7 @@ class TestMAPBR(VppTestCase):
|
||||
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 @@ class TestMAPBR(VppTestCase):
|
||||
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
|
||||
|
@ -2018,7 +2018,7 @@ class TestMPLS(VppTestCase):
|
||||
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)
|
||||
|
@ -216,7 +216,7 @@ class TestNAT44EDOutput(VppTestCase):
|
||||
# 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)
|
||||
)
|
||||
|
@ -2176,6 +2176,7 @@ class ARPTestCase(VppTestCase):
|
||||
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")
|
||||
|
@ -135,7 +135,7 @@ class TestPcap(VppTestCase):
|
||||
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)
|
||||
|
@ -1647,7 +1647,7 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
|
||||
# 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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
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 @@ class TestIPv6Reassembly(VppTestCase):
|
||||
)
|
||||
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 @@ class TestIPv6SVReassembly(VppTestCase):
|
||||
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 @@ class TestIPv6SVReassembly(VppTestCase):
|
||||
|
||||
# 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 @@ class TestIPv6SVReassembly(VppTestCase):
|
||||
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 @@ class TestIPv6SVReassembly(VppTestCase):
|
||||
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 @@ class TestIPv6SVReassembly(VppTestCase):
|
||||
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()
|
||||
|
@ -60,7 +60,7 @@ class TestSRv6EndMGTP4E(VppTestCase):
|
||||
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 @@ class TestSRv6TMGTP4D(VppTestCase):
|
||||
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 @@ class TestSRv6EndMGTP6E(VppTestCase):
|
||||
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 @@ class TestSRv6EndMGTP6D(VppTestCase):
|
||||
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)
|
||||
|
@ -386,7 +386,7 @@ class TestTraceFilterInner(TemplateTraceFilter):
|
||||
|
||||
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):
|
||||
|
@ -580,6 +580,7 @@ class TestVxlanL2Mode(VppTestCase):
|
||||
|
||||
# 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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user