Skip to content

Commit 7c5df8f

Browse files
azhou-niciradavem330
authored andcommitted
openvswitch: fix a compilation error when CONFIG_INET is not setW!
Fix a openvswitch compilation error when CONFIG_INET is not set: ===================================================== In file included from include/net/geneve.h:4:0, from net/openvswitch/flow_netlink.c:45: include/net/udp_tunnel.h: In function 'udp_tunnel_handle_offloads': >> include/net/udp_tunnel.h:100:2: error: implicit declaration of function 'iptunnel_handle_offloads' [-Werror=implicit-function-declaration] >> return iptunnel_handle_offloads(skb, udp_csum, type); >> ^ >> >> include/net/udp_tunnel.h:100:2: warning: return makes pointer from integer without a cast >> >> cc1: some warnings being treated as errors ===================================================== Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0a5d1c5 commit 7c5df8f

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

drivers/net/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ config MACVTAP
147147
config VXLAN
148148
tristate "Virtual eXtensible Local Area Network (VXLAN)"
149149
depends on INET
150-
select NET_IP_TUNNEL
151150
select NET_UDP_TUNNEL
152151
---help---
153152
This allows one to create vxlan virtual interfaces that provide

include/net/geneve.h

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
#ifndef __NET_GENEVE_H
22
#define __NET_GENEVE_H 1
33

4+
#ifdef CONFIG_INET
45
#include <net/udp_tunnel.h>
6+
#endif
57

6-
struct geneve_sock;
7-
8-
typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb);
9-
10-
struct geneve_sock {
11-
struct hlist_node hlist;
12-
geneve_rcv_t *rcv;
13-
void *rcv_data;
14-
struct work_struct del_work;
15-
struct socket *sock;
16-
struct rcu_head rcu;
17-
atomic_t refcnt;
18-
struct udp_offload udp_offloads;
19-
};
208

219
/* Geneve Header:
2210
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -74,6 +62,22 @@ struct genevehdr {
7462
struct geneve_opt options[];
7563
};
7664

65+
#ifdef CONFIG_INET
66+
struct geneve_sock;
67+
68+
typedef void (geneve_rcv_t)(struct geneve_sock *gs, struct sk_buff *skb);
69+
70+
struct geneve_sock {
71+
struct hlist_node hlist;
72+
geneve_rcv_t *rcv;
73+
void *rcv_data;
74+
struct work_struct del_work;
75+
struct socket *sock;
76+
struct rcu_head rcu;
77+
atomic_t refcnt;
78+
struct udp_offload udp_offloads;
79+
};
80+
7781
#define GENEVE_VER 0
7882
#define GENEVE_BASE_HLEN (sizeof(struct udphdr) + sizeof(struct genevehdr))
7983

@@ -88,4 +92,6 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
8892
__u8 ttl, __be16 df, __be16 src_port, __be16 dst_port,
8993
__be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt,
9094
bool xnet);
91-
#endif
95+
#endif /*ifdef CONFIG_INET */
96+
97+
#endif /*ifdef__NET_GENEVE_H */

net/ipv4/Kconfig

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ config NET_IPVTI
309309

310310
config NET_UDP_TUNNEL
311311
tristate
312+
select NET_IP_TUNNEL
312313
default n
313314

314315
config NET_FOU
@@ -321,6 +322,20 @@ config NET_FOU
321322
network mechanisms and optimizations for UDP (such as ECMP
322323
and RSS) can be leveraged to provide better service.
323324

325+
config GENEVE
326+
tristate "Generic Network Virtualization Encapsulation (Geneve)"
327+
depends on INET
328+
select NET_UDP_TUNNEL
329+
---help---
330+
This allows one to create Geneve virtual interfaces that provide
331+
Layer 2 Networks over Layer 3 Networks. Geneve is often used
332+
to tunnel virtual network infrastructure in virtualized environments.
333+
For more information see:
334+
http://tools.ietf.org/html/draft-gross-geneve-01
335+
336+
To compile this driver as a module, choose M here: the module
337+
338+
324339
config INET_AH
325340
tristate "IP: AH transformation"
326341
select XFRM_ALGO
@@ -453,20 +468,6 @@ config TCP_CONG_BIC
453468
increase provides TCP friendliness.
454469
See http://www.csc.ncsu.edu/faculty/rhee/export/bitcp/
455470

456-
config GENEVE
457-
tristate "Generic Network Virtualization Encapsulation (Geneve)"
458-
depends on INET
459-
select NET_IP_TUNNEL
460-
select NET_UDP_TUNNEL
461-
---help---
462-
This allows one to create Geneve virtual interfaces that provide
463-
Layer 2 Networks over Layer 3 Networks. Geneve is often used
464-
to tunnel virtual network infrastructure in virtualized environments.
465-
For more information see:
466-
http://tools.ietf.org/html/draft-gross-geneve-01
467-
468-
To compile this driver as a module, choose M here: the module
469-
470471
config TCP_CONG_CUBIC
471472
tristate "CUBIC TCP"
472473
default y

0 commit comments

Comments
 (0)