diff --git a/SOURCES/openvswitch-2.11.3.patch b/SOURCES/openvswitch-2.11.3.patch index 40dc388..58b68f9 100644 --- a/SOURCES/openvswitch-2.11.3.patch +++ b/SOURCES/openvswitch-2.11.3.patch @@ -869,6 +869,19 @@ index f15b1ff670..71813077c6 100644 if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then +diff --git a/build-aux/dist-docs b/build-aux/dist-docs +index 9f6ca7b2cb..85641745ee 100755 +--- a/build-aux/dist-docs ++++ b/build-aux/dist-docs +@@ -43,7 +43,7 @@ rm -rf $distdir + mkdir $distdir + + # Install manpages. +-${MAKE-make} install-man mandir="$abs_distdir"/man ++${MAKE-make} install-man install-man-rst mandir="$abs_distdir"/man + (cd $distdir && mv `find man -type f` . && rm -rf man) + manpages=`cd $distdir && echo *` + diff --git a/configure.ac b/configure.ac index 45ff8cb07e..90f8e1f0d9 100644 --- a/configure.ac @@ -15124,7 +15137,7 @@ index d1bd4aa12a..f646a8f742 100644 enum { diff --git a/lib/conntrack.c b/lib/conntrack.c -index ea9486b735..2d050b627e 100644 +index ea9486b735..07ffc05e57 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -640,7 +640,7 @@ static void @@ -15132,7 +15145,7 @@ index ea9486b735..2d050b627e 100644 { char *tail = dp_packet_tail(pkt); - char pad = dp_packet_l2_pad_size(pkt); -+ uint8_t pad = dp_packet_l2_pad_size(pkt); ++ uint16_t pad = dp_packet_l2_pad_size(pkt); struct conn_key inner_key; const char *inner_l4 = NULL; uint16_t orig_l3_ofs = pkt->l3_ofs; @@ -15290,6 +15303,47 @@ index ea9486b735..2d050b627e 100644 ctx->hash = conn_key_hash(&ctx->key, ct->hash_basis); return true; } +diff --git a/lib/dp-packet.h b/lib/dp-packet.h +index c297a8f509..86a8f846ff 100644 +--- a/lib/dp-packet.h ++++ b/lib/dp-packet.h +@@ -65,7 +65,7 @@ struct dp_packet { + + /* All the following elements of this struct are copied in a single call + * of memcpy in dp_packet_clone_with_headroom. */ +- uint8_t l2_pad_size; /* Detected l2 padding size. ++ uint16_t l2_pad_size; /* Detected l2 padding size. + * Padding is non-pullable. */ + uint16_t l2_5_ofs; /* MPLS label stack offset, or UINT16_MAX */ + uint16_t l3_ofs; /* Network-level header offset, +@@ -95,8 +95,8 @@ void *dp_packet_resize_l2(struct dp_packet *, int increment); + void *dp_packet_resize_l2_5(struct dp_packet *, int increment); + static inline void *dp_packet_eth(const struct dp_packet *); + static inline void dp_packet_reset_offsets(struct dp_packet *); +-static inline uint8_t dp_packet_l2_pad_size(const struct dp_packet *); +-static inline void dp_packet_set_l2_pad_size(struct dp_packet *, uint8_t); ++static inline uint16_t dp_packet_l2_pad_size(const struct dp_packet *); ++static inline void dp_packet_set_l2_pad_size(struct dp_packet *, uint16_t); + static inline void *dp_packet_l2_5(const struct dp_packet *); + static inline void dp_packet_set_l2_5(struct dp_packet *, void *); + static inline void *dp_packet_l3(const struct dp_packet *); +@@ -295,14 +295,14 @@ dp_packet_reset_offsets(struct dp_packet *b) + b->l4_ofs = UINT16_MAX; + } + +-static inline uint8_t ++static inline uint16_t + dp_packet_l2_pad_size(const struct dp_packet *b) + { + return b->l2_pad_size; + } + + static inline void +-dp_packet_set_l2_pad_size(struct dp_packet *b, uint8_t pad_size) ++dp_packet_set_l2_pad_size(struct dp_packet *b, uint16_t pad_size) + { + ovs_assert(pad_size <= dp_packet_size(b)); + b->l2_pad_size = pad_size; diff --git a/lib/dpctl.c b/lib/dpctl.c index bea9f87e86..8e37a29b42 100644 --- a/lib/dpctl.c @@ -15616,15 +15670,26 @@ index 475d5a674e..c425042d91 100644 /* Log functions. */ struct vlog_module; diff --git a/lib/flow.c b/lib/flow.c -index 2cf8a020ae..1379efcdf8 100644 +index 2cf8a020ae..4eeb09d426 100644 --- a/lib/flow.c +++ b/lib/flow.c -@@ -685,7 +685,7 @@ ipv6_sanity_check(const struct ovs_16aligned_ip6_hdr *nh, size_t size) +@@ -646,7 +646,7 @@ ipv4_sanity_check(const struct ip_header *nh, size_t size, + + tot_len = ntohs(nh->ip_tot_len); + if (OVS_UNLIKELY(tot_len > size || ip_len > tot_len || +- size - tot_len > UINT8_MAX)) { ++ size - tot_len > UINT16_MAX)) { + return false; + } + +@@ -684,8 +684,8 @@ ipv6_sanity_check(const struct ovs_16aligned_ip6_hdr *nh, size_t size) + if (OVS_UNLIKELY(plen + IPV6_HEADER_LEN > size)) { return false; } - /* Jumbo Payload option not supported yet. */ +- /* Jumbo Payload option not supported yet. */ - if (OVS_UNLIKELY(size - plen > UINT8_MAX)) { -+ if (OVS_UNLIKELY(size - (plen + IPV6_HEADER_LEN) > UINT8_MAX)) { ++ ++ if (OVS_UNLIKELY(size - (plen + IPV6_HEADER_LEN) > UINT16_MAX)) { return false; } @@ -20266,6 +20331,50 @@ index 92d56b29de..875f23f6a0 100644 SYSTEM_TESTSUITE_AT = \ tests/system-common-macros.at \ +diff --git a/tests/classifier.at b/tests/classifier.at +index 86f872db6b..a63d8c32d7 100644 +--- a/tests/classifier.at ++++ b/tests/classifier.at +@@ -306,3 +306,39 @@ ovs-ofctl: Incorrect instruction ordering + ]) + OVS_VSWITCHD_STOP + AT_CLEANUP ++ ++# Flow classifier a packet with excess of padding. ++AT_SETUP([flow classifier - packet with extra padding]) ++OVS_VSWITCHD_START ++add_of_ports br0 1 2 ++AT_DATA([flows.txt], [dnl ++priority=5,ip,ip_dst=1.1.1.1,actions=1 ++priority=5,ip,ip_dst=1.1.1.2,actions=2 ++priority=0,actions=drop ++]) ++AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) ++packet=00020202020000010101010008004500001c00010000401176cc01010101010101020d6a00350008ee3a ++AT_CHECK([ovs-appctl ofproto/trace br0 in_port=1 $packet] , [0], [stdout]) ++AT_CHECK([tail -2 stdout], [0], ++ [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_dst=1.1.1.2,nw_frag=no ++Datapath actions: 2 ++]) ++# normal packet plus 255 bytes of padding (8bit padding). ++# 255 * 2 = 510 ++padding=$(printf '%*s' 510 | tr ' ' '0') ++AT_CHECK([ovs-appctl ofproto/trace br0 in_port=1 ${packet}${padding}] , [0], [stdout]) ++AT_CHECK([tail -2 stdout], [0], ++ [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_dst=1.1.1.2,nw_frag=no ++Datapath actions: 2 ++]) ++# normal packet plus padding up to 65535 bytes of length (16bit limit). ++# 65535 - 43 = 65492 ++# 65492 * 2 = 130984 ++padding=$(printf '%*s' 130984 | tr ' ' '0') ++AT_CHECK([ovs-appctl ofproto/trace br0 in_port=1 ${packet}${padding}], [0], [stdout]) ++AT_CHECK([tail -2 stdout], [0], ++ [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_dst=1.1.1.2,nw_frag=no ++Datapath actions: 2 ++]) ++OVS_VSWITCHD_STOP ++AT_CLEANUP diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at index 6915d43ba1..9295f5a0ec 100644 --- a/tests/dpif-netdev.at diff --git a/SPECS/openvswitch2.11.spec b/SPECS/openvswitch2.11.spec index 9ec3c08..fb41e04 100644 --- a/SPECS/openvswitch2.11.spec +++ b/SPECS/openvswitch2.11.spec @@ -66,7 +66,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.11.3 -Release: 82%{?dist} +Release: 84%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -745,6 +745,14 @@ exit 0 %changelog +* Fri Feb 05 2021 Open vSwitch CI - 2.11.3-84 +- Merging upstream branch-2.11 + [a4f1272cee605e664aaea91ae28daff5a24857d6] + +* Thu Feb 04 2021 Timothy Redaelli - 2.11.3-83 +- flow: Support extra padding length. + [35a473f35c7227fcf9db3a338c52bc6f8bd4fa97] + * Wed Feb 03 2021 Open vSwitch CI - 2.11.3-82 - Merging upstream branch-2.11 [2e04729b438263639f321cdebb0191e0de668fd9]