aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_gro/gro_vxlan_tcp4.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-04-15 14:36:48 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-04-16 08:38:15 +0200
commit0b6b37f6a2ee1764e8912fe9f57dd4ed2baadecd (patch)
treee9c4dd16e978e7b5c4f59efb8a63fe110786592b /lib/librte_gro/gro_vxlan_tcp4.c
parentba7d9829e24a32d31b31f5816e8b9a3a8799ba68 (diff)
New upstream version 18.11.1
Change-Id: I2394f61ba94cc575bf2c55186f14e5d6fba9eec7 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_gro/gro_vxlan_tcp4.c')
-rw-r--r--lib/librte_gro/gro_vxlan_tcp4.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/librte_gro/gro_vxlan_tcp4.c b/lib/librte_gro/gro_vxlan_tcp4.c
index ca86f010..acb9bc91 100644
--- a/lib/librte_gro/gro_vxlan_tcp4.c
+++ b/lib/librte_gro/gro_vxlan_tcp4.c
@@ -295,7 +295,8 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
struct udp_hdr *udp_hdr;
struct vxlan_hdr *vxlan_hdr;
uint32_t sent_seq;
- uint16_t tcp_dl, frag_off, outer_ip_id, ip_id;
+ int32_t tcp_dl;
+ uint16_t frag_off, outer_ip_id, ip_id;
uint8_t outer_is_atomic, is_atomic;
struct vxlan_tcp4_flow_key key;
@@ -305,6 +306,13 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
uint16_t hdr_len;
uint8_t find;
+ /*
+ * Don't process the packet whose TCP header length is greater
+ * than 60 bytes or less than 20 bytes.
+ */
+ if (unlikely(INVALID_TCP_HDRLEN(pkt->l4_len)))
+ return -1;
+
outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
outer_ipv4_hdr = (struct ipv4_hdr *)((char *)outer_eth_hdr +
pkt->outer_l2_len);