Check if vlans are enabled on a localnet port running on the logical switch connected to this logical router in order to compute the mac header size (14 bytes for ethernet or 18 for 802.1q).
Tested-by: Eduardo Olivares <[email protected]> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2075121 Signed-off-by: Lorenzo Bianconi <[email protected]> --- northd/northd.c | 25 +++++++++++++- tests/ovn-northd.at | 57 +++++++++++++++++++------------- tests/ovn.at | 80 ++++++++++++++++++++++----------------------- 3 files changed, 99 insertions(+), 63 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index bcd36bbaa..68028284d 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -10747,6 +10747,28 @@ build_adm_ctrl_flows_for_lrouter( } } +static int +build_gateway_get_l2_hdr_size(struct ovn_port *op) +{ + struct ovn_port *peer = op->peer; + + if (peer && peer->od && peer->od->nbs) { + /* Check if vlans are enabled on a localnet port running the logical + * switch connected to this logical router. + */ + for (size_t i = 0; i < peer->od->n_localnet_ports; i++) { + struct ovn_port *localnet_port = peer->od->localnet_ports[i]; + const struct nbrec_logical_switch_port *nbsp = localnet_port->nbsp; + + if (nbsp && nbsp->n_tag_request > 0) { + return VLAN_ETH_HEADER_LEN; + } + } + } + + return ETH_HEADER_LEN; +} + /* All 'gateway_mtu' and 'gateway_mtu_bypass' flows should be built with this * function. */ @@ -10764,8 +10786,9 @@ build_gateway_mtu_flow(struct hmap *lflows, struct ovn_port *op, ds_clear(actions); if (gw_mtu > 0) { + int l2_hdr_size = build_gateway_get_l2_hdr_size(op); ds_put_format(actions, REGBIT_PKT_LARGER" = check_pkt_larger(%d); ", - gw_mtu + VLAN_ETH_HEADER_LEN); + gw_mtu + l2_hdr_size); } ds_put_format_valist(actions, extra_actions_fmt, extra_actions_args); diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index adb304385..3e21afbdf 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -5489,7 +5489,7 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw0" && outport == "lr0-public" && ip4 && reg9[[1]] && reg9[[0]] == 0), action=(icmp4_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:01; ip4.dst = ip4.src; ip4.src = 10.0.0.1; ip.ttl = 255; icmp4.type = 3; /* Destination Unreachable. */ icmp4.code = 4; /* Frag Needed and DF was Set. */ icmp4.frag_mtu = 1500; next(pipeline=ingress, table=0); };) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw0" && outport == "lr0-public" && ip6 && reg9[[1]] && reg9[[0]] == 0), action=(icmp6_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:01; ip6.dst = ip6.src; ip6.src = fe80::200:ff:fe00:ff01; ip.ttl = 255; icmp6.type = 2; /* Packet Too Big. */ icmp6.code = 0; icmp6.frag_mtu = 1500; next(pipeline=ingress, table=0); };) @@ -5498,8 +5498,8 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. ]) AT_CHECK([grep -E "lr_in_admission.*check_pkt_larger" lr0flows | sort], [0], [dnl - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public" && is_chassis_resident("cr-lr0-public")), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public" && is_chassis_resident("cr-lr0-public")), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) ]) AT_CHECK([grep -E "lr_in_ip_input.*icmp4_error" lr0flows | sort], [0], [dnl @@ -5520,7 +5520,7 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw0" && outport == "lr0-public" && ip4 && reg9[[1]] && reg9[[0]] == 0), action=(icmp4_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:01; ip4.dst = ip4.src; ip4.src = 10.0.0.1; ip.ttl = 255; icmp4.type = 3; /* Destination Unreachable. */ icmp4.code = 4; /* Frag Needed and DF was Set. */ icmp4.frag_mtu = 1500; next(pipeline=ingress, table=0); };) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw0" && outport == "lr0-public" && ip6 && reg9[[1]] && reg9[[0]] == 0), action=(icmp6_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:01; ip6.dst = ip6.src; ip6.src = fe80::200:ff:fe00:ff01; ip.ttl = 255; icmp6.type = 2; /* Packet Too Big. */ icmp6.code = 0; icmp6.frag_mtu = 1500; next(pipeline=ingress, table=0); };) @@ -5529,8 +5529,8 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. ]) AT_CHECK([grep -E "lr_in_admission.*check_pkt_larger" lr0flows | sort], [0], [dnl - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) ]) AT_CHECK([grep -E "lr_in_ip_input.*icmp4_error" lr0flows | sort], [0], [dnl @@ -5548,7 +5548,7 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); next;) table=??(lr_in_chk_pkt_len ), priority=55 , match=(outport == "lr0-public" && (tcp)), action=(next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw0" && outport == "lr0-public" && ip4 && reg9[[1]] && reg9[[0]] == 0), action=(icmp4_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:01; ip4.dst = ip4.src; ip4.src = 10.0.0.1; ip.ttl = 255; icmp4.type = 3; /* Destination Unreachable. */ icmp4.code = 4; /* Frag Needed and DF was Set. */ icmp4.frag_mtu = 1500; next(pipeline=ingress, table=0); };) @@ -5558,8 +5558,8 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. ]) AT_CHECK([grep "lr_in_admission" lr0flows | grep -e "check_pkt_larger" -e "tcp" | sort], [0], [dnl - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) table=0 (lr_in_admission ), priority=55 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public" && (tcp)), action=(xreg0[[0..47]] = 00:00:20:20:12:13; next;) table=0 (lr_in_admission ), priority=55 , match=(eth.mcast && inport == "lr0-public" && (tcp)), action=(xreg0[[0..47]] = 00:00:20:20:12:13; next;) ]) @@ -5572,8 +5572,8 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); next;) table=??(lr_in_chk_pkt_len ), priority=55 , match=(outport == "lr0-public" && (tcp)), action=(next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-public" && outport == "lr0-sw0" && ip4 && reg9[[1]] && reg9[[0]] == 0), action=(icmp4_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:20:20:12:13; ip4.dst = ip4.src; ip4.src = 172.168.0.100; ip.ttl = 255; icmp4.type = 3; /* Destination Unreachable. */ icmp4.code = 4; /* Frag Needed and DF was Set. */ icmp4.frag_mtu = 1400; next(pipeline=ingress, table=0); };) @@ -5587,10 +5587,10 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. ]) AT_CHECK([grep "lr_in_admission.*check_pkt_larger" lr0flows | sort], [0], [dnl - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:00:00:ff:01 && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:00:00:ff:01 && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) ]) AT_CHECK([grep -E "lr_in_ip_input.*icmp4_error" lr0flows | sort], [0], [dnl @@ -5610,8 +5610,8 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); next;) table=??(lr_in_chk_pkt_len ), priority=55 , match=(outport == "lr0-public" && (tcp)), action=(next;) table=??(lr_in_chk_pkt_len ), priority=55 , match=(outport == "lr0-sw0" && (tcp)), action=(next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) @@ -5626,10 +5626,10 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. ]) AT_CHECK([grep "lr_in_admission" lr0flows | grep -e "check_pkt_larger" -e "tcp" | sort], [0], [dnl - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:00:00:ff:01 && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) - table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:00:00:ff:01 && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1514); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); xreg0[[0..47]] = 00:00:00:00:ff:01; next;) table=0 (lr_in_admission ), priority=55 , match=(eth.dst == 00:00:00:00:ff:01 && inport == "lr0-sw0" && (tcp)), action=(xreg0[[0..47]] = 00:00:00:00:ff:01; next;) table=0 (lr_in_admission ), priority=55 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public" && (tcp)), action=(xreg0[[0..47]] = 00:00:20:20:12:13; next;) table=0 (lr_in_admission ), priority=55 , match=(eth.mcast && inport == "lr0-public" && (tcp)), action=(xreg0[[0..47]] = 00:00:20:20:12:13; next;) @@ -5643,7 +5643,7 @@ AT_CAPTURE_FILE([lr0flows]) AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=../table=??/' | sort], [0], [dnl table=??(lr_in_chk_pkt_len ), priority=0 , match=(1), action=(next;) - table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1418); next;) + table=??(lr_in_chk_pkt_len ), priority=50 , match=(outport == "lr0-sw0"), action=(reg9[[1]] = check_pkt_larger(1414); next;) table=??(lr_in_chk_pkt_len ), priority=55 , match=(outport == "lr0-sw0" && (tcp)), action=(next;) table=??(lr_in_larger_pkts ), priority=0 , match=(1), action=(next;) table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-public" && outport == "lr0-sw0" && ip4 && reg9[[1]] && reg9[[0]] == 0), action=(icmp4_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:20:20:12:13; ip4.dst = ip4.src; ip4.src = 172.168.0.100; ip.ttl = 255; icmp4.type = 3; /* Destination Unreachable. */ icmp4.code = 4; /* Frag Needed and DF was Set. */ icmp4.frag_mtu = 1400; next(pipeline=ingress, table=0); };) @@ -5652,6 +5652,19 @@ AT_CHECK([grep -e "chk_pkt_len" -e "lr_in_larger_pkts" lr0flows | sed 's/table=. table=??(lr_in_larger_pkts ), priority=150 , match=(inport == "lr0-sw1" && outport == "lr0-sw0" && ip6 && reg9[[1]] && reg9[[0]] == 0), action=(icmp6_error {reg9[[0]] = 1; reg9[[1]] = 0; eth.dst = 00:00:00:00:ff:02; ip6.dst = ip6.src; ip6.src = fe80::200:ff:fe00:ff02; ip.ttl = 255; icmp6.type = 2; /* Packet Too Big. */ icmp6.code = 0; icmp6.frag_mtu = 1400; next(pipeline=ingress, table=0); };) ]) +check ovn-nbctl --wait=sb clear logical_router_port lr0-sw0 options +check ovn-nbctl --wait=sb set logical_router_port lr0-public options:gateway_mtu=1500 +check ovn-nbctl lsp-add public ext-port +check ovn-nbctl lsp-set-addresses ext-port unknown +check ovn-nbctl lsp-set-type ext-port localnet +check ovn-nbctl --wait=sb set Logical_Switch_Port ext-port tag_request=2 +ovn-sbctl dump-flows lr0 > lr0flows + +AT_CHECK([grep "lr_in_admission" lr0flows | grep -e "check_pkt_larger" | sort], [0], [dnl + table=0 (lr_in_admission ), priority=50 , match=(eth.dst == 00:00:20:20:12:13 && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) + table=0 (lr_in_admission ), priority=50 , match=(eth.mcast && inport == "lr0-public"), action=(reg9[[1]] = check_pkt_larger(1518); xreg0[[0..47]] = 00:00:20:20:12:13; next;) +]) + AT_CLEANUP ]) diff --git a/tests/ovn.at b/tests/ovn.at index f9551b843..9557677f2 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -17450,22 +17450,22 @@ test_ip_packet_larger() { dst_mac="00000000ff01" # sw0-lr0 mac (internal router leg) src_ip=`ip_to_hex 10 0 0 3` dst_ip=`ip_to_hex 172 168 0 3` - # Set the packet length to 118. - pkt_len=0076 - packet=${dst_mac}${src_mac}08004500${pkt_len}000000004001c3d9 - orig_packet_l3=${src_ip}${dst_ip}0304000000000000 - orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 + # Set the packet length to 114. + pkt_len=0072 + packet=${dst_mac}${src_mac}08004500${pkt_len}000000004001c3dd + orig_packet_l3=${src_ip}${dst_ip}0304fcfb00000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 + orig_packet_l3=${orig_packet_l3}0000000000000000000000000000 packet=${packet}${orig_packet_l3} gw_ip_garp=ffffffffffff00002020121308060001080006040001000020201213aca80064000000000000aca80064 packet_bytes=$(expr ${#packet} / 2) - mtu_needed=$(expr ${packet_bytes} - 18) + mtu_needed=$(expr ${packet_bytes} - 14) # If icmp_pmtu_reply_expected is 0, it means the packet is lesser than # the gateway mtu and should be delivered to the provider bridge via the @@ -17479,23 +17479,23 @@ test_ip_packet_larger() { dst_mac="00000012af11" src_ip=`ip_to_hex 10 0 0 3` dst_ip=`ip_to_hex 172 168 0 3` - expected=${dst_mac}${src_mac}08004500${pkt_len}000000003f01c4d9 - expected=${expected}${src_ip}${dst_ip}0304000000000000 - expected=${expected}000000000000000000000000000000000000 + expected=${dst_mac}${src_mac}08004500${pkt_len}000000003f01c4dd + expected=${expected}${src_ip}${dst_ip}0304fcfb00000000 expected=${expected}000000000000000000000000000000000000 expected=${expected}000000000000000000000000000000000000 expected=${expected}000000000000000000000000000000000000 expected=${expected}000000000000000000000000000000000000 + expected=${expected}0000000000000000000000000000 echo $expected > br_phys_n1.expected else src_ip=`ip_to_hex 10 0 0 1` dst_ip=`ip_to_hex 10 0 0 3` # pkt len should be 146 (28 (icmp packet) + 118 (orig ip + payload)) - reply_pkt_len=0092 - ip_csum=f993 - icmp_reply=${src_mac}${dst_mac}08004500${reply_pkt_len}00004000fe016867 + reply_pkt_len=008e + ip_csum=fc97 + icmp_reply=${src_mac}${dst_mac}08004500${reply_pkt_len}00004000fe01686b icmp_reply=${icmp_reply}${src_ip}${dst_ip}0304${ip_csum}0000$(printf "%04x" $mtu) - icmp_reply=${icmp_reply}4500${pkt_len}000000003f01c4d9 + icmp_reply=${icmp_reply}4500${pkt_len}000000003f01c4dd icmp_reply=${icmp_reply}${orig_packet_l3} echo $icmp_reply > hv1-vif1.expected fi @@ -17538,15 +17538,15 @@ test_ip_packet_larger_ext() { dst_mac="$2" # lr0-public mac src_ip=`ip_to_hex 172 168 0 4` dst_ip="$3" - # Set the packet length to 118. - pkt_len=0076 + # Set the packet length to 114. + pkt_len=0072 packet=${dst_mac}${src_mac}08004500${pkt_len}000000004001${checksum} orig_packet_l3=${src_ip}${dst_ip}0900000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 - orig_packet_l3=${orig_packet_l3}000000000000000000000000000000000000 + orig_packet_l3=${orig_packet_l3}0000000000000000000000000000 packet=${packet}${orig_packet_l3} # A Gratuitous ARP (as shown next line) might be transmitted, but @@ -17557,8 +17557,8 @@ test_ip_packet_larger_ext() { src_ip="$3" dst_ip=`ip_to_hex 172 168 0 4` # pkt len should be 146 (28 (icmp packet) + 118 (orig ip + payload)) - reply_pkt_len=0092 - ip_csum=f397 + reply_pkt_len=008e + ip_csum=f39b icmp_reply=${src_mac}${dst_mac}08004500${reply_pkt_len}00004000fe01${reply_checksum} icmp_reply=${icmp_reply}${src_ip}${dst_ip}0304${ip_csum}0000$(printf "%04x" $mtu) icmp_reply=${icmp_reply}4500${pkt_len}000000004001${checksum} @@ -17590,10 +17590,10 @@ test_ip6_packet_larger() { local payload=0000000000000000000000000000000000000000 local payload=${payload}0000000000000000000000000000000000000000 local payload=${payload}0000000000000000000000000000000000000000 - local payload=${payload}0000000000000000000000000000000000000000 + local payload=${payload}00000000000000000000000000000000 - local ip6_hdr=6000000000583afe${ipv6_src}${ipv6_dst} - local packet=${eth_dst}${eth_src}86dd${ip6_hdr}8000ec7662f00001${payload} + local ip6_hdr=6000000000543afe${ipv6_src}${ipv6_dst} + local packet=${eth_dst}${eth_src}86dd${ip6_hdr}8000ec7a62f00001${payload} as hv1 reset_pcap_file br-phys_n1 hv1/br-phys_n1 as hv1 reset_pcap_file hv1-vif1 hv1/vif1 @@ -17606,16 +17606,16 @@ test_ip6_packet_larger() { AT_CAPTURE_FILE([trace-$mtu]) packet_bytes=$(expr ${#packet} / 2) - mtu_needed=$(expr ${packet_bytes} - 18) + mtu_needed=$(expr ${packet_bytes} - 14) if test $mtu -lt $mtu_needed; then # First construct the inner IPv6 packet. - inner_ip6=6000000000583afd${ipv6_src}${ipv6_dst} + inner_ip6=6000000000543afd${ipv6_src}${ipv6_dst} inner_icmp6=8000000062f00001 inner_icmp6_and_payload=$(icmp6_csum_inplace ${inner_icmp6}${payload} ${inner_ip6}) inner_packet=${inner_ip6}${inner_icmp6_and_payload} # Then the outer. - outer_ip6=6000000000883afe${ipv6_rt}${ipv6_src} + outer_ip6=6000000000843afe${ipv6_rt}${ipv6_src} outer_icmp6_and_payload=$(icmp6_csum_inplace 020000000000$(printf "%04x" $mtu)${inner_packet} $outer_ip6) outer_packet=${outer_ip6}${outer_icmp6_and_payload} @@ -17646,9 +17646,9 @@ test_ip6_packet_larger_ext() { local payload=0000000000000000000000000000000000000000 local payload=${payload}0000000000000000000000000000000000000000 local payload=${payload}0000000000000000000000000000000000000000 - local payload=${payload}0000000000000000000000000000000000000000 + local payload=${payload}00000000000000000000000000000000 - local ip6_hdr=6000000000583afe${ipv6_src}${ipv6_dst} + local ip6_hdr=6000000000543afe${ipv6_src}${ipv6_dst} local packet=${eth_dst}${eth_src}86dd${ip6_hdr}9000${icmp_checksum}62f00001${payload} # Some ** ARP ** packets might still be received - ignore them @@ -17663,13 +17663,13 @@ test_ip6_packet_larger_ext() { AT_CAPTURE_FILE([trace-$mtu]) # First construct the inner IPv6 packet. - inner_ip6=6000000000583afe${ipv6_src}${ipv6_dst} + inner_ip6=6000000000543afe${ipv6_src}${ipv6_dst} inner_icmp6=9000000062f00001 inner_icmp6_and_payload=$(icmp6_csum_inplace ${inner_icmp6}${payload} ${inner_ip6}) inner_packet=${inner_ip6}${inner_icmp6_and_payload} # Then the outer. - outer_ip6=6000000000883afe${ipv6_dst}${ipv6_src} + outer_ip6=6000000000843afe${ipv6_dst}${ipv6_src} outer_icmp6_and_payload=$(icmp6_csum_inplace 020000000000$(printf "%04x" $mtu)${inner_packet} $outer_ip6) outer_packet=${outer_ip6}${outer_icmp6_and_payload} @@ -17702,7 +17702,7 @@ logical_port=lr0-public mac="00\:00\:00\:12\:af\:11" # Try different gateway mtus and send a 142-byte packet (corresponding # to a 124-byte MTU). If the MTU is less than 124, ovn-controller # should send icmp host not reachable with pmtu set to $mtu. -for mtu in 100 500 118; do +for mtu in 100 500 114; do AS_BOX([testing mtu $mtu]) check ovn-nbctl --wait=hv set logical_router_port lr0-public options:gateway_mtu=$mtu ovn-sbctl dump-flows > sbflows-$mtu @@ -17711,7 +17711,7 @@ for mtu in 100 500 118; do OVS_WAIT_FOR_OUTPUT([ as hv1 ovs-ofctl dump-flows br-int > br-int-flows-$mtu AT_CAPTURE_FILE([br-int-flows-$mtu]) - grep "check_pkt_larger($(expr $mtu + 18))" br-int-flows-$mtu | wc -l], [0], [4 + grep "check_pkt_larger($(expr $mtu + 14))" br-int-flows-$mtu | wc -l], [0], [4 ]) AS_BOX([testing outgoing traffic mtu $mtu - IPv4]) @@ -17729,20 +17729,20 @@ AT_CAPTURE_FILE([ext-sbflows-100]) OVS_WAIT_FOR_OUTPUT([ as hv1 ovs-ofctl dump-flows br-int > ext-br-int-flows-100 AT_CAPTURE_FILE([ext-br-int-flows-100]) - grep "check_pkt_larger(118)" ext-br-int-flows-100 | wc -l], [0], [4 + grep "check_pkt_larger(114)" ext-br-int-flows-100 | wc -l], [0], [4 ]) AS_BOX([testing ingress traffic mtu 100 - IPv4]) -test_ip_packet_larger_ext 1 000020201213 $(ip_to_hex 172 168 0 100) 20cf 100 22b2 +test_ip_packet_larger_ext 1 000020201213 $(ip_to_hex 172 168 0 100) 20cf 100 22b6 AS_BOX([testing ingress traffic mtu 100 - IPv4 FIP]) -test_ip_packet_larger_ext 2 f00000010204 $(ip_to_hex 172 168 0 110) 20c5 100 22a8 +test_ip_packet_larger_ext 2 f00000010204 $(ip_to_hex 172 168 0 110) 20c5 100 22ac AS_BOX([testing ingress traffic mtu 100 - IPv6]) -test_ip6_packet_larger_ext 1 000020201213 20000000000000000000000000000001 100 cc76 +test_ip6_packet_larger_ext 1 000020201213 20000000000000000000000000000001 100 cc7a AS_BOX([testing ingress traffic mtu 100 - IPv6 FIP]) -test_ip6_packet_larger_ext 2 f00000010204 20000000000000000000000000000002 100 cc75 +test_ip6_packet_larger_ext 2 f00000010204 20000000000000000000000000000002 100 cc79 ovn-nbctl lsp-del sw0-lr0 @@ -17772,7 +17772,7 @@ logical_port=lr1-public mac="00\:00\:00\:12\:af\:11" # Try different gateway mtus and send a 142-byte packet (corresponding # to a 124-byte MTU). If the MTU is less than 124, ovn-controller # should send icmp host not reachable with pmtu set to $mtu. -for mtu in 100 500 118; do +for mtu in 100 500 114; do AS_BOX([testing gw mtu $mtu]) check ovn-nbctl --wait=hv set logical_router_port lr1-public options:gateway_mtu=$mtu ovn-sbctl dump-flows > sbflows-gw-$mtu @@ -17781,7 +17781,7 @@ for mtu in 100 500 118; do OVS_WAIT_FOR_OUTPUT([ as hv1 ovs-ofctl dump-flows br-int > br-int-gw-flows-$mtu AT_CAPTURE_FILE([br-int-gw-flows-$mtu]) - grep "check_pkt_larger($(expr $mtu + 18))" br-int-gw-flows-$mtu | wc -l], [0], [3 + grep "check_pkt_larger($(expr $mtu + 14))" br-int-gw-flows-$mtu | wc -l], [0], [3 ]) AS_BOX([testing outgoing traffic mtu $mtu for gw router - IPv4]) @@ -17799,14 +17799,14 @@ AT_CAPTURE_FILE([ext-gw-sbflows-100]) OVS_WAIT_FOR_OUTPUT([ as hv1 ovs-ofctl dump-flows br-int > ext-br-int-gw-flows-100 AT_CAPTURE_FILE([ext-br-int-gw-flows-100]) - grep "check_pkt_larger(118)" ext-br-int-gw-flows-100 | wc -l], [0], [3 + grep "check_pkt_larger(114)" ext-br-int-gw-flows-100 | wc -l], [0], [3 ]) AS_BOX([testing ingress traffic mtu 100 for gw router - IPv4]) -test_ip_packet_larger_ext 1 000020201213 $(ip_to_hex 172 168 0 100) 20cf 100 22b2 +test_ip_packet_larger_ext 1 000020201213 $(ip_to_hex 172 168 0 100) 20cf 100 22b6 AS_BOX([testing ingress traffic mtu 100 for gw router - IPv6]) -test_ip6_packet_larger_ext 1 000020201213 20000000000000000000000000000001 100 cc76 +test_ip6_packet_larger_ext 1 000020201213 20000000000000000000000000000001 100 cc7a OVN_CLEANUP([hv1]) AT_CLEANUP -- 2.35.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
