X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fvport-vxlan.c;h=cc9477dd17d2f8a413635fd3d85766ac3a9a619e;hb=003ce655b7116d18c86a74c50391e54990346931;hp=c614eff39dd891d14ea0ba03fdc6b03a59f2e248;hpb=a109c9fbf55b83e1ac6a3f6805cc1945fc41e91c;p=sliver-openvswitch.git diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c index c614eff39..cc9477dd1 100644 --- a/datapath/vport-vxlan.c +++ b/datapath/vport-vxlan.c @@ -20,7 +20,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) #include #include @@ -32,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -126,7 +124,7 @@ static struct vport *vxlan_tnl_create(const struct vport_parms *parms) vxlan_port = vxlan_vport(vport); strncpy(vxlan_port->name, parms->name, IFNAMSIZ); - vs = vxlan_sock_add(net, htons(dst_port), vxlan_rcv, vport, true); + vs = vxlan_sock_add(net, htons(dst_port), vxlan_rcv, vport, true, false); if (IS_ERR(vs)) { ovs_vport_free(vport); return (void *)vs; @@ -141,9 +139,9 @@ error: static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) { + struct net *net = ovs_dp_get_net(vport->dp); struct vxlan_port *vxlan_port = vxlan_vport(vport); __be16 dst_port = inet_sport(vxlan_port->vs->sock->sk); - struct net *net = ovs_dp_get_net(vport->dp); struct rtable *rt; __be16 src_port; __be32 saddr; @@ -157,8 +155,6 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) goto error; } - forward_ip_summed(skb, true); - /* Route lookup */ saddr = OVS_CB(skb)->tun_key->ipv4_src; rt = find_route(ovs_dp_get_net(vport->dp), @@ -166,7 +162,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_UDP, OVS_CB(skb)->tun_key->ipv4_tos, - skb_get_mark(skb)); + skb->mark); if (IS_ERR(rt)) { err = PTR_ERR(rt); goto error; @@ -177,10 +173,10 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb) skb->local_df = 1; - inet_get_local_port_range(&port_min, &port_max); + inet_get_local_port_range(net, &port_min, &port_max); src_port = vxlan_src_port(port_min, port_max, skb); - err = vxlan_xmit_skb(net, vxlan_port->vs, rt, skb, + err = vxlan_xmit_skb(vxlan_port->vs, rt, skb, saddr, OVS_CB(skb)->tun_key->ipv4_dst, OVS_CB(skb)->tun_key->ipv4_tos, OVS_CB(skb)->tun_key->ipv4_ttl, df, @@ -206,6 +202,3 @@ const struct vport_ops ovs_vxlan_vport_ops = { .get_options = vxlan_get_options, .send = vxlan_tnl_send, }; -#else -#warning VXLAN tunneling will not be available on kernels before 2.6.26 -#endif /* Linux kernel < 2.6.26 */