aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport-vxlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openvswitch/vport-vxlan.c')
-rw-r--r--net/openvswitch/vport-vxlan.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index d8b7e247bebf..f19539bb8adc 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2013 Nicira, Inc. 2 * Copyright (c) 2014 Nicira, Inc.
3 * Copyright (c) 2013 Cisco Systems, Inc. 3 * Copyright (c) 2013 Cisco Systems, Inc.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -140,22 +140,24 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
140 struct net *net = ovs_dp_get_net(vport->dp); 140 struct net *net = ovs_dp_get_net(vport->dp);
141 struct vxlan_port *vxlan_port = vxlan_vport(vport); 141 struct vxlan_port *vxlan_port = vxlan_vport(vport);
142 __be16 dst_port = inet_sk(vxlan_port->vs->sock->sk)->inet_sport; 142 __be16 dst_port = inet_sk(vxlan_port->vs->sock->sk)->inet_sport;
143 struct ovs_key_ipv4_tunnel *tun_key;
143 struct rtable *rt; 144 struct rtable *rt;
144 struct flowi4 fl; 145 struct flowi4 fl;
145 __be16 src_port; 146 __be16 src_port;
146 __be16 df; 147 __be16 df;
147 int err; 148 int err;
148 149
149 if (unlikely(!OVS_CB(skb)->tun_key)) { 150 if (unlikely(!OVS_CB(skb)->egress_tun_key)) {
150 err = -EINVAL; 151 err = -EINVAL;
151 goto error; 152 goto error;
152 } 153 }
153 154
155 tun_key = OVS_CB(skb)->egress_tun_key;
154 /* Route lookup */ 156 /* Route lookup */
155 memset(&fl, 0, sizeof(fl)); 157 memset(&fl, 0, sizeof(fl));
156 fl.daddr = OVS_CB(skb)->tun_key->ipv4_dst; 158 fl.daddr = tun_key->ipv4_dst;
157 fl.saddr = OVS_CB(skb)->tun_key->ipv4_src; 159 fl.saddr = tun_key->ipv4_src;
158 fl.flowi4_tos = RT_TOS(OVS_CB(skb)->tun_key->ipv4_tos); 160 fl.flowi4_tos = RT_TOS(tun_key->ipv4_tos);
159 fl.flowi4_mark = skb->mark; 161 fl.flowi4_mark = skb->mark;
160 fl.flowi4_proto = IPPROTO_UDP; 162 fl.flowi4_proto = IPPROTO_UDP;
161 163
@@ -165,7 +167,7 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
165 goto error; 167 goto error;
166 } 168 }
167 169
168 df = OVS_CB(skb)->tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? 170 df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
169 htons(IP_DF) : 0; 171 htons(IP_DF) : 0;
170 172
171 skb->ignore_df = 1; 173 skb->ignore_df = 1;
@@ -173,11 +175,10 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
173 src_port = udp_flow_src_port(net, skb, 0, 0, true); 175 src_port = udp_flow_src_port(net, skb, 0, 0, true);
174 176
175 err = vxlan_xmit_skb(vxlan_port->vs, rt, skb, 177 err = vxlan_xmit_skb(vxlan_port->vs, rt, skb,
176 fl.saddr, OVS_CB(skb)->tun_key->ipv4_dst, 178 fl.saddr, tun_key->ipv4_dst,
177 OVS_CB(skb)->tun_key->ipv4_tos, 179 tun_key->ipv4_tos, tun_key->ipv4_ttl, df,
178 OVS_CB(skb)->tun_key->ipv4_ttl, df,
179 src_port, dst_port, 180 src_port, dst_port,
180 htonl(be64_to_cpu(OVS_CB(skb)->tun_key->tun_id) << 8), 181 htonl(be64_to_cpu(tun_key->tun_id) << 8),
181 false); 182 false);
182 if (err < 0) 183 if (err < 0)
183 ip_rt_put(rt); 184 ip_rt_put(rt);