aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-19 00:02:30 +0100
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-19 00:43:03 +0100
commit9c7aa95efd1120b3bbe3a214afd9ffb03afa7a6d (patch)
treebefef0af0ee6bb0202b9890df774d2ba8ce82192 /lib
parent3688f046e8b62bce6c4c51b43f48bd5c67a2aaf6 (diff)
fix segfault on input packets with invalid checksum
libtle_udp: prevent receive code-path to reference packets that were already freed. udpfwd: if input device doesn't support IPV4 checksum offload, we need to recalculate IPV4 header checksum of the reassembled packet. fixes 3395610ea65d ("Initial commit of tldk code"). fixes 8efc4c11464f ("Change libtle_udp to use dring"). Change-Id: I77523b1ba63b0f8d25d5f0b3bc777a338ad8acf5 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libtle_udp/udp_rxtx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libtle_udp/udp_rxtx.c b/lib/libtle_udp/udp_rxtx.c
index 7136714..a5b48c8 100644
--- a/lib/libtle_udp/udp_rxtx.c
+++ b/lib/libtle_udp/udp_rxtx.c
@@ -328,6 +328,7 @@ compress_pkt_list(struct rte_mbuf *pkt[], uint32_t nb_pkt, uint32_t nb_zero)
nb_pkt -= j - i;
nb_zero -= j - i;
+ j = i + 1;
}
}
@@ -359,10 +360,10 @@ recv_pkt_process(struct rte_mbuf *m[], uint32_t num, uint32_t type)
rte_pktmbuf_free(m[i]);
m[i] = NULL;
k++;
+ } else {
+ m[i]->ol_flags ^= f;
+ rte_pktmbuf_adj(m[i], _tx_offload_l4_offset(ofl[i]));
}
-
- m[i]->ol_flags ^= f;
- rte_pktmbuf_adj(m[i], _tx_offload_l4_offset(ofl[i]));
}
return k;