Skip to content

Commit b04c80d

Browse files
David Lebrundavem330
authored andcommitted
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: David Lebrun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 925615c commit b04c80d

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

include/net/seg6.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ extern int seg6_iptunnel_init(void);
5858
extern void seg6_iptunnel_exit(void);
5959

6060
extern bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len);
61+
extern int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh);
62+
extern int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh);
6163

6264
#endif

net/ipv6/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,6 @@ config IPV6_SEG6_LWTUNNEL
315315

316316
If unsure, say N.
317317

318-
config IPV6_SEG6_INLINE
319-
bool "IPv6: direct Segment Routing Header insertion "
320-
depends on IPV6_SEG6_LWTUNNEL
321-
---help---
322-
Support for direct insertion of the Segment Routing Header,
323-
also known as inline mode. Be aware that direct insertion of
324-
extension headers (as opposed to encapsulation) may break
325-
multiple mechanisms such as PMTUD or IPSec AH. Use this feature
326-
only if you know exactly what you are doing.
327-
328-
If unsure, say N.
329-
330318
config IPV6_SEG6_HMAC
331319
bool "IPv6: Segment Routing HMAC support"
332320
depends on IPV6

net/ipv6/seg6_iptunnel.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void set_tun_src(struct net *net, struct net_device *dev,
9191
}
9292

9393
/* encapsulate an IPv6 packet within an outer IPv6 header with a given SRH */
94-
static int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
94+
int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
9595
{
9696
struct net *net = dev_net(skb_dst(skb)->dev);
9797
struct ipv6hdr *hdr, *inner_hdr;
@@ -141,10 +141,10 @@ static int seg6_do_srh_encap(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
141141

142142
return 0;
143143
}
144+
EXPORT_SYMBOL_GPL(seg6_do_srh_encap);
144145

145146
/* insert an SRH within an IPv6 packet, just after the IPv6 header */
146-
#ifdef CONFIG_IPV6_SEG6_INLINE
147-
static int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
147+
int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
148148
{
149149
struct ipv6hdr *hdr, *oldhdr;
150150
struct ipv6_sr_hdr *isrh;
@@ -193,7 +193,7 @@ static int seg6_do_srh_inline(struct sk_buff *skb, struct ipv6_sr_hdr *osrh)
193193

194194
return 0;
195195
}
196-
#endif
196+
EXPORT_SYMBOL_GPL(seg6_do_srh_inline);
197197

198198
static int seg6_do_srh(struct sk_buff *skb)
199199
{
@@ -209,12 +209,10 @@ static int seg6_do_srh(struct sk_buff *skb)
209209
}
210210

211211
switch (tinfo->mode) {
212-
#ifdef CONFIG_IPV6_SEG6_INLINE
213212
case SEG6_IPTUN_MODE_INLINE:
214213
err = seg6_do_srh_inline(skb, tinfo->srh);
215214
skb_reset_inner_headers(skb);
216215
break;
217-
#endif
218216
case SEG6_IPTUN_MODE_ENCAP:
219217
err = seg6_do_srh_encap(skb, tinfo->srh);
220218
break;
@@ -357,10 +355,8 @@ static int seg6_build_state(struct nlattr *nla,
357355
return -EINVAL;
358356

359357
switch (tuninfo->mode) {
360-
#ifdef CONFIG_IPV6_SEG6_INLINE
361358
case SEG6_IPTUN_MODE_INLINE:
362359
break;
363-
#endif
364360
case SEG6_IPTUN_MODE_ENCAP:
365361
break;
366362
default:

0 commit comments

Comments
 (0)