[dpdk-dev] [PATCH v2 4/5] lib/librte_eal: add tcpdump support in primary process

Pavel Fedin p.fedin at samsung.com
Wed Feb 17 10:57:39 CET 2016


 Hello!

> +static int
> +compare_filter(struct rte_mbuf *pkt)
> +{
> +	struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
> +						sizeof(struct ether_hdr));
> +	if (pkt_hdr->src_addr != src_ip_filter)
> +		return -1;
> +
> +	return 0;
> +}

 Some critics to this...
 What if i want to capture packets coming from more than one host?
 What if i want to capture all packets?
 What if it's not IPv4 at all?

 May be this function should always return 0 if src_ip_filter == 0? This would at least be a quick way to disable filtering.

Kind regards,
Pavel Fedin
Senior Engineer
Samsung Electronics Research center Russia




More information about the dev mailing list