X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fodp-execute.c;h=ac0dac0dd362fbcee74b64d7982d5bc0228a8b35;hb=cf3b7538666cd1efa314ce4944e4efdf3dd81d99;hp=cf6743513f5c49f8335f0c456d822a3291dcdf55;hpb=6b8c377a6e25b18da473c3a24dfad8ec9e01ad7f;p=sliver-openvswitch.git diff --git a/lib/odp-execute.c b/lib/odp-execute.c index cf6743513..ac0dac0dd 100644 --- a/lib/odp-execute.c +++ b/lib/odp-execute.c @@ -33,10 +33,12 @@ static void odp_eth_set_addrs(struct ofpbuf *packet, const struct ovs_key_ethernet *eth_key) { - struct eth_header *eh = packet->l2; + struct eth_header *eh = ofpbuf_l2(packet); - memcpy(eh->eth_src, eth_key->eth_src, sizeof eh->eth_src); - memcpy(eh->eth_dst, eth_key->eth_dst, sizeof eh->eth_dst); + if (eh) { + memcpy(eh->eth_src, eth_key->eth_src, sizeof eh->eth_src); + memcpy(eh->eth_dst, eth_key->eth_dst, sizeof eh->eth_dst); + } } static void