netdev-linux: Zero-out "sin" in netdev_linux_arp_lookup().
authorJustin Pettit <jpettit@nicira.com>
Wed, 23 Feb 2011 01:50:19 +0000 (17:50 -0800)
committerJustin Pettit <jpettit@nicira.com>
Wed, 23 Feb 2011 19:08:20 +0000 (11:08 -0800)
Coverity complains that we're copying the unitialized "sin_zero" member
from "sin" into "r".  I don't think this is an actual problem, but
there's no harm in zeroing out the structure, either.

Coverity #10916

lib/netdev-linux.c

index 0aceb45f86a16bb391e9e65de44c8aa215e2d6e0..a27a625f8b1d4af811f732a3e9c77041c21ff8ec 100644 (file)
@@ -2045,6 +2045,7 @@ netdev_linux_arp_lookup(const struct netdev *netdev,
     int retval;
 
     memset(&r, 0, sizeof r);
+    memset(&sin, 0, sizeof sin);
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = ip;
     sin.sin_port = 0;