X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fpackets.c;h=7238f42e81ae8995387a2c585945a29cea7e47d2;hb=db19b72b9f6d0d40b743214241d9666116e3b448;hp=0d63841acd8a199d9bcc174bf2c64e5b24cb7d52;hpb=fe29af4c888d48cc1f16b1a247c2ffb6f0864522;p=sliver-openvswitch.git diff --git a/lib/packets.c b/lib/packets.c index 0d63841ac..7238f42e8 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -218,7 +218,7 @@ eth_pop_vlan(struct ofpbuf *packet) } /* Set ethertype of the packet. */ -void +static void set_ethertype(struct ofpbuf *packet, ovs_be16 eth_type) { struct eth_header *eh = packet->data; @@ -329,9 +329,10 @@ push_mpls(struct ofpbuf *packet, ovs_be16 ethtype, ovs_be32 lse) return; } + set_ethertype(packet, ethtype); + if (!is_mpls(packet)) { - /* Set ethtype and MPLS label stack entry. */ - set_ethertype(packet, ethtype); + /* Set MPLS label stack entry. */ packet->l2_5 = packet->l3; } @@ -743,13 +744,13 @@ packet_update_csum128(struct ofpbuf *packet, uint8_t proto, static void packet_set_ipv6_addr(struct ofpbuf *packet, uint8_t proto, - ovs_16aligned_be32 *addr, const ovs_be32 new_addr[4], + ovs_16aligned_be32 addr[4], const ovs_be32 new_addr[4], bool recalculate_csum) { if (recalculate_csum) { packet_update_csum128(packet, proto, addr, new_addr); } - memcpy(addr, new_addr, sizeof(*addr)); + memcpy(addr, new_addr, sizeof(ovs_be32[4])); } static void