From 4ce3a9ea61d0aebd06f0e8692cf8261a1bbd2604 Mon Sep 17 00:00:00 2001 From: Open vSwitch CI Date: Jun 06 2024 02:21:53 +0000 Subject: Import openvswitch2.17-2.17.0-156 from Fast DataPath --- diff --git a/SOURCES/openvswitch-2.17.0.patch b/SOURCES/openvswitch-2.17.0.patch index f858dcd..21dc077 100644 --- a/SOURCES/openvswitch-2.17.0.patch +++ b/SOURCES/openvswitch-2.17.0.patch @@ -99089,7 +99089,7 @@ index bbb31ef275..7054f8e745 100644 struct hook *h = &hooks[i]; if (h->cancel_cb) { diff --git a/lib/flow.c b/lib/flow.c -index dd523c889b..418c3c4f48 100644 +index dd523c889b..98c38a7bd9 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -1950,7 +1950,7 @@ flow_wildcards_init_for_packet(struct flow_wildcards *wc, @@ -99101,6 +99101,31 @@ index dd523c889b..418c3c4f48 100644 WC_MASK_FIELD(wc, nw_tos); WC_MASK_FIELD(wc, nw_ttl); WC_MASK_FIELD(wc, nw_proto); +@@ -3345,6 +3345,24 @@ flow_compose(struct dp_packet *p, const struct flow *flow, + arp->ar_sha = flow->arp_sha; + arp->ar_tha = flow->arp_tha; + } ++ } else if (flow->dl_type == htons(ETH_TYPE_NSH)) { ++ struct nsh_hdr *nsh; ++ ++ nsh = dp_packet_put_zeros(p, sizeof *nsh); ++ dp_packet_set_l3(p, nsh); ++ ++ nsh_set_flags_ttl_len(nsh, flow->nsh.flags, flow->nsh.ttl, ++ flow->nsh.mdtype == NSH_M_TYPE1 ++ ? NSH_M_TYPE1_LEN : NSH_BASE_HDR_LEN); ++ nsh->next_proto = flow->nsh.np; ++ nsh->md_type = flow->nsh.mdtype; ++ put_16aligned_be32(&nsh->path_hdr, flow->nsh.path_hdr); ++ ++ if (flow->nsh.mdtype == NSH_M_TYPE1) { ++ for (size_t i = 0; i < 4; i++) { ++ put_16aligned_be32(&nsh->md1.context[i], flow->nsh.context[i]); ++ } ++ } + } + + if (eth_type_mpls(flow->dl_type)) { diff --git a/lib/hash.c b/lib/hash.c index c722f3c3cc..3d574de9b4 100644 --- a/lib/hash.c @@ -99285,10 +99310,101 @@ index 15cef5d003..7108c104a4 100644 } ovs_list_poison(&pool->free_slabs); diff --git a/lib/ipf.c b/lib/ipf.c -index 507db2aea2..d452663743 100644 +index 507db2aea2..1f22df98e0 100644 --- a/lib/ipf.c +++ b/lib/ipf.c -@@ -1058,9 +1058,9 @@ ipf_send_completed_frags(struct ipf *ipf, struct dp_packet_batch *pb, +@@ -504,13 +504,15 @@ ipf_reassemble_v6_frags(struct ipf_list *ipf_list) + } + + /* Called when a frag list state transitions to another state. This is +- * triggered by new fragment for the list being received.*/ +-static void ++* triggered by new fragment for the list being received. Returns a reassembled ++* packet if this fragment has completed one. */ ++static struct reassembled_pkt * + ipf_list_state_transition(struct ipf *ipf, struct ipf_list *ipf_list, + bool ff, bool lf, bool v6) + OVS_REQUIRES(ipf->ipf_lock) + { + enum ipf_list_state curr_state = ipf_list->state; ++ struct reassembled_pkt *ret = NULL; + enum ipf_list_state next_state; + switch (curr_state) { + case IPF_LIST_STATE_UNUSED: +@@ -560,12 +562,15 @@ ipf_list_state_transition(struct ipf *ipf, struct ipf_list *ipf_list, + ipf_reassembled_list_add(&ipf->reassembled_pkt_list, rp); + ipf_expiry_list_remove(ipf_list); + next_state = IPF_LIST_STATE_COMPLETED; ++ ret = rp; + } else { + next_state = IPF_LIST_STATE_REASS_FAIL; + } + } + } + ipf_list->state = next_state; ++ ++ return ret; + } + + /* Some sanity checks are redundant, but prudent, in case code paths for +@@ -797,7 +802,8 @@ ipf_is_frag_duped(const struct ipf_frag *frag_list, int last_inuse_idx, + static bool + ipf_process_frag(struct ipf *ipf, struct ipf_list *ipf_list, + struct dp_packet *pkt, uint16_t start_data_byte, +- uint16_t end_data_byte, bool ff, bool lf, bool v6) ++ uint16_t end_data_byte, bool ff, bool lf, bool v6, ++ struct reassembled_pkt **rp) + OVS_REQUIRES(ipf->ipf_lock) + { + bool duped_frag = ipf_is_frag_duped(ipf_list->frag_list, +@@ -818,7 +824,7 @@ ipf_process_frag(struct ipf *ipf, struct ipf_list *ipf_list, + ipf_list->last_inuse_idx++; + atomic_count_inc(&ipf->nfrag); + ipf_count(ipf, v6, IPF_NFRAGS_ACCEPTED); +- ipf_list_state_transition(ipf, ipf_list, ff, lf, v6); ++ *rp = ipf_list_state_transition(ipf, ipf_list, ff, lf, v6); + } else { + OVS_NOT_REACHED(); + } +@@ -851,7 +857,8 @@ ipf_list_init(struct ipf_list *ipf_list, struct ipf_list_key *key, + * to a list of fragemnts. */ + static bool + ipf_handle_frag(struct ipf *ipf, struct dp_packet *pkt, ovs_be16 dl_type, +- uint16_t zone, long long now, uint32_t hash_basis) ++ uint16_t zone, long long now, uint32_t hash_basis, ++ struct reassembled_pkt **rp) + OVS_REQUIRES(ipf->ipf_lock) + { + struct ipf_list_key key; +@@ -920,7 +927,7 @@ ipf_handle_frag(struct ipf *ipf, struct dp_packet *pkt, ovs_be16 dl_type, + } + + return ipf_process_frag(ipf, ipf_list, pkt, start_data_byte, +- end_data_byte, ff, lf, v6); ++ end_data_byte, ff, lf, v6, rp); + } + + /* Filters out fragments from a batch of fragments and adjust the batch. */ +@@ -939,11 +946,17 @@ ipf_extract_frags_from_batch(struct ipf *ipf, struct dp_packet_batch *pb, + || + (dl_type == htons(ETH_TYPE_IPV6) && + ipf_is_valid_v6_frag(ipf, pkt)))) { ++ struct reassembled_pkt *rp = NULL; + + ovs_mutex_lock(&ipf->ipf_lock); +- if (!ipf_handle_frag(ipf, pkt, dl_type, zone, now, hash_basis)) { ++ if (!ipf_handle_frag(ipf, pkt, dl_type, zone, now, hash_basis, ++ &rp)) { + dp_packet_batch_refill(pb, pkt, pb_idx); + } else { ++ if (rp && !dp_packet_batch_is_full(pb)) { ++ dp_packet_batch_refill(pb, rp->pkt, pb_idx); ++ rp->list->reass_execute_ctx = rp->pkt; ++ } + dp_packet_delete(pkt); + } + ovs_mutex_unlock(&ipf->ipf_lock); +@@ -1058,9 +1071,12 @@ ipf_send_completed_frags(struct ipf *ipf, struct dp_packet_batch *pb, } ovs_mutex_lock(&ipf->ipf_lock); @@ -99297,10 +99413,13 @@ index 507db2aea2..d452663743 100644 - LIST_FOR_EACH_SAFE (ipf_list, next, list_node, &ipf->frag_complete_list) { + LIST_FOR_EACH_SAFE (ipf_list, list_node, &ipf->frag_complete_list) { ++ if ((ipf_list->key.dl_type == htons(ETH_TYPE_IPV6)) != v6) { ++ continue; ++ } if (ipf_send_frags_in_list(ipf, ipf_list, pb, IPF_FRAG_COMPLETED_LIST, v6, now)) { ipf_completed_list_clean(&ipf->frag_lists, ipf_list); -@@ -1090,10 +1090,10 @@ ipf_send_expired_frags(struct ipf *ipf, struct dp_packet_batch *pb, +@@ -1090,10 +1106,13 @@ ipf_send_expired_frags(struct ipf *ipf, struct dp_packet_batch *pb, } ovs_mutex_lock(&ipf->ipf_lock); @@ -99310,10 +99429,22 @@ index 507db2aea2..d452663743 100644 - LIST_FOR_EACH_SAFE (ipf_list, next, list_node, &ipf->frag_exp_list) { + LIST_FOR_EACH_SAFE (ipf_list, list_node, &ipf->frag_exp_list) { ++ if ((ipf_list->key.dl_type == htons(ETH_TYPE_IPV6)) != v6) { ++ continue; ++ } if (now <= ipf_list->expiration || lists_removed >= IPF_FRAG_LIST_MAX_EXPIRED) { break; -@@ -1121,9 +1121,9 @@ ipf_execute_reass_pkts(struct ipf *ipf, struct dp_packet_batch *pb) +@@ -1114,17 +1133,19 @@ ipf_send_expired_frags(struct ipf *ipf, struct dp_packet_batch *pb, + /* Adds a reassmebled packet to a packet batch to be processed by the caller. + */ + static void +-ipf_execute_reass_pkts(struct ipf *ipf, struct dp_packet_batch *pb) ++ipf_execute_reass_pkts(struct ipf *ipf, struct dp_packet_batch *pb, ++ ovs_be16 dl_type) + { + if (ovs_list_is_empty(&ipf->reassembled_pkt_list)) { + return; } ovs_mutex_lock(&ipf->ipf_lock); @@ -99323,9 +99454,11 @@ index 507db2aea2..d452663743 100644 - LIST_FOR_EACH_SAFE (rp, next, rp_list_node, &ipf->reassembled_pkt_list) { + LIST_FOR_EACH_SAFE (rp, rp_list_node, &ipf->reassembled_pkt_list) { if (!rp->list->reass_execute_ctx && ++ rp->list->key.dl_type == dl_type && ipf_dp_packet_batch_add(pb, rp->pkt, false)) { rp->list->reass_execute_ctx = rp->pkt; -@@ -1144,9 +1144,9 @@ ipf_post_execute_reass_pkts(struct ipf *ipf, + } +@@ -1144,9 +1165,9 @@ ipf_post_execute_reass_pkts(struct ipf *ipf, } ovs_mutex_lock(&ipf->ipf_lock); @@ -99337,7 +99470,16 @@ index 507db2aea2..d452663743 100644 const size_t pb_cnt = dp_packet_batch_size(pb); int pb_idx; struct dp_packet *pkt; -@@ -1271,15 +1271,15 @@ ipf_clean_thread_main(void *f) +@@ -1233,7 +1254,7 @@ ipf_preprocess_conntrack(struct ipf *ipf, struct dp_packet_batch *pb, + } + + if (ipf_get_enabled(ipf) || atomic_count_get(&ipf->nfrag)) { +- ipf_execute_reass_pkts(ipf, pb); ++ ipf_execute_reass_pkts(ipf, pb, dl_type); + } + } + +@@ -1271,15 +1292,15 @@ ipf_clean_thread_main(void *f) ovs_mutex_lock(&ipf->ipf_lock); @@ -120191,6 +120333,43 @@ index 600e85dabd..e0d4bed4f0 100644 + +OVS_VSWITCHD_STOP +AT_CLEANUP +diff --git a/tests/sendpkt.py b/tests/sendpkt.py +index 49ac45275a..7cbea51654 100755 +--- a/tests/sendpkt.py ++++ b/tests/sendpkt.py +@@ -48,28 +48,10 @@ if len(args) < 2: + if options.packet_type != "eth": + parser.error('invalid argument to "-t"/"--type". Allowed value is "eth".') + +-# store the hex bytes with 0x appended at the beginning +-# if not present in the user input and validate the hex bytes +-hex_list = [] +-for a in args[1:]: +- if a[:2] != "0x": +- hex_byte = "0x" + a +- else: +- hex_byte = a +- try: +- temp = int(hex_byte, 0) +- except: +- parser.error("invalid hex byte " + a) +- +- if temp > 0xff: +- parser.error("hex byte " + a + " cannot be greater than 0xff!") +- +- hex_list.append(temp) +- +-if sys.version_info < (3, 0): +- pkt = "".join(map(chr, hex_list)) +-else: +- pkt = bytes(hex_list) ++# Strip '0x' prefixes from hex input, combine into a single string and ++# convert to bytes. ++hex_str = "".join([a[2:] if a.startswith("0x") else a for a in args[1:]]) ++pkt = bytes.fromhex(hex_str) + + try: + sockfd = socket.socket(socket.AF_PACKET, socket.SOCK_RAW) diff --git a/tests/stp.at b/tests/stp.at index 7ddacfc3a0..df4b77dd4e 100644 --- a/tests/stp.at @@ -121027,7 +121206,7 @@ index 871a3bda4f..3d84a53182 100644 ]) diff --git a/tests/system-traffic.at b/tests/system-traffic.at -index f22d86e466..8a3caeb0af 100644 +index f22d86e466..d8a7b497c3 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -10,13 +10,13 @@ ADD_NAMESPACES(at_ns0, at_ns1) @@ -121218,13 +121397,11 @@ index f22d86e466..8a3caeb0af 100644 dnl Okay, now check the overlay with different packet sizes -NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl - 3 packets transmitted, 3 received, 0% packet loss, time 0ms - ]) --NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl ++3 packets transmitted, 3 received, 0% packet loss, time 0ms ++]) +NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl - 3 packets transmitted, 3 received, 0% packet loss, time 0ms - ]) --NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl ++3 packets transmitted, 3 received, 0% packet loss, time 0ms ++]) +NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) @@ -121267,11 +121444,13 @@ index f22d86e466..8a3caeb0af 100644 +]) +dnl Okay, now check the overlay with different packet sizes +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl -+3 packets transmitted, 3 received, 0% packet loss, time 0ms -+]) + 3 packets transmitted, 3 received, 0% packet loss, time 0ms + ]) +-NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl +NS_CHECK_EXEC([at_ns0], [ping -s 1600 -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl -+3 packets transmitted, 3 received, 0% packet loss, time 0ms -+]) + 3 packets transmitted, 3 received, 0% packet loss, time 0ms + ]) +-NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl +NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING], [0], [dnl 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) @@ -121926,7 +122105,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) OVS_TRAFFIC_VSWITCHD_STOP -@@ -1738,6 +1967,120 @@ masks-cache:size:256 +@@ -1738,6 +1967,135 @@ masks-cache:size:256 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP @@ -122013,11 +122192,22 @@ index f22d86e466..8a3caeb0af 100644 +AT_CHECK([ovs-ofctl del-flows br0]) +AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) + ++m4_define([ND_NS_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x86dd], ++ [ipv6_src=fe80::f816:3eff:fe04:6604,ipv6_dst=fe80::f816:3eff:fea7:dd0e], ++ [nw_proto=58,nw_ttl=255,nw_frag=no], ++ [icmpv6_type=136,icmpv6_code=0], ++ [nd_options_type=2,nd_tll=36:b1:ee:7c:01:03])]) ++ +dnl Send a mismatching neighbor discovery. -+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 86 dd 60 00 00 00 00 20 3a ff fe 80 00 00 00 00 00 00 f8 16 3e ff fe 04 66 04 fe 80 00 00 00 00 00 00 f8 16 3e ff fe a7 dd 0e 88 00 f1 f2 20 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 02 01 36 b1 ee 7c 01 03 > /dev/null]) ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ND_NS_PKT,nd_target=3000::1')], ++ [0], [ignore]) + +dnl Send a matching neighbor discovery. -+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 86 dd 60 00 00 00 00 20 3a ff fe 80 00 00 00 00 00 00 f8 16 3e ff fe 04 66 04 fe 80 00 00 00 00 00 00 f8 16 3e ff fe a7 dd 0e 88 00 fe 5f 20 00 00 00 20 01 00 00 00 00 00 00 00 00 00 01 00 00 03 92 02 01 36 b1 ee 7c 01 03 > /dev/null]) ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ND_NS_PKT,nd_target=2001::1:0:392')], ++ [0], [ignore]) + +AT_CHECK([ovs-appctl dpctl/dump-flows | strip_stats | strip_used | dnl + strip_key32 | strip_ptype | strip_eth | strip_recirc | dnl @@ -122029,10 +122219,14 @@ index f22d86e466..8a3caeb0af 100644 +OVS_WAIT_UNTIL([ovs-appctl dpctl/dump-flows | grep ",nd" | wc -l | grep -E ^0]) + +dnl Send a matching neighbor discovery. -+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 86 dd 60 00 00 00 00 20 3a ff fe 80 00 00 00 00 00 00 f8 16 3e ff fe 04 66 04 fe 80 00 00 00 00 00 00 f8 16 3e ff fe a7 dd 0e 88 00 fe 5f 20 00 00 00 20 01 00 00 00 00 00 00 00 00 00 01 00 00 03 92 02 01 36 b1 ee 7c 01 03 > /dev/null]) ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ND_NS_PKT,nd_target=2001::1:0:392')], ++ [0], [ignore]) + +dnl Send a mismatching neighbor discovery. -+NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 86 dd 60 00 00 00 00 20 3a ff fe 80 00 00 00 00 00 00 f8 16 3e ff fe 04 66 04 fe 80 00 00 00 00 00 00 f8 16 3e ff fe a7 dd 0e 88 00 f1 f2 20 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 02 01 36 b1 ee 7c 01 03 > /dev/null]) ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ND_NS_PKT,nd_target=3000::1')], ++ [0], [ignore]) + +AT_CHECK([ovs-appctl dpctl/dump-flows | strip_stats | strip_used | dnl + strip_key32 | strip_ptype | strip_eth | strip_recirc | dnl @@ -122047,115 +122241,196 @@ index f22d86e466..8a3caeb0af 100644 AT_BANNER([MPLS]) AT_SETUP([mpls - encap header dp-support]) -@@ -1756,7 +2099,7 @@ dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp +@@ -1755,20 +2113,29 @@ dnl The flow will encap a mpls header to the ip packet + dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x0800 actions=encap(mpls),set_mpls_label:2,encap(ethernet),set_field:00:00:00:00:00:02->dl_dst,set_field:00:00:00:00:00:01->dl_src,ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is a icmp packet. pkt=eth/ip/icmp -@@ -1765,10 +2108,10 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected mpls encapsulated packet on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl The hex dump is a icmp packet. pkt=eth/ip/icmp + dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++dnl p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT')], [0], [ignore]) + +-dnl Check the expected mpls encapsulated packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8847 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8847 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) ++dnl Check the expected mpls encapsulated packet on the egress interface. ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8847], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) ++ ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'MPLS_HEADER'), ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -1788,7 +2131,7 @@ dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp +@@ -1787,20 +2154,29 @@ dnl The flow will encap a mpls header to the ip packet + dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x0800 actions=encap(mpls),set_mpls_label:2,encap(ethernet),set_field:00:00:00:00:00:02->dl_dst,set_field:00:00:00:00:00:01->dl_src,ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is a icmp packet. pkt=eth/ip/icmp -@@ -1797,10 +2140,10 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected mpls encapsulated packet on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl The hex dump is a icmp packet. pkt=eth/ip/icmp + dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++dnl p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT')], [0], [ignore]) + +-dnl Check the expected mpls encapsulated packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8847 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8847 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) ++dnl Check the expected mpls encapsulated packet on the egress interface. ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8847], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) ++ ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'MPLS_HEADER'), ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -1821,7 +2164,7 @@ dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp +@@ -1820,20 +2196,29 @@ dnl The flow will encap a mpls header to the ip packet + dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x0800 actions=encap(mpls_mc),set_mpls_label:2,encap(ethernet),set_field:00:00:00:00:00:02->dl_dst,set_field:00:00:00:00:00:01->dl_src,ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is a icmp packet. pkt=eth/ip/icmp -@@ -1830,10 +2173,10 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected mpls encapsulated packet on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl The hex dump is a icmp packet. pkt=eth/ip/icmp + dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++dnl p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT')], [0], [ignore]) ++ ++dnl Check the expected mpls encapsulated packet on the egress interface. ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8848], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) + +-dnl Check the expected mpls encapsulated packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8848 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8848 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'MPLS_HEADER'), ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -1853,7 +2196,7 @@ dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp +@@ -1852,20 +2237,29 @@ dnl The flow will encap a mpls header to the ip packet + dnl eth/ip/icmp --> OVS --> eth/mpls/eth/ip/icmp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x0800 actions=encap(mpls_mc),set_mpls_label:2,encap(ethernet),set_field:00:00:00:00:00:02->dl_dst,set_field:00:00:00:00:00:01->dl_src,ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is a icmp packet. pkt=eth/ip/icmp -@@ -1862,10 +2205,10 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected mpls encapsulated packet on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl The hex dump is a icmp packet. pkt=eth/ip/icmp + dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++dnl p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT')], [0], [ignore]) ++ ++dnl Check the expected mpls encapsulated packet on the egress interface. ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8848], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) + +-dnl Check the expected mpls encapsulated packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8848 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *0000 *0000 *0002 *0000 *0000 *0001 *8848 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *2140 *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *4500 *0054 *0344 *4000 *4001 *2161 *0a01 *0101" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0a01 *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61" 2>&1 1>/dev/null]) ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'MPLS_HEADER'), ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -1887,7 +2230,7 @@ dnl eth/mpls/eth/ip/icmp --> OVS --> eth/ip/icmp +@@ -1886,24 +2280,30 @@ dnl eth/mpls/eth/ip/icmp --> OVS --> eth/ip/icmp + AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x8847,mpls_label=2 actions=decap(),decap(packet_type(ns=0,type=0)),ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is an mpls packet encapsulating ethernet packet. pkt=eth/mpls/eth/ip/icmp -@@ -1896,13 +2239,13 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 00 00 00 00 00 02 00 00 00 00 00 01 88 47 00 00 21 40 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected decapsulated on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) + +-dnl The hex dump is an mpls packet encapsulating ethernet packet. pkt=eth/mpls/eth/ip/icmp +-dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 00 00 00 00 00 02 00 00 00 00 00 01 88 47 00 00 21 40 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8847], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl Check the expected decapsulated on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800 *4500" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0054 *0344 *4000 *4001 *2161 *0a01 *0101 *0a01" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61 *0000" 2>&1 1>/dev/null]) @@ -122163,29 +122438,45 @@ index f22d86e466..8a3caeb0af 100644 -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *1617 *1819 *1a1b *1c1d *1e1f *2021 *2223 *2425" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *2627 *2829 *2a2b *2c2d *2e2f *3031 *3233 *3435" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0060: *3637" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800 *4500" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0054 *0344 *4000 *4001 *2161 *0a01 *0101 *0a01" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0000 *500b *0200 *0000 *0000 *1011 *1213 *1415" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0040: *1617 *1819 *1a1b *1c1d *1e1f *2021 *2223 *2425" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0050: *2627 *2829 *2a2b *2c2d *2e2f *3031 *3233 *3435" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0060: *3637" 2>&1 1>/dev/null]) ++dnl The packet is an eth/mpls/eth/ip/icmp sent from p0(at_ns0) interface ++dnl directed to p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ "$(ovs-ofctl compose-packet --bare 'MPLS_HEADER')" \ ++ "$(ovs-ofctl compose-packet --bare 'ICMP_PKT')"], ++ [0], [ignore]) ++dnl Check the expected decapsulated on the egress interface. ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q \ ++ "^$(ovs-ofctl compose-packet --bare 'ICMP_PKT')\$"]) OVS_TRAFFIC_VSWITCHD_STOP -@@ -1924,7 +2267,7 @@ dnl eth/mpls/eth/ip/icmp --> OVS --> eth/ip/icmp + AT_CLEANUP +@@ -1923,24 +2323,66 @@ dnl eth/mpls/eth/ip/icmp --> OVS --> eth/ip/icmp + AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x8847,mpls_label=2 actions=decap(),decap(packet_type(ns=0,type=0)),ovs-p1"]) - rm -rf p1.pcap +-rm -rf p1.pcap -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is an mpls packet encapsulating ethernet packet. pkt=eth/mpls/eth/ip/icmp -@@ -1933,15 +2276,51 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 00 00 00 00 00 02 00 00 00 00 00 01 88 47 00 00 21 40 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) - - dnl Check the expected decapsulated on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) + +-dnl The hex dump is an mpls packet encapsulating ethernet packet. pkt=eth/mpls/eth/ip/icmp +-dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 00 00 00 00 00 02 00 00 00 00 00 01 88 47 00 00 21 40 36 b1 ee 7c 01 02 36 b1 ee 7c 01 03 08 00 45 00 00 54 03 44 40 00 40 01 21 61 0a 01 01 01 0a 01 01 02 08 00 ef ac 7c e4 00 03 5b 2c 1f 61 00 00 00 00 50 0b 02 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 > /dev/null]) ++m4_define([MPLS_HEADER], [m4_join([,], ++ [eth_src=00:00:00:00:00:01,eth_dst=00:00:00:00:00:02,eth_type=0x8847], ++ [mpls_label=2,mpls_ttl=64,mpls_bos=1])]) ++ ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=36:b1:ee:7c:01:03,eth_dst=36:b1:ee:7c:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) + +-dnl Check the expected decapsulated on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800 *4500" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0054 *0344 *4000 *4001 *2161 *0a01 *0101 *0a01" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61 *0000" 2>&1 1>/dev/null]) @@ -122193,15 +122484,17 @@ index f22d86e466..8a3caeb0af 100644 -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *1617 *1819 *1a1b *1c1d *1e1f *2021 *2223 *2425" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *2627 *2829 *2a2b *2c2d *2e2f *3031 *3233 *3435" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0060: *3637" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *36b1 *ee7c *0102 *36b1 *ee7c *0103 *0800 *4500" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0054 *0344 *4000 *4001 *2161 *0a01 *0101 *0a01" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *0102 *0800 *efac *7ce4 *0003 *5b2c *1f61 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0000 *500b *0200 *0000 *0000 *1011 *1213 *1415" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0040: *1617 *1819 *1a1b *1c1d *1e1f *2021 *2223 *2425" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0050: *2627 *2829 *2a2b *2c2d *2e2f *3031 *3233 *3435" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0060: *3637" 2>&1 1>/dev/null]) - ++dnl The packet is an eth/mpls/eth/ip/icmp sent from p0(at_ns0) interface ++dnl directed to p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ "$(ovs-ofctl compose-packet --bare 'MPLS_HEADER')" \ ++ "$(ovs-ofctl compose-packet --bare 'ICMP_PKT')"], ++ [0], [ignore]) ++dnl Check the expected decapsulated on the egress interface. ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q \ ++ "^$(ovs-ofctl compose-packet --bare 'ICMP_PKT')\$"]) ++ +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP + @@ -122237,11 +122530,10 @@ index f22d86e466..8a3caeb0af 100644 +m4_define([HTB_CONF], [rate 2Mbit ceil 3Mbit burst 375000b cburst 375000b]) +AT_CHECK([tc class show dev ovs-p0 | grep -q 'class htb .* HTB_CONF']) +AT_CHECK([tc class show dev ovs-p1 | grep -q 'class htb .* HTB_CONF']) -+ + OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP - -@@ -1985,9 +2364,9 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) +@@ -1985,9 +2427,9 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) dnl Check this output. We only see the latter two packets, not the first. AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN2 (xid=0x0): total_len=42 in_port=1 (via action) data_len=42 (unbuffered) @@ -122253,7 +122545,7 @@ index f22d86e466..8a3caeb0af 100644 ]) OVS_TRAFFIC_VSWITCHD_STOP -@@ -2033,9 +2412,9 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) +@@ -2033,9 +2475,9 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) dnl Check this output. We only see the latter two packets, not the first. AT_CHECK([cat ofctl_monitor.log], [0], [dnl NXT_PACKET_IN2 (xid=0x0): cookie=0x0 total_len=42 in_port=1 (via action) data_len=42 (unbuffered) @@ -122265,7 +122557,7 @@ index f22d86e466..8a3caeb0af 100644 ]) dnl -@@ -2101,7 +2480,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl +@@ -2101,7 +2543,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl ]) dnl Test ICMP traffic @@ -122274,7 +122566,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -2141,7 +2520,7 @@ priority=100,in_port=2,icmp,ct_state=+trk+est,action=1 +@@ -2141,7 +2583,7 @@ priority=100,in_port=2,icmp,ct_state=+trk+est,action=1 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) dnl Pings from ns0->ns1 should work fine. @@ -122283,7 +122575,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -2149,7 +2528,10 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl +@@ -2149,7 +2591,10 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl icmp,orig=(src=10.1.1.1,dst=10.1.1.2,id=,type=8,code=0),reply=(src=10.1.1.2,dst=10.1.1.1,id=,type=0,code=0) ]) @@ -122295,7 +122587,7 @@ index f22d86e466..8a3caeb0af 100644 dnl Pings from ns1->ns0 should fail. NS_CHECK_EXEC([at_ns1], [ping -q -c 3 -i 0.3 -w 2 10.1.1.1 | FORMAT_PING], [0], [dnl -@@ -2182,7 +2564,7 @@ priority=100,in_port=2,icmp,ct_state=+trk+est,action=1 +@@ -2182,7 +2627,7 @@ priority=100,in_port=2,icmp,ct_state=+trk+est,action=1 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) dnl Pings from ns0->ns1 should work fine. @@ -122304,7 +122596,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -2282,7 +2664,7 @@ NS_CHECK_EXEC([at_ns1], [ping6 -q -c 3 -i 0.3 -w 2 fc00::1 | FORMAT_PING], [0], +@@ -2282,7 +2727,7 @@ NS_CHECK_EXEC([at_ns1], [ping6 -q -c 3 -i 0.3 -w 2 fc00::1 | FORMAT_PING], [0], ]) dnl Pings from ns0->ns1 should work fine. @@ -122313,7 +122605,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -2290,6 +2672,11 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl +@@ -2290,6 +2735,11 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl icmpv6,orig=(src=fc00::1,dst=fc00::2,id=,type=128,code=0),reply=(src=fc00::2,dst=fc00::1,id=,type=129,code=0) ]) @@ -122325,7 +122617,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -2980,6 +3367,15 @@ NXST_FLOW reply: +@@ -2980,6 +3430,15 @@ NXST_FLOW reply: table=1, priority=100,ct_state=+est+trk,in_port=1 actions=output:2 ]) @@ -122341,7 +122633,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -3140,11 +3536,11 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) +@@ -3140,11 +3599,11 @@ OVS_APP_EXIT_AND_WAIT([ovs-ofctl]) dnl Check this output. We only see the latter two packets, not the first. AT_CHECK([cat ofctl_monitor.log | grep -v ff02 | grep -v fe80 | grep -v no_match], [0], [dnl NXT_PACKET_IN2 (xid=0x0): table_id=1 cookie=0x0 total_len=75 ct_state=inv|trk,ip,in_port=2 (via action) data_len=75 (unbuffered) @@ -122356,7 +122648,7 @@ index f22d86e466..8a3caeb0af 100644 ]) AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.0.1)], [0], [dnl -@@ -3181,12 +3577,12 @@ dnl Modify userspace conntrack fragmentation handling. +@@ -3181,12 +3640,12 @@ dnl Modify userspace conntrack fragmentation handling. DPCTL_MODIFY_FRAGMENTATION() dnl Ipv4 fragmentation connectivity check. @@ -122371,7 +122663,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3258,12 +3654,12 @@ dnl Modify userspace conntrack fragmentation handling. +@@ -3258,12 +3717,12 @@ dnl Modify userspace conntrack fragmentation handling. DPCTL_MODIFY_FRAGMENTATION() dnl Ipv4 fragmentation connectivity check. @@ -122386,7 +122678,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3303,22 +3699,22 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) +@@ -3303,22 +3762,22 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) dnl Ipv4 fragmentation connectivity check. @@ -122413,7 +122705,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3345,6 +3741,11 @@ AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) +@@ -3345,6 +3804,11 @@ AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl ]) @@ -122425,7 +122717,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -3472,12 +3873,12 @@ dnl "connect: Cannot assign requested address" +@@ -3472,12 +3936,12 @@ dnl "connect: Cannot assign requested address" OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2]) dnl Ipv6 fragmentation connectivity check. @@ -122440,7 +122732,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3554,12 +3955,12 @@ dnl "connect: Cannot assign requested address" +@@ -3554,12 +4018,12 @@ dnl "connect: Cannot assign requested address" OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2]) dnl Ipv4 fragmentation connectivity check. @@ -122455,7 +122747,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3597,22 +3998,22 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) +@@ -3597,22 +4061,22 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00:1::4]) dnl Ipv6 fragmentation connectivity check. @@ -122482,7 +122774,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3823,18 +4224,18 @@ ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.100], [10.1.1.1/24], +@@ -3823,18 +4287,18 @@ ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.100], [10.1.1.1/24], [id 0 dstport 4789]) dnl First, check the underlay @@ -122505,7 +122797,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3883,18 +4284,18 @@ dnl "connect: Cannot assign requested address" +@@ -3883,18 +4347,18 @@ dnl "connect: Cannot assign requested address" OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2]) dnl First, check the underlay @@ -122528,7 +122820,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -3919,8 +4320,8 @@ NS_CHECK_EXEC([at_ns0], [ip route add 10.1.1.0/24 via 10.2.1.2]) +@@ -3919,8 +4383,8 @@ NS_CHECK_EXEC([at_ns0], [ip route add 10.1.1.0/24 via 10.2.1.2]) NS_CHECK_EXEC([at_ns1], [ip route add 10.1.1.0/24 via 10.2.1.1]) dnl Solely for debugging when things go wrong @@ -122539,7 +122831,7 @@ index f22d86e466..8a3caeb0af 100644 AT_DATA([flows.txt], [dnl table=0,arp,actions=normal -@@ -4007,7 +4408,7 @@ dnl The default udp_single and icmp_first timeouts are 30 seconds in +@@ -4007,7 +4471,7 @@ dnl The default udp_single and icmp_first timeouts are 30 seconds in dnl kernel DP, and 60 seconds in userspace DP. dnl Send ICMP and UDP traffic @@ -122548,7 +122840,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"]) -@@ -4033,7 +4434,7 @@ done +@@ -4033,7 +4497,7 @@ done AT_CHECK([ovs-vsctl --may-exist add-zone-tp $DP_TYPE zone=5 udp_first=1 udp_single=1 icmp_first=1 icmp_reply=1]) dnl Send ICMP and UDP traffic @@ -122557,7 +122849,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"]) -@@ -4051,7 +4452,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl +@@ -4051,7 +4515,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2)], [0], [dnl ]) dnl Re-send ICMP and UDP traffic to test conntrack cache @@ -122566,7 +122858,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"]) -@@ -4072,7 +4473,7 @@ dnl Set the timeout policy to default again. +@@ -4072,7 +4536,7 @@ dnl Set the timeout policy to default again. AT_CHECK([ovs-vsctl del-zone-tp $DP_TYPE zone=5]) dnl Send ICMP and UDP traffic @@ -122575,7 +122867,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"]) -@@ -4100,15 +4501,15 @@ action=normal +@@ -4100,15 +4564,15 @@ action=normal AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) @@ -122594,7 +122886,7 @@ index f22d86e466..8a3caeb0af 100644 "1616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161610a, actions=ct(table=1)"]) AT_CHECK([ovs-appctl dpctl/dump-flows | head -2 | tail -1 | grep -q -e ["]udp[(]src=5001["]]) -@@ -4265,7 +4666,7 @@ table=2,in_port=1,ip,ct_state=+trk+est,ct_zone=2,action=LOCAL +@@ -4265,7 +4729,7 @@ table=2,in_port=1,ip,ct_state=+trk+est,ct_zone=2,action=LOCAL AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) @@ -122603,7 +122895,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -4336,7 +4737,7 @@ table=4,priority=100,ip,action=output:NXM_NX_REG0[[]] +@@ -4336,7 +4800,7 @@ table=4,priority=100,ip,action=output:NXM_NX_REG0[[]] AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) @@ -122612,7 +122904,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -5031,11 +5432,11 @@ ADD_NAMESPACES(at_ns0, at_ns1) +@@ -5031,11 +5495,11 @@ ADD_NAMESPACES(at_ns0, at_ns1) ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24") NS_CHECK_EXEC([at_ns0], [ip link set dev p0 address 80:88:88:88:88:88]) ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24") @@ -122626,7 +122918,7 @@ index f22d86e466..8a3caeb0af 100644 in_port=2,ct_state=-trk,tcp,tp_dst=34568,action=ct(table=0,zone=1,nat) in_port=2,ct_state=+trk,ct_zone=1,tcp,action=1 dnl -@@ -5059,17 +5460,29 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) +@@ -5059,17 +5523,29 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) dnl HTTP requests from p0->p1 should work fine. OVS_START_L7([at_ns1], [http]) @@ -122660,7 +122952,7 @@ index f22d86e466..8a3caeb0af 100644 AT_CLEANUP AT_SETUP([conntrack - more complex SNAT]) -@@ -5360,7 +5773,7 @@ table=10 priority=0 action=drop +@@ -5360,7 +5836,7 @@ table=10 priority=0 action=drop AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) rm p0.pcap @@ -122669,7 +122961,7 @@ index f22d86e466..8a3caeb0af 100644 sleep 1 dnl UDP packets from ns0->ns1 should solicit "destination unreachable" response. -@@ -5384,7 +5797,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sed -e 's/dst= +@@ -5384,7 +5860,7 @@ AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(10.1.1.2) | sed -e 's/dst= udp,orig=(src=10.1.1.1,dst=10.1.1.2,sport=,dport=),reply=(src=10.1.1.2,dst=10.1.1.2XX,sport=,dport=),mark=1 ]) @@ -122678,7 +122970,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -6074,7 +6487,7 @@ dnl waiting, we get occasional failures due to the following error: +@@ -6074,7 +6550,7 @@ dnl waiting, we get occasional failures due to the following error: dnl "connect: Cannot assign requested address" OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::240]) @@ -122687,7 +122979,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -6128,13 +6541,13 @@ OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2]) +@@ -6128,13 +6604,13 @@ OVS_WAIT_UNTIL([ip netns exec at_ns0 ping6 -c 1 fc00::2]) AT_CHECK([ovs-appctl dpctl/flush-conntrack]) rm p0.pcap @@ -122703,7 +122995,7 @@ index f22d86e466..8a3caeb0af 100644 AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fc00::2)], [0], [dnl udp,orig=(src=fc00::1,dst=fc00::2,sport=,dport=),reply=(src=fc00::2,dst=fc00::240,sport=,dport=) -@@ -6454,7 +6867,7 @@ on_exit 'ovs-appctl revalidator/purge' +@@ -6454,7 +6930,7 @@ on_exit 'ovs-appctl revalidator/purge' on_exit 'ovs-appctl dpif/dump-flows br0' dnl Should work with the virtual IP address through NAT @@ -122712,7 +123004,29 @@ index f22d86e466..8a3caeb0af 100644 echo Request $i NS_CHECK_EXEC([at_ns1], [wget 10.1.1.64 -t 5 -T 1 --retry-connrefused -v -o wget$i.log]) done -@@ -6743,6 +7156,302 @@ AT_CHECK([ovs-ofctl dump-flows br0 | grep table=2, | OFPROTO_CLEAR_DURATION_IDLE +@@ -6722,10 +7198,18 @@ table=2,priority=10 ct_state=+trk+est action=drop + + AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt]) + +-# sending icmp pkts, first and second +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f0 00 00 01 01 02 f0 00 00 01 01 01 08 00 45 00 00 1c 00 01 00 00 40 01 64 dc 0a 01 01 01 0a 01 01 02 08 00 f7 ff ff ff ff ff > /dev/null]) ++m4_define([ICMP_PKT], [m4_join([,], ++ [eth_src=f0:00:00:01:01:01,eth_dst=f0:00:00:01:01:02,eth_type=0x0800], ++ [nw_src=10.1.1.1,nw_dst=10.1.1.2], ++ [nw_proto=1,nw_ttl=64,nw_frag=no], ++ [icmp_type=8,icmp_code=0])]) ++ ++# Sending ICMP packets, first and second. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT' '')], [0], [ignore]) + +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f0 00 00 01 01 02 f0 00 00 01 01 01 08 00 45 00 00 1c 00 01 00 00 40 01 64 dc 0a 01 01 01 0a 01 01 02 08 00 f7 ff ff ff ff ff > /dev/null]) ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'ICMP_PKT' '')], [0], [ignore]) + + sleep 1 + +@@ -6743,6 +7227,302 @@ AT_CHECK([ovs-ofctl dump-flows br0 | grep table=2, | OFPROTO_CLEAR_DURATION_IDLE OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP @@ -123015,7 +123329,7 @@ index f22d86e466..8a3caeb0af 100644 AT_BANNER([802.1ad]) AT_SETUP([802.1ad - vlan_limit]) -@@ -6768,7 +7477,7 @@ dnl CVLAN traffic should match the flow and drop +@@ -6768,7 +7548,7 @@ dnl CVLAN traffic should match the flow and drop AT_CHECK([ovs-appctl revalidator/purge]) AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:vlan-limit=1]) AT_CHECK([ovs-ofctl add-flow br0 "priority=100 dl_type=0x8100 action=drop"]) @@ -123024,7 +123338,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -6818,11 +7527,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br2 flows-customer-br.txt]) +@@ -6818,11 +7598,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br2 flows-customer-br.txt]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) @@ -123038,7 +123352,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -6874,11 +7583,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br2 flows-customer-br.txt]) +@@ -6874,11 +7654,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br2 flows-customer-br.txt]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) @@ -123052,7 +123366,7 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -6926,24 +7635,24 @@ AT_CHECK([ovs-vsctl set port ovs-p2 vlan_mode=dot1q-tunnel tag=4094 cvlans=100,2 +@@ -6926,24 +7706,24 @@ AT_CHECK([ovs-vsctl set port ovs-p2 vlan_mode=dot1q-tunnel tag=4094 cvlans=100,2 OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.3.2.2]) @@ -123082,7 +123396,7 @@ index f22d86e466..8a3caeb0af 100644 OVS_TRAFFIC_VSWITCHD_STOP(["/dropping VLAN \(0\|300\) packet received on dot1q-tunnel port/d"]) AT_CLEANUP -@@ -6972,11 +7681,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows-br0.txt]) +@@ -6972,11 +7752,11 @@ AT_CHECK([ovs-ofctl --bundle add-flows br0 flows-br0.txt]) OVS_WAIT_UNTIL([ip netns exec at_ns0 ping -c 1 10.2.2.2]) @@ -123096,129 +123410,217 @@ index f22d86e466..8a3caeb0af 100644 3 packets transmitted, 3 received, 0% packet loss, time 0ms ]) -@@ -6998,7 +7707,7 @@ dnl The flow will encap a nsh header to the TCP syn packet +@@ -6998,21 +7778,29 @@ dnl The flow will encap a nsh header to the TCP syn packet dnl eth/ip/tcp --> OVS --> eth/nsh/eth/ip/tcp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,in_port=ovs-p0,ip,actions=encap(nsh(md_type=1)),set_field:0x1234->nsh_spi,set_field:0x11223344->nsh_c1,encap(ethernet),set_field:f2:ff:00:00:00:02->dl_dst,set_field:f2:ff:00:00:00:01->dl_src,ovs-p1"]) -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is a TCP syn packet. pkt=eth/ip/tcp -@@ -7007,12 +7716,12 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) - - dnl Check the expected nsh encapsulated packet on the egress interface +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) + +-dnl The hex dump is a TCP syn packet. pkt=eth/ip/tcp +-dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) ++m4_define([TCP_SYN_PKT], [m4_join([,], ++ [eth_src=f2:00:00:00:00:01,eth_dst=f2:00:00:00:00:02,eth_type=0x0800], ++ [nw_src=192.168.0.10,nw_dst=10.0.0.10], ++ [nw_proto=6,nw_ttl=64,nw_frag=no], ++ [tcp_src=1024,tcp_dst=2048,tcp_flags=syn])]) ++ ++dnl Send the TCP SYN packet from p0(at_ns0) interface directed to ++dnl p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ $(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')], [0], [ignore]) + +-dnl Check the expected nsh encapsulated packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0fc6" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0103 *0012 *34ff *1122 *3344 *0000 *0000 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *0000 *0000 *0000 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0fc6" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0103 *0012 *34ff *1122 *3344 *0000 *0000 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *0000 *0000 *0000 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) ++m4_define([NSH_HEADER], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=63,nsh_np=3,nsh_spi=0x1234,nsh_si=255], ++ [nsh_mdtype=1,nsh_c1=0x11223344])]) ++ ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'NSH_HEADER'), ++ $(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -7030,7 +7739,7 @@ dnl The flow will decap a nsh header which in turn carries a TCP syn packet +@@ -7030,19 +7818,31 @@ dnl The flow will decap a nsh header which in turn carries a TCP syn packet dnl eth/nsh/eth/ip/tcp --> OVS --> eth/ip/tcp AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,in_port=ovs-p0,dl_type=0x894f, actions=decap(),decap(), ovs-p1"]) -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp -@@ -7039,10 +7748,10 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 00 64 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) + +-dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp +-dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 00 64 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) ++m4_define([TCP_SYN_PKT], [m4_join([,], ++ [eth_src=f2:00:00:00:00:01,eth_dst=f2:00:00:00:00:02,eth_type=0x0800], ++ [nw_src=192.168.0.10,nw_dst=10.0.0.10], ++ [nw_proto=6,nw_ttl=64,nw_frag=no], ++ [tcp_src=1024,tcp_dst=2048,tcp_flags=syn])]) ++ ++m4_define([NSH_HEADER], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=63,nsh_np=3,nsh_spi=0x1234,nsh_si=255], ++ [nsh_mdtype=1,nsh_c1=0x11223344])]) ++ ++dnl Send the NSH packet with TCP SYN payload from p0(at_ns0) interface directed ++dnl to p1(at_ns1) interface. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ "$(ovs-ofctl compose-packet --bare 'NSH_HEADER')" \ ++ "$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')"], ++ [0], [ignore]) dnl Check the expected de-capsulated TCP packet on the egress interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f200 *0000 *0002 *f200 *0000 *0001 *0800 *4500" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0028 *0001 *0000 *4006 *b013 *c0a8 *000a *0a00" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *000a *0400 *0800 *0000 *00c8 *0000 *0000 *5002" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *2000 *b85e *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *f200 *0000 *0002 *f200 *0000 *0001 *0800 *4500" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0028 *0001 *0000 *4006 *b013 *c0a8 *000a *0a00" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *000a *0400 *0800 *0000 *00c8 *0000 *0000 *5002" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *2000 *b85e *0000" 2>&1 1>/dev/null]) ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q \ ++ "^$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')\$"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -7062,7 +7771,7 @@ dnl The flow will add another NSH header with nsh_spi=0x101, nsh_si=4, +@@ -7062,22 +7862,38 @@ dnl The flow will add another NSH header with nsh_spi=0x101, nsh_si=4, dnl nsh_ttl=7 and change the md1 context AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,in_port=ovs-p0,dl_type=0x894f,nsh_spi=0x100,nsh_si=0x03,actions=decap(),decap(),encap(nsh(md_type=1)),set_field:0x07->nsh_ttl,set_field:0x0101->nsh_spi,set_field:0x04->nsh_si,set_field:0x100f0e0d->nsh_c1,set_field:0x0c0b0a09->nsh_c2,set_field:0x08070605->nsh_c3,set_field:0x04030201->nsh_c4,encap(ethernet),set_field:f2:ff:00:00:00:02->dl_dst,set_field:f2:ff:00:00:00:01->dl_src,ovs-p1"]) -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) - sleep 1 - - dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp -@@ -7072,12 +7781,12 @@ dnl p1(at_ns1) interface - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) - - dnl Check the expected NSH packet with new fields in the header +-sleep 1 ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) + +-dnl The hex dump is NSH packet with TCP syn payload. pkt=eth/nsh/eth/ip/tcp +-dnl The nsh_ttl is 8, nsh_spi is 0x100 and nsh_si is 3 +-dnl The packet is sent from p0(at_ns0) interface directed to +-dnl p1(at_ns1) interface +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 03 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) ++m4_define([TCP_SYN_PKT], [m4_join([,], ++ [eth_src=f2:00:00:00:00:01,eth_dst=f2:00:00:00:00:02,eth_type=0x0800], ++ [nw_src=192.168.0.10,nw_dst=10.0.0.10], ++ [nw_proto=6,nw_ttl=64,nw_frag=no], ++ [tcp_src=1024,tcp_dst=2048,tcp_flags=syn])]) ++ ++m4_define([NSH_HEADER_1], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=8,nsh_np=3,nsh_spi=0x100,nsh_si=3,nsh_mdtype=1], ++ [nsh_c1=0x01020304,nsh_c2=0x05060708,nsh_c3=0x090a0b0c,nsh_c4=0x0d0e0f10])]) ++ ++dnl Send the NSH packet with TCP SYN payload from p0(at_ns0) interface directed ++dnl to p1(at_ns1) interface. ++dnl The nsh_ttl is 8, nsh_spi is 0x100 and nsh_si is 3. ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ "$(ovs-ofctl compose-packet --bare 'NSH_HEADER_1')" \ ++ "$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')"], ++ [0], [ignore]) + +-dnl Check the expected NSH packet with new fields in the header -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000* 0001 *894f *01c6" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0103 *0001 *0104 *100f *0e0d *0c0b *0a09 *0807" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *0605 *0403 *0201 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *f2ff *0000 *0002 *f2ff *0000* 0001 *894f *01c6" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0103 *0001 *0104 *100f *0e0d *0c0b *0a09 *0807" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *0605 *0403 *0201 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) ++m4_define([NSH_HEADER_2], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=7,nsh_np=3,nsh_spi=0x101,nsh_si=4,nsh_mdtype=1], ++ [nsh_c1=0x100f0e0d,nsh_c2=0x0c0b0a09,nsh_c3=0x08070605,nsh_c4=0x04030201])]) ++ ++dnl Check the expected NSH packet with new fields in the header. ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'NSH_HEADER_2'), ++ $(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP -@@ -7098,31 +7807,31 @@ dnl packet to to at_ns2. +@@ -7098,31 +7914,50 @@ dnl packet to to at_ns2. AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x894f,nsh_spi=0x100,nsh_si=0x02,actions=ovs-p1"]) AT_CHECK([ovs-ofctl -Oopenflow13 add-flow br0 "table=0,priority=100,dl_type=0x894f,nsh_spi=0x100,nsh_si=0x01,actions=ovs-p2"]) -NS_CHECK_EXEC([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap &]) -NS_CHECK_EXEC([at_ns2], [tcpdump -l -n -xx -U -i p2 > p2.pcap &]) -+NETNS_DAEMONIZE([at_ns1], [tcpdump -l -n -xx -U -i p1 > p1.pcap], [tcpdump.pid]) -+NETNS_DAEMONIZE([at_ns2], [tcpdump -l -n -xx -U -i p2 > p2.pcap], [tcpdump2.pid]) - sleep 1 - - dnl First send packet from at_ns0 --> OVS with SPI=0x100 and SI=2 - NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 02 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) - - dnl Check for the above packet on p1 interface +-sleep 1 +- +-dnl First send packet from at_ns0 --> OVS with SPI=0x100 and SI=2 +-NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 02 06 01 03 00 01 00 02 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) +- +-dnl Check for the above packet on p1 interface -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0206" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0010: *0103 *0001 *0002 *0102 *0304 *0506 *0708 *090a" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0020: *0b0c *0d0e *0f10 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p1.pcap | egrep "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *0206" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0010: *0103 *0001 *0002 *0102 *0304 *0506 *0708 *090a" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0020: *0b0c *0d0e *0f10 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p1.pcap | grep -E "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) - - dnl Send the second packet from at_ns1 --> OVS with SPI=0x100 and SI=1 - NS_CHECK_EXEC([at_ns1], [$PYTHON3 $srcdir/sendpkt.py p1 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 01 c6 01 03 00 01 00 01 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) - - dnl Check for the above packet on p2 interface +- +-dnl Send the second packet from at_ns1 --> OVS with SPI=0x100 and SI=1 +-NS_CHECK_EXEC([at_ns1], [$PYTHON3 $srcdir/sendpkt.py p1 f2 ff 00 00 00 02 f2 ff 00 00 00 01 89 4f 01 c6 01 03 00 01 00 01 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 f2 00 00 00 00 02 f2 00 00 00 00 01 08 00 45 00 00 28 00 01 00 00 40 06 b0 13 c0 a8 00 0a 0a 00 00 0a 04 00 08 00 00 00 00 c8 00 00 00 00 50 02 20 00 b8 5e 00 00 > /dev/null]) +- +-dnl Check for the above packet on p2 interface -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *01c6" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0010: *0103 *0001 *0001 *0102 *0304 *0506 *0708 *090a" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0020: *0b0c *0d0e *0f10 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -OVS_WAIT_UNTIL([cat p2.pcap | egrep "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0000: *f2ff *0000 *0002 *f2ff *0000 *0001 *894f *01c6" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0010: *0103 *0001 *0001 *0102 *0304 *0506 *0708 *090a" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0020: *0b0c *0d0e *0f10 *f200 *0000 *0002 *f200 *0000" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0030: *0001 *0800 *4500 *0028 *0001 *0000 *4006 *b013" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0040: *c0a8 *000a *0a00 *000a *0400 *0800 *0000 *00c8" 2>&1 1>/dev/null]) -+OVS_WAIT_UNTIL([cat p2.pcap | grep -E "0x0050: *0000 *0000 *5002 *2000 *b85e *0000" 2>&1 1>/dev/null]) ++NETNS_DAEMONIZE([at_ns1], ++ [tcpdump -l -n -xx -U -i p1 -w p1.pcap 2>tcpdump_err], [tcpdump.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump_err]) ++NETNS_DAEMONIZE([at_ns2], ++ [tcpdump -l -n -xx -U -i p2 -w p2.pcap 2>tcpdump2_err], [tcpdump2.pid]) ++OVS_WAIT_UNTIL([grep "listening" tcpdump2_err]) ++ ++m4_define([TCP_SYN_PKT], [m4_join([,], ++ [eth_src=f2:00:00:00:00:01,eth_dst=f2:00:00:00:00:02,eth_type=0x0800], ++ [nw_src=192.168.0.10,nw_dst=10.0.0.10], ++ [nw_proto=6,nw_ttl=64,nw_frag=no], ++ [tcp_src=1024,tcp_dst=2048,tcp_flags=syn])]) ++ ++dnl First send packet from at_ns0 --> OVS with SPI=0x100 and SI=2. ++m4_define([NSH_HEADER_1], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=8,nsh_np=3,nsh_spi=0x100,nsh_si=2,nsh_mdtype=1], ++ [nsh_c1=0x01020304,nsh_c2=0x05060708,nsh_c3=0x090a0b0c,nsh_c4=0x0d0e0f10])]) ++ ++NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py p0 \ ++ "$(ovs-ofctl compose-packet --bare 'NSH_HEADER_1')" \ ++ "$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')"], ++ [0], [ignore]) ++ ++dnl Check for the above packet on p1 interface. ++OVS_WAIT_UNTIL([ovs-pcap p1.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'NSH_HEADER_1'), ++ $(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT'), [\$])"]) ++ ++dnl Send the second packet from at_ns1 --> OVS with SPI=0x100 and SI=1. ++m4_define([NSH_HEADER_2], [m4_join([,], ++ [eth_src=f2:ff:00:00:00:01,eth_dst=f2:ff:00:00:00:02,eth_type=0x894f], ++ [nsh_ttl=8,nsh_np=3,nsh_spi=0x100,nsh_si=1,nsh_mdtype=1], ++ [nsh_c1=0x01020304,nsh_c2=0x05060708,nsh_c3=0x090a0b0c,nsh_c4=0x0d0e0f10])]) ++ ++NS_CHECK_EXEC([at_ns1], [$PYTHON3 $srcdir/sendpkt.py p1 \ ++ "$(ovs-ofctl compose-packet --bare 'NSH_HEADER_2')" \ ++ "$(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT')"], ++ [0], [ignore]) ++ ++dnl Check for the above packet on p2 interface. ++OVS_WAIT_UNTIL([ovs-pcap p2.pcap | grep -q "m4_join([], [^], ++ $(ovs-ofctl compose-packet --bare 'NSH_HEADER_2'), ++ $(ovs-ofctl compose-packet --bare 'TCP_SYN_PKT'), [\$])"]) OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP @@ -125588,10 +125990,28 @@ index fbe6e4f560..2c1766eff5 100755 for flowFile in args.flowFiles: logging.info("reading flows from %s", flowFile) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c -index ede7f1e61a..5c431e9cfc 100644 +index ede7f1e61a..f1cef07b49 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c -@@ -730,12 +730,12 @@ static void +@@ -153,6 +153,9 @@ static int show_stats = 1; + /* --pcap: Makes "compose-packet" print a pcap on stdout. */ + static int print_pcap = 0; + ++/* --bare: Makes "compose-packet" print a bare hexified payload. */ ++static int print_bare = 0; ++ + /* --raw: Makes "ofp-print" read binary data from stdin. */ + static int raw = 0; + +@@ -242,6 +245,7 @@ parse_options(int argc, char *argv[]) + {"color", optional_argument, NULL, OPT_COLOR}, + {"may-create", no_argument, NULL, OPT_MAY_CREATE}, + {"pcap", no_argument, &print_pcap, 1}, ++ {"bare", no_argument, &print_bare, 1}, + {"raw", no_argument, &raw, 1}, + {"read-only", no_argument, NULL, OPT_READ_ONLY}, + DAEMON_LONG_OPTIONS, +@@ -730,12 +734,12 @@ static void bundle_print_errors(struct ovs_list *errors, struct ovs_list *requests, const char *vconn_name) { @@ -125606,7 +126026,63 @@ index ede7f1e61a..5c431e9cfc 100644 const struct ofp_header *error_oh = error->data; ovs_be32 error_xid = error_oh->xid; enum ofperr ofperr; -@@ -5041,7 +5041,7 @@ static const struct ovs_cmdl_command all_commands[] = { +@@ -4876,20 +4880,31 @@ ofctl_parse_key_value(struct ovs_cmdl_context *ctx) + } + } + +-/* "compose-packet [--pcap] FLOW [L7]": Converts the OpenFlow flow +- * specification FLOW to a packet with flow_compose() and prints the hex bytes +- * in the packet on stdout. Also verifies that the flow extracted from that +- * packet matches the original FLOW. ++/* "compose-packet [--pcap|--bare] FLOW [L7]": Converts the ++ * OpenFlow flow specification FLOW to a packet with flow_compose() and prints ++ * the hex bytes of the packet, with offsets, to stdout. ++ * ++ * With --pcap, prints the packet in pcap format, so that you can do something ++ * like "ovs-ofctl --pcap compose-packet udp | tcpdump -vvvv -r-" to use ++ * another tool to dump the packet contents. + * +- * With --pcap, prints the packet to stdout instead as a pcap file, so that you +- * can do something like "ovs-ofctl --pcap compose-packet udp | tcpdump -vvvv +- * -r-" to use another tool to dump the packet contents. ++ * With --bare, prints the packet as a single bare hex string with no ++ * spaces or offsets, so that you can pass the result directly to e.g. ++ * "ovs-appctl netdev-dummy/receive vif $(ovs-ofctl compose-packet --bare ++ * FLOW)" ++ * ++ * Regardless of the mode, the command also verifies that the flow extracted ++ * from that packet matches the original FLOW. + * + * If L7 is specified, draws the L7 payload data from it, otherwise defaults to + * 64 bytes of payload. */ + static void + ofctl_compose_packet(struct ovs_cmdl_context *ctx) + { ++ if (print_pcap && print_bare) { ++ ovs_fatal(1, "--bare and --pcap are mutually exclusive"); ++ } ++ + if (print_pcap && isatty(STDOUT_FILENO)) { + ovs_fatal(1, "not writing pcap data to stdout; redirect to a file " + "or pipe to tcpdump instead"); +@@ -4925,6 +4940,16 @@ ofctl_compose_packet(struct ovs_cmdl_context *ctx) + ovs_pcap_write_header(p_file); + ovs_pcap_write(p_file, &p); + ovs_pcap_close(p_file); ++ } else if (print_bare) { ++ /* Binary to a bare hex string. */ ++ for (int i = 0; i < dp_packet_size(&p); i++) { ++ uint8_t val = ((uint8_t *) dp_packet_data(&p))[i]; ++ /* Don't use ds_put_hex because it adds 0x prefix as well as ++ * it doesn't guarantee an even number of payload characters, which ++ * may be important elsewhere (e.g. in netdev-dummy/receive). */ ++ printf("%02" PRIx8, val); ++ } ++ + } else { + ovs_hex_dump(stdout, dp_packet_data(&p), dp_packet_size(&p), 0, false); + } +@@ -5041,7 +5066,7 @@ static const struct ovs_cmdl_command all_commands[] = { 1, 1, ofctl_dump_ipfix_flow, OVS_RO }, { "ct-flush-zone", "switch zone", diff --git a/SPECS/openvswitch2.17.spec b/SPECS/openvswitch2.17.spec index 869b939..283fff2 100644 --- a/SPECS/openvswitch2.17.spec +++ b/SPECS/openvswitch2.17.spec @@ -57,7 +57,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.17.0 -Release: 155%{?dist} +Release: 156%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -751,6 +751,17 @@ exit 0 %endif %changelog +* Wed Jun 05 2024 Open vSwitch CI - 2.17.0-156 +- Merging upstream branch-2.17 [RH git: 72ac71bb0c] + Commit list: + 3930bc7446 nsh: Add support to compose-packet and use it in system tests. + ef39373fd1 tests: Convert ND, MPLS and CT sendpkt tests to compose-packet. + 244f90d559 tests: sendpkt: Allow different input formats. + 171398797b ovs-ofctl: Implement compose-packet --bare. + 526044b56d ipf: Handle common case of ipf defragmentation. + d9465f907e ipf: Only add fragments to batch of same dl_type. + + * Mon Jun 03 2024 Open vSwitch CI - 2.17.0-155 - Merging upstream branch-2.17 [RH git: 277e5df78d] Commit list: