Skip to content

Commit

Permalink
seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number
Browse files Browse the repository at this point in the history
The Internet Assigned Numbers Authority (IANA) has recently assigned
a protocol number value of 143 for Ethernet [1].

Before this assignment, encapsulation mechanisms such as Segment Routing
used the IPv6-NoNxt protocol number (59) to indicate that the encapsulated
payload is an Ethernet frame.

In this patch, we add the definition of the Ethernet protocol number to the
kernel headers and update the SRv6 L2 tunnels to use it.

[1] https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

Signed-off-by: Paolo Lungaroni <paolo.lungaroni@cnit.it>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Acked-by: Ahmed Abdelsalam <ahmed.abdelsalam@gssi.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paolo Lungaroni authored and David S. Miller committed Mar 12, 2020
1 parent a20f997 commit 2677625
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/uapi/linux/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ enum {
#define IPPROTO_UDPLITE IPPROTO_UDPLITE
IPPROTO_MPLS = 137, /* MPLS in IP (RFC 4023) */
#define IPPROTO_MPLS IPPROTO_MPLS
IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation */
#define IPPROTO_ETHERNET IPPROTO_ETHERNET
IPPROTO_RAW = 255, /* Raw IP packets */
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MPTCP = 262, /* Multipath TCP connection */
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/seg6_iptunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int seg6_do_srh(struct sk_buff *skb)
skb_mac_header_rebuild(skb);
skb_push(skb, skb->mac_len);

err = seg6_do_srh_encap(skb, tinfo->srh, NEXTHDR_NONE);
err = seg6_do_srh_encap(skb, tinfo->srh, IPPROTO_ETHERNET);
if (err)
return err;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/seg6_local.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static int input_action_end_dx2(struct sk_buff *skb,
struct net_device *odev;
struct ethhdr *eth;

if (!decap_and_validate(skb, NEXTHDR_NONE))
if (!decap_and_validate(skb, IPPROTO_ETHERNET))
goto drop;

if (!pskb_may_pull(skb, ETH_HLEN))
Expand Down

0 comments on commit 2677625

Please sign in to comment.