diff options
| author | David S. Miller <davem@davemloft.net> | 2017-08-25 17:10:24 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-08-25 17:10:24 -0700 |
| commit | cf4828d1666beaef513ce3c8f9e4fe4af1ff4e87 (patch) | |
| tree | 59c1d26dbdfd5b7bd106ca479cad584893d70c35 /include/uapi/linux | |
| parent | 3fd87127073292538047adf1c9c757e9cab0dd56 (diff) | |
| parent | 891ef8dd2a8d14e4e73a81dcdb135b574c57f556 (diff) | |
| download | cachepc-linux-cf4828d1666beaef513ce3c8f9e4fe4af1ff4e87.tar.gz cachepc-linux-cf4828d1666beaef513ce3c8f9e4fe4af1ff4e87.zip | |
Merge branch 'ipv6-sr-updates'
David Lebrun says:
====================
net: updates for IPv6 Segment Routing
v2: seg6_lwt_headroom() is not relevant for lwtunnel_input_redirect()
use cases, and L2ENCAP only uses this redirection. Fix incoherence
between arbitrary MAC header size support and fixed headroom
computation by setting only LWTUNNEL_STATE_INPUT_REDIRECT for L2ENCAP
mode.
This patch series provides several updates for the SRv6 implementation. The
first patch leverages the existing infrastructure to support encapsulation
of IPv4 packets. The second patch implements the T.Encaps.L2 SR function,
enabling to encapsulate an L2 Ethernet frame within an IPv6+SRH packet.
The last three patches update the seg6local lightweight tunnel, and mainly
implement four new actions: End.T, End.DX2, End.DX4 and End.DT6.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/seg6_iptunnel.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/uapi/linux/seg6_iptunnel.h b/include/uapi/linux/seg6_iptunnel.h index b6e5a0a1afd7..b23df9f58354 100644 --- a/include/uapi/linux/seg6_iptunnel.h +++ b/include/uapi/linux/seg6_iptunnel.h @@ -33,16 +33,26 @@ struct seg6_iptunnel_encap { enum { SEG6_IPTUN_MODE_INLINE, SEG6_IPTUN_MODE_ENCAP, + SEG6_IPTUN_MODE_L2ENCAP, }; #ifdef __KERNEL__ static inline size_t seg6_lwt_headroom(struct seg6_iptunnel_encap *tuninfo) { - int encap = (tuninfo->mode == SEG6_IPTUN_MODE_ENCAP); - - return ((tuninfo->srh->hdrlen + 1) << 3) + - (encap * sizeof(struct ipv6hdr)); + int head = 0; + + switch (tuninfo->mode) { + case SEG6_IPTUN_MODE_INLINE: + break; + case SEG6_IPTUN_MODE_ENCAP: + head = sizeof(struct ipv6hdr); + break; + case SEG6_IPTUN_MODE_L2ENCAP: + return 0; + } + + return ((tuninfo->srh->hdrlen + 1) << 3) + head; } #endif |
