All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Xhonneux <m.xhonneux@gmail.com>
To: netdev@vger.kernel.org
Cc: daniel@iogearbox.net, dlebrun@google.com, alexei.starovoitov@gmail.com
Subject: [PATCH bpf-next v7 1/6] ipv6: sr: make seg6.h includable without IPv6
Date: Sun, 20 May 2018 14:58:12 +0100	[thread overview]
Message-ID: <9ba92a2a41ed3baba189a077022c1bb314d6c491.1526824042.git.m.xhonneux@gmail.com> (raw)
In-Reply-To: <cover.1526824042.git.m.xhonneux@gmail.com>
In-Reply-To: <cover.1526824042.git.m.xhonneux@gmail.com>

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 <m.xhonneux@gmail.com>
---
 include/net/seg6.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/net/seg6.h b/include/net/seg6.h
index 099bad59dc90..70b4cfac52d7 100644
--- a/include/net/seg6.h
+++ b/include/net/seg6.h
@@ -49,7 +49,11 @@ struct seg6_pernet_data {
 
 static inline struct seg6_pernet_data *seg6_pernet(struct net *net)
 {
+#if IS_ENABLED(CONFIG_IPV6)
 	return net->ipv6.seg6_data;
+#else
+	return NULL;
+#endif
 }
 
 extern int seg6_init(void);
-- 
2.16.1

  reply	other threads:[~2018-05-20 11:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-20 13:58 [PATCH bpf-next v7 0/6] ipv6: sr: introduce seg6local End.BPF action Mathieu Xhonneux
2018-05-20 13:58 ` Mathieu Xhonneux [this message]
2018-05-20 13:58 ` [PATCH bpf-next v7 2/6] ipv6: sr: export function lookup_nexthop Mathieu Xhonneux
2018-05-20 13:58 ` [PATCH bpf-next v7 3/6] bpf: Add IPv6 Segment Routing helpers Mathieu Xhonneux
2018-05-24 10:18   ` Daniel Borkmann
2018-05-30 11:00     ` Daniel Borkmann
2018-06-06  1:45       ` Mathieu Xhonneux
2018-05-20 13:58 ` [PATCH bpf-next v7 4/6] bpf: Split lwt inout verifier structures Mathieu Xhonneux
2018-05-20 13:58 ` [PATCH bpf-next v7 5/6] ipv6: sr: Add seg6local action End.BPF Mathieu Xhonneux
2018-05-20 13:58 ` [PATCH bpf-next v7 6/6] selftests/bpf: test for seg6local End.BPF action Mathieu Xhonneux
2018-05-25  2:30   ` Y Song
2018-05-25  8:30     ` Daniel Borkmann
2018-05-24 10:12 ` [PATCH bpf-next v7 0/6] ipv6: sr: introduce " Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ba92a2a41ed3baba189a077022c1bb314d6c491.1526824042.git.m.xhonneux@gmail.com \
    --to=m.xhonneux@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=dlebrun@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.