datapath: enable encap for capwap.
authorPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 21:39:00 +0000 (13:39 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 21:39:00 +0000 (13:39 -0800)
kernel 3.5 added a switch to turn on UDP encap, capwap needs
to enable it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/include/linux/udp.h
datapath/vport-capwap.c

index 6fe4721bfd6778953b4d0db294064a3782a83180..6a805b58ea6fa0e2d0ed4d0e1cf310cf649e5b60 100644 (file)
@@ -10,4 +10,9 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
 }
 #endif /* HAVE_SKBUFF_HEADER_HELPERS */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+static inline void udp_encap_enable(void)
+{
+}
+#endif
 #endif
index 39aec423f0d3fd292b6d74a21e113789284a37ef..4061c7b11d6a27b70cbc8643d9826b88d41703cb 100644 (file)
@@ -445,7 +445,7 @@ static int init_socket(struct net *net)
        capwap_net->frag_state.low_thresh       = CAPWAP_FRAG_PRUNE_MEM;
 
        inet_frags_init_net(&capwap_net->frag_state);
-
+       udp_encap_enable();
        capwap_net->n_tunnels++;
        return 0;