* [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET
@ 2016-03-08 22:36 Daniel Borkmann
2016-03-08 22:59 ` Alexei Starovoitov
2016-03-09 4:21 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2016-03-08 22:36 UTC (permalink / raw)
To: davem; +Cc: alexei.starovoitov, tgraf, fengguang.wu, netdev, Daniel Borkmann
Helpers like ip_tunnel_info_opts_{get,set}() are only available if
CONFIG_INET is set, thus add an empty definition into the header for
the !CONFIG_INET case, where already other empty inline helpers are
defined.
This avoids ifdef kludge inside filter.c, but also vxlan and geneve
themself where this facility can only be used with, depend on INET
being set. For the !INET case TUNNEL_OPTIONS_PRESENT would never be
set in flags.
Fixes: 14ca0751c96f ("bpf: support for access to tunnel options")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
include/net/ip_tunnels.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index e1395d7..0acd80f 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -369,6 +369,17 @@ static inline void ip_tunnel_unneed_metadata(void)
{
}
+static inline void ip_tunnel_info_opts_get(void *to,
+ const struct ip_tunnel_info *info)
+{
+}
+
+static inline void ip_tunnel_info_opts_set(struct ip_tunnel_info *info,
+ const void *from, int len)
+{
+ info->options_len = 0;
+}
+
#endif /* CONFIG_INET */
#endif /* __NET_IP_TUNNELS_H */
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET
2016-03-08 22:36 [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET Daniel Borkmann
@ 2016-03-08 22:59 ` Alexei Starovoitov
2016-03-09 4:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2016-03-08 22:59 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: davem, tgraf, fengguang.wu, netdev
On Tue, Mar 08, 2016 at 11:36:03PM +0100, Daniel Borkmann wrote:
> Helpers like ip_tunnel_info_opts_{get,set}() are only available if
> CONFIG_INET is set, thus add an empty definition into the header for
> the !CONFIG_INET case, where already other empty inline helpers are
> defined.
>
> This avoids ifdef kludge inside filter.c, but also vxlan and geneve
> themself where this facility can only be used with, depend on INET
> being set. For the !INET case TUNNEL_OPTIONS_PRESENT would never be
> set in flags.
>
> Fixes: 14ca0751c96f ("bpf: support for access to tunnel options")
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET
2016-03-08 22:36 [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET Daniel Borkmann
2016-03-08 22:59 ` Alexei Starovoitov
@ 2016-03-09 4:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-03-09 4:21 UTC (permalink / raw)
To: daniel; +Cc: alexei.starovoitov, tgraf, fengguang.wu, netdev
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Tue, 8 Mar 2016 23:36:03 +0100
> Helpers like ip_tunnel_info_opts_{get,set}() are only available if
> CONFIG_INET is set, thus add an empty definition into the header for
> the !CONFIG_INET case, where already other empty inline helpers are
> defined.
>
> This avoids ifdef kludge inside filter.c, but also vxlan and geneve
> themself where this facility can only be used with, depend on INET
> being set. For the !INET case TUNNEL_OPTIONS_PRESENT would never be
> set in flags.
>
> Fixes: 14ca0751c96f ("bpf: support for access to tunnel options")
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, thanks Daniel.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-09 4:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 22:36 [PATCH net-next] ip_tunnel, bpf: ip_tunnel_info_opts_{get,set} depends on CONFIG_INET Daniel Borkmann
2016-03-08 22:59 ` Alexei Starovoitov
2016-03-09 4:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).