From: Herakliusz Lipiec Date: Tue, 13 Nov 2018 11:49:29 +0000 (+0000) Subject: examples/ipv4_multicast: fix leak of cloned packets X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=91dc9c13ba978fb8147240ed6fa20c41145bf0db;p=dpdk.git examples/ipv4_multicast: fix leak of cloned packets The ipv4_multicast sample application was dropping packets when using mbuf clone. When creating an L2 header and copying metadata from the source packet, the ol_flags were also copied along with all the other metadata. Because the cloned packet had IND_ATTACHED_MBUF flag set in its ol_flags, this caused the packets to never be freed when using rte_pktmbuf_free. Since copying ol_flags from the cloned packet is not necessary in the first place, just don't do it. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Reported-by: Dong Wang Signed-off-by: Herakliusz Lipiec Acked-by: Konstantin Ananyev Acked-by: Dong Wang --- diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst b/doc/guides/sample_app_ug/ipv4_multicast.rst index ce1474ec78..f6efa7f6f4 100644 --- a/doc/guides/sample_app_ug/ipv4_multicast.rst +++ b/doc/guides/sample_app_ug/ipv4_multicast.rst @@ -319,7 +319,6 @@ It is the mcast_out_pkt() function that performs the packet duplication (either hdr->pkt.in_port = pkt->pkt.in_port; hdr->pkt.vlan_macip = pkt->pkt.vlan_macip; hdr->pkt.hash = pkt->pkt.hash; - hdr->ol_flags = pkt->ol_flags; rte_mbuf_sanity_check(hdr, RTE_MBUF_PKT, 1); return hdr; diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 4073a49073..428ca4694e 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -266,8 +266,6 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) hdr->tx_offload = pkt->tx_offload; hdr->hash = pkt->hash; - hdr->ol_flags = pkt->ol_flags; - __rte_mbuf_sanity_check(hdr, 1); return hdr; }