summaryrefslogtreecommitdiff
path: root/examples/l3fwd-vf
diff options
context:
space:
mode:
authorCyril Chemparathy <cchemparathy@ezchip.com>2015-06-22 11:34:23 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-06-24 12:01:14 +0200
commit82be8d544253a4b5c49b778babf717e5e63f3dc1 (patch)
tree1d9c9300f80d01bdee7b53e944ac9aeb816d6090 /examples/l3fwd-vf
parent3790a7fcf0c3a7548b95927b566240738e2df7ce (diff)
downloaddpdk-82be8d544253a4b5c49b778babf717e5e63f3dc1.zip
dpdk-82be8d544253a4b5c49b778babf717e5e63f3dc1.tar.gz
dpdk-82be8d544253a4b5c49b778babf717e5e63f3dc1.tar.xz
mbuf: use offset macro
This patch simply applies the transform previously committed in scripts/cocci/mtod-offset.cocci. No other modifications have been made here. Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'examples/l3fwd-vf')
-rw-r--r--examples/l3fwd-vf/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 6e56cfb..ccbb02f 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -459,8 +459,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd
eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(m, unsigned char *) +
- sizeof(struct ether_hdr));
+ ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+ sizeof(struct ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */