summaryrefslogtreecommitdiff
path: root/examples/load_balancer/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/load_balancer/runtime.c')
-rw-r--r--examples/load_balancer/runtime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c
index adec4ba..2b265c2 100644
--- a/examples/load_balancer/runtime.c
+++ b/examples/load_balancer/runtime.c
@@ -535,7 +535,9 @@ app_lcore_worker(
}
pkt = lp->mbuf_in.array[j];
- ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, unsigned char *) + sizeof(struct ether_hdr));
+ ipv4_hdr = rte_pktmbuf_mtod_offset(pkt,
+ struct ipv4_hdr *,
+ sizeof(struct ether_hdr));
ipv4_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
if (unlikely(rte_lpm_lookup(lp->lpm_table, ipv4_dst, &port) != 0)) {