Commit b04c80d3 authored by David Lebrun's avatar David Lebrun Committed by David S. Miller

ipv6: sr: export SRH insertion functions

This patch exports the seg6_do_srh_encap() and seg6_do_srh_inline()
functions. It also removes the CONFIG_IPV6_SEG6_INLINE knob
that enabled the compilation of seg6_do_srh_inline(). This function
is now built-in.
Signed-off-by: default avatarDavid Lebrun <david.lebrun@uclouvain.be>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 925615ce
...@@ -58,5 +58,7 @@ extern int seg6_iptunnel_init(void); ...@@ -58,5 +58,7 @@ extern int seg6_iptunnel_init(void);
extern void seg6_iptunnel_exit(void); extern void seg6_iptunnel_exit(void);
extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len); extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len);
extern int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh);
extern int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh);
#endif #endif
...@@ -315,18 +315,6 @@ config IPV6_SEG6_LWTUNNEL ...@@ -315,18 +315,6 @@ config IPV6_SEG6_LWTUNNEL
If unsure, say N. If unsure, say N.
config IPV6_SEG6_INLINE
bool "IPv6: direct Segment Routing Header insertion "
depends on IPV6_SEG6_LWTUNNEL
---help---
Support for direct insertion of the Segment Routing Header,
also known as inline mode. Be aware that direct insertion of
extension headers (as opposed to encapsulation) may break
multiple mechanisms such as PMTUD or IPSec AH. Use this feature
only if you know exactly what you are doing.
If unsure, say N.
config IPV6_SEG6_HMAC config IPV6_SEG6_HMAC
bool "IPv6: Segment Routing HMAC support" bool "IPv6: Segment Routing HMAC support"
depends on IPV6 depends on IPV6
......
...@@ -91,7 +91,7 @@ static void set_tun_src(struct net *net, struct net_device *dev, ...@@ -91,7 +91,7 @@ static void set_tun_src(struct net *net, struct net_device *dev,
} }
/* encapsulate an IPv6 packet within an outer IPv6 header with a given SRH */ /* encapsulate an IPv6 packet within an outer IPv6 header with a given SRH */
static int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh) int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
{ {
struct net *net = dev_net(skb_dst(skb)->dev); struct net *net = dev_net(skb_dst(skb)->dev);
struct ipv6hdr *hdr, *inner_hdr; struct ipv6hdr *hdr, *inner_hdr;
...@@ -141,10 +141,10 @@ static int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh) ...@@ -141,10 +141,10 @@ static int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(seg6_do_srh_encap);
/* insert an SRH within an IPv6 packet, just after the IPv6 header */ /* insert an SRH within an IPv6 packet, just after the IPv6 header */
#ifdef CONFIG_IPV6_SEG6_INLINE int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
static int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
{ {
struct ipv6hdr *hdr, *oldhdr; struct ipv6hdr *hdr, *oldhdr;
struct ipv6_sr_hdr *isrh; struct ipv6_sr_hdr *isrh;
...@@ -193,7 +193,7 @@ static int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh) ...@@ -193,7 +193,7 @@ static int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
return 0; return 0;
} }
#endif EXPORT_SYMBOL_GPL(seg6_do_srh_inline);
static int seg6_do_srh(struct sk_buff *skb) static int seg6_do_srh(struct sk_buff *skb)
{ {
...@@ -209,12 +209,10 @@ static int seg6_do_srh(struct sk_buff *skb) ...@@ -209,12 +209,10 @@ static int seg6_do_srh(struct sk_buff *skb)
} }
switch (tinfo->mode) { switch (tinfo->mode) {
#ifdef CONFIG_IPV6_SEG6_INLINE
case SEG6_IPTUN_MODE_INLINE: case SEG6_IPTUN_MODE_INLINE:
err = seg6_do_srh_inline(skb, tinfo->srh); err = seg6_do_srh_inline(skb, tinfo->srh);
skb_reset_inner_headers(skb); skb_reset_inner_headers(skb);
break; break;
#endif
case SEG6_IPTUN_MODE_ENCAP: case SEG6_IPTUN_MODE_ENCAP:
err = seg6_do_srh_encap(skb, tinfo->srh); err = seg6_do_srh_encap(skb, tinfo->srh);
break; break;
...@@ -357,10 +355,8 @@ static int seg6_build_state(struct nlattr *nla, ...@@ -357,10 +355,8 @@ static int seg6_build_state(struct nlattr *nla,
return -EINVAL; return -EINVAL;
switch (tuninfo->mode) { switch (tuninfo->mode) {
#ifdef CONFIG_IPV6_SEG6_INLINE
case SEG6_IPTUN_MODE_INLINE: case SEG6_IPTUN_MODE_INLINE:
break; break;
#endif
case SEG6_IPTUN_MODE_ENCAP: case SEG6_IPTUN_MODE_ENCAP:
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment