Skip to content

Commit

Permalink
xfrm: Release dst if this dst is improper for vti tunnel
Browse files Browse the repository at this point in the history
After searching rt by the vti tunnel dst/src parameter,
if this rt has neither attached to any transformation
nor the transformation is not tunnel oriented, this rt
should be released back to ip layer.

otherwise causing dst memory leakage.

Signed-off-by: Fan Du <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
fan.du authored and davem330 committed Nov 19, 2013
1 parent 840e93f commit 236c9f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/ip_vti.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
if (!rt->dst.xfrm ||
rt->dst.xfrm->props.mode != XFRM_MODE_TUNNEL) {
dev->stats.tx_carrier_errors++;
ip_rt_put(rt);
goto tx_error_icmp;
}
tdev = rt->dst.dev;
Expand Down

0 comments on commit 236c9f8

Please sign in to comment.