X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdhcp-client.c;h=709d7a368a601fe30071322cb1d6a2a57c55e141;hb=d4cbfb1952d586282999a287b4e2768c4297dde5;hp=fb6835c19d63ac217f5ebd8ab3cbfba79fe12c3e;hpb=149f577a25508779b756515be1f1bdcefa3710fa;p=openvswitch diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index fb6835c1..709d7a36 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -160,8 +160,6 @@ dhclient_create(const char *netdev_name, memset(&netdev_options, 0, sizeof netdev_options); netdev_options.name = netdev_name; netdev_options.ethertype = ETH_TYPE_IP; - netdev_options.may_create = true; - netdev_options.may_open = true; error = netdev_open(&netdev_options, &netdev); /* XXX install socket filter to catch only DHCP packets. */ @@ -775,7 +773,7 @@ dhclient_run_REBINDING(struct dhclient *cli) } static void -dhclient_run_RELEASED(struct dhclient *cli UNUSED) +dhclient_run_RELEASED(struct dhclient *cli OVS_UNUSED) { /* Nothing to do. */ } @@ -806,13 +804,8 @@ void dhclient_wait(struct dhclient *cli) { if (cli->min_timeout != UINT_MAX) { - time_t now = time_now(); - unsigned int wake = sat_add(cli->state_entered, cli->min_timeout); - if (wake <= now) { - poll_immediate_wake(); - } else { - poll_timer_wait(sat_mul(sat_sub(wake, now), 1000)); - } + long long int wake = sat_add(cli->state_entered, cli->min_timeout); + poll_timer_wait_until(wake * 1000); } /* Reset timeout to 1 second. This will have no effect ordinarily, because * dhclient_run() will typically set it back to a higher value. If, @@ -931,7 +924,7 @@ do_receive_msg(struct dhclient *cli, struct dhcp_msg *msg) goto drained; } - flow_extract(&b, 0, &flow); + flow_extract(&b, 0, 0, &flow); if (flow.dl_type != htons(ETH_TYPE_IP) || flow.nw_proto != IP_TYPE_UDP || flow.tp_dst != htons(DHCP_CLIENT_PORT)