Skip to content

Commit

Permalink
Always update ethertype on mpls_pop
Browse files Browse the repository at this point in the history
The ethertype should always be updated on mpls_pop
as there may be a transition between MPLS unicast (0x8847) and
MPLS multicast (0x8848).

Ben Pfaff tells me that this is consistent with the
behaviour described in EXT-194 of the JIRA bug tracker.

Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
horms authored and blp committed Jun 5, 2013
1 parent 1ac7c9b commit 799a91b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/packets.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,8 @@ pop_mpls(struct ofpbuf *packet, ovs_be16 ethtype)
size_t len;
mh = packet->l2_5;
len = (char*)packet->l2_5 - (char*)packet->l2;
/* If bottom of the stack set ethertype. */
set_ethertype(packet, ethtype);
if (mh->mpls_lse & htonl(MPLS_BOS_MASK)) {
set_ethertype(packet, ethtype);
packet->l2_5 = NULL;
} else {
packet->l2_5 = (char*)packet->l2_5 + MPLS_HLEN;
Expand Down
7 changes: 4 additions & 3 deletions utilities/ovs-ofctl.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,10 @@ followed by another \fBpush_mpls\fR will result in the first
\fBpush_mpls\fR being discarded.
.
.IP \fBpop_mpls\fR:\fIethertype\fR
Strips the outermost MPLS label stack entry. If the MPLS label
stripped was the only one, changes the ethertype of a packet to
\fIethertype\fR, which should not ordinarily be an MPLS Ethertype.
Strips the outermost MPLS label stack entry.
Currently the implementation restricts \fIethertype\fR to a non-MPLS Ethertype
and thus \fBpop_mpls\fR should only be applied to packets with
an MPLS label stack depth of one.
.
.IP
There are some limitations in the implementation. \fBpop_mpls\fR
Expand Down

0 comments on commit 799a91b

Please sign in to comment.