X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fload_balancer%2Fruntime.c;h=6944325d664c21712eae956b783f3b214d6431ec;hb=cda291fb8ada5882205dd7785e4f318920cecf1c;hp=adec4ba9031f9d83d31e6241caf2889ce3ab510d;hpb=ff708facfcbf42f3dcb3c62d82ecd93e7b8c2506;p=dpdk.git diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index adec4ba903..6944325d66 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -525,7 +525,7 @@ app_lcore_worker( struct rte_mbuf *pkt; struct ipv4_hdr *ipv4_hdr; uint32_t ipv4_dst, pos; - uint8_t port; + uint32_t port; if (likely(j < bsz_rd - 1)) { APP_WORKER_PREFETCH1(rte_pktmbuf_mtod(lp->mbuf_in.array[j+1], unsigned char *)); @@ -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)) {