Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334008
b: refs/heads/master
c: 1cad871
h: refs/heads/master
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Oct 11, 2012
1 parent 64664e6 commit 1ece0ef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca78f18129999320466107887317b5d1c042accd
refs/heads/master: 1cad87156b3e79d25731cdcbfa9e149bf3e08f60
19 changes: 19 additions & 0 deletions trunk/drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,23 @@ static __be32 vxlan_find_dst(struct vxlan_dev *vxlan, struct sk_buff *skb)

}

static void vxlan_sock_free(struct sk_buff *skb)
{
sock_put(skb->sk);
}

/* On transmit, associate with the tunnel socket */
static void vxlan_set_owner(struct net_device *dev, struct sk_buff *skb)
{
struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
struct sock *sk = vn->sock->sk;

skb_orphan(skb);
sock_hold(sk);
skb->sk = sk;
skb->destructor = vxlan_sock_free;
}

/* Transmit local packets over Vxlan
*
* Outer IP header inherits ECN and DF from inner header.
Expand Down Expand Up @@ -732,6 +749,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
iph->saddr = fl4.saddr;
iph->ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);

vxlan_set_owner(dev, skb);

/* See __IPTUNNEL_XMIT */
skb->ip_summed = CHECKSUM_NONE;
ip_select_ident(iph, &rt->dst, NULL);
Expand Down

0 comments on commit 1ece0ef

Please sign in to comment.