From: Ben Pfaff 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-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a6f55420508c31af9fe41aafdd26ce8462cc1be;p=openvswitch 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 Tested-by: kk yap --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 82008be1..e0f1b663 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);