Skip to content

Commit 63526e1

Browse files
Zashasborkmann
authored andcommitted
ipv6: sr: make seg6.h includable without IPv6
include/net/seg6.h cannot be included in a source file if CONFIG_IPV6 is not enabled: include/net/seg6.h: In function 'seg6_pernet': >> include/net/seg6.h:52:14: error: 'struct net' has no member named 'ipv6'; did you mean 'ipv4'? return net->ipv6.seg6_data; ^~~~ ipv4 This commit makes seg6_pernet return NULL if IPv6 is not compiled, hence allowing seg6.h to be included regardless of the configuration. Signed-off-by: Mathieu Xhonneux <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 30cfe3b commit 63526e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/net/seg6.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ struct seg6_pernet_data {
4949

5050
static inline struct seg6_pernet_data *seg6_pernet(struct net *net)
5151
{
52+
#if IS_ENABLED(CONFIG_IPV6)
5253
return net->ipv6.seg6_data;
54+
#else
55+
return NULL;
56+
#endif
5357
}
5458

5559
extern int seg6_init(void);

0 commit comments

Comments
 (0)