packets: Always set ethertype in push_mpls()
authorSimon Horman <horms@verge.net.au>
Wed, 12 Feb 2014 01:13:02 +0000 (10:13 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 19 Feb 2014 22:06:43 +0000 (14:06 -0800)
commit0c1625e834bd48f9f6f49cdea475dcd4dfb46b0a
treef25c5afc2601d2314c8c521110e5f063c6eb55a5
parent63636ee8bd02b89a1ee7c3eb9d1cb474d620c94a
packets: Always set ethertype in push_mpls()

There are two different MPLS ethertypes, 0x8847 and 0x8848 and a push MPLS
action applied to an MPLS packet may cause the ethertype to change from one
to the other. To ensure that this happens update the ethertype in
push_mpls() regardless of if the packet is already MPLS or not.

Test based on a similar test by Joe Stringer.

Cc: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/packets.c
tests/ofproto-dpif.at