From f7cf2ff0b63dc76af9358282dcbe81e9433a94ae Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 10 May 2010 16:16:33 -0700 Subject: [PATCH] vport: Record and free packets on unattached ports. We throw away packets that are received on vports not attached to a datapath but we are actually leaking them. This records that an error took place and frees the skb. --- datapath/vport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datapath/vport.c b/datapath/vport.c index 5e164a91..716a4588 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -1047,8 +1047,12 @@ vport_receive(struct vport *vport, struct sk_buff *skb) { struct dp_port *dp_port = vport_get_dp_port(vport); - if (!dp_port) + if (!dp_port) { + vport_record_error(vport, VPORT_E_RX_DROPPED); + kfree_skb(skb); + return; + } if (vport->ops->flags & VPORT_F_GEN_STATS) { struct vport_percpu_stats *stats; -- 2.30.2