History

ipv6: sr: add support for encapsulation of L2 frames

This patch implements the L2 frame encapsulation mechanism, referred to as T.Encaps.L2 in the SRv6 specifications [1]. A new type of SRv6 tunnel mode is added (SEG6_IPTUN_MODE_L2ENCAP). It only accepts packets with an existing MAC header (i.e., it will not work for locally generated packets). The resulting packet looks like IPv6 -> SRH -> Ethernet -> original L3 payload. The next header field of the SRH is set to NEXTHDR_NONE. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01

David Lebrun committed 9 years ago

Commit 38ee7f21 parent 32d99d02 files · +37 −6Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/seg6_iptunnel.h+14−4
@@ -33,16 +33,26 @@ struct seg6_iptunnel_encap { · 32 unmodified lines
33enum {33enum {
34 SEG6_IPTUN_MODE_INLINE,34 SEG6_IPTUN_MODE_INLINE,
35 SEG6_IPTUN_MODE_ENCAP,35 SEG6_IPTUN_MODE_ENCAP,
36 SEG6_IPTUN_MODE_L2ENCAP,
36};37};
37 38
38#ifdef __KERNEL__39#ifdef __KERNEL__
39 40
40static inline size_t seg6_lwt_headroom(struct seg6_iptunnel_encap *tuninfo)41static inline size_t seg6_lwt_headroom(struct seg6_iptunnel_encap *tuninfo)
41{42{
42 int encap = (tuninfo->mode == SEG6_IPTUN_MODE_ENCAP);43 int head = 0;
43 44
44 return ((tuninfo->srh->hdrlen + 1) << 3) +45 switch (tuninfo->mode) {
45 (encap * sizeof(struct ipv6hdr));46 case SEG6_IPTUN_MODE_INLINE:
47 break;
48 case SEG6_IPTUN_MODE_ENCAP:
49 head = sizeof(struct ipv6hdr);
50 break;
51 case SEG6_IPTUN_MODE_L2ENCAP:
52 return 0;
53 }
54
55 return ((tuninfo->srh->hdrlen + 1) << 3) + head;
46}56}
47 57
48#endif58#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t