From: Ben Pfaff Date: Tue, 22 Jul 2008 20:16:08 +0000 (-0700) Subject: dhcp: Don't attempt to drain netdev if we ran out of packets. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fd1cf6b8744a26be0961d158b1b1b858f2ae026;p=openvswitch dhcp: Don't attempt to drain netdev if we ran out of packets. Fixes a theoretical race condition that would have caused more retransmission than otherwise necessary. --- diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index 0757096f..b2588e19 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -731,7 +731,7 @@ do_receive_msg(struct dhclient *cli, struct dhcp_msg *msg) buffer_clear(&b); error = netdev_recv(cli->netdev, &b); if (error) { - break; + goto drained; } flow_extract(&b, 0, &flow); @@ -766,6 +766,7 @@ do_receive_msg(struct dhclient *cli, struct dhcp_msg *msg) } } netdev_drain(cli->netdev); +drained: buffer_uninit(&b); return false; }