diff mbox

[net] vxlan: release rt when found circular route

Message ID 1386230631-2504-1-git-send-email-fan.du@windriver.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

fan.du Dec. 5, 2013, 8:03 a.m. UTC
Otherwise causing dst memory leakage.
Have Checked all other type tunnel device transmit implementation,
no such things happens anymore.

Signed-off-by: Fan Du <fan.du@windriver.com>
---
 drivers/net/vxlan.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Eric Dumazet Dec. 5, 2013, 12:22 p.m. UTC | #1
On Thu, 2013-12-05 at 16:03 +0800, Fan Du wrote:
> Otherwise causing dst memory leakage.
> Have Checked all other type tunnel device transmit implementation,
> no such things happens anymore.
> 
> Signed-off-by: Fan Du <fan.du@windriver.com>

Acked-by: Eric Dumazet <edumazet@google.com>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 6, 2013, 8:14 p.m. UTC | #2
From: Fan Du <fan.du@windriver.com>
Date: Thu, 5 Dec 2013 16:03:51 +0800

> Otherwise causing dst memory leakage.
> Have Checked all other type tunnel device transmit implementation,
> no such things happens anymore.
> 
> Signed-off-by: Fan Du <fan.du@windriver.com>
...
> @@ -1665,6 +1665,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
>  		}
>  
>  		if (rt->dst.dev == dev) {
> +			ip_rt_put(rt);
>  			netdev_dbg(dev, "circular route to %pI4\n",
>  				   &dst->sin.sin_addr.s_addr);
>  			dev->stats.collisions++;

There is already a "rt_tx_error" label that will handle releasing the
'rt', so at the end of this basic block, goto rt_tx_error instead of
just plain tx_error.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 78df8f3..97b4340 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1665,6 +1665,7 @@  static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 		}
 
 		if (rt->dst.dev == dev) {
+			ip_rt_put(rt);
 			netdev_dbg(dev, "circular route to %pI4\n",
 				   &dst->sin.sin_addr.s_addr);
 			dev->stats.collisions++;