From: Ben Pfaff <blp@nicira.com>
Date: Mon, 7 Feb 2011 20:46:25 +0000 (-0800)
Subject: ofproto: Clear out entire 'name' field of ofp_phy_port when initializing.
X-Git-Tag: v1.1.0~320
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0a6f55420508c31af9fe41aafdd26ce8462cc1be;p=sliver-openvswitch.git

ofproto: Clear out entire 'name' field of ofp_phy_port when initializing.

Sometimes garbage could appear in the name field following the port name,
since it wasn't completely zeroed.

Reported-by: kk yap <yapkke@openvswitch.org>
Tested-by: kk yap <yapkke@openvswitch.org>
---

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 82008be10..e0f1b6632 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1567,7 +1567,7 @@ make_ofport(const struct dpif_port *dpif_port)
         return NULL;
     }
 
-    ofport = xmalloc(sizeof *ofport);
+    ofport = xzalloc(sizeof *ofport);
     ofport->netdev = netdev;
     ofport->odp_port = dpif_port->port_no;
     ofport->opp.port_no = odp_port_to_ofp_port(dpif_port->port_no);