ofproto: Clear out entire 'name' field of ofp_phy_port when initializing.
authorBen Pfaff <blp@nicira.com>
Mon, 7 Feb 2011 20:46:25 +0000 (12:46 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 7 Feb 2011 20:46:25 +0000 (12:46 -0800)
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>
ofproto/ofproto.c

index 82008be..e0f1b66 100644 (file)
@@ -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);