projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rconn: Make rconn_connect() a 'void' function.
[openvswitch]
/
lib
/
dhcp-client.c
diff --git
a/lib/dhcp-client.c
b/lib/dhcp-client.c
index 4f90781334f80aeaf22fb51f667e40d97ca3c65c..709d7a368a601fe30071322cb1d6a2a57c55e141 100644
(file)
--- a/
lib/dhcp-client.c
+++ b/
lib/dhcp-client.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009
, 2010
Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-151,12
+151,17
@@
dhclient_create(const char *netdev_name,
void *aux, struct dhclient **cli_)
{
struct dhclient *cli;
void *aux, struct dhclient **cli_)
{
struct dhclient *cli;
+ struct netdev_options netdev_options;
struct netdev *netdev;
int error;
*cli_ = NULL;
struct netdev *netdev;
int error;
*cli_ = NULL;
- error = netdev_open(netdev_name, ETH_TYPE_IP, &netdev);
+ memset(&netdev_options, 0, sizeof netdev_options);
+ netdev_options.name = netdev_name;
+ netdev_options.ethertype = ETH_TYPE_IP;
+
+ error = netdev_open(&netdev_options, &netdev);
/* XXX install socket filter to catch only DHCP packets. */
if (error) {
VLOG_ERR("could not open %s network device: %s",
/* XXX install socket filter to catch only DHCP packets. */
if (error) {
VLOG_ERR("could not open %s network device: %s",
@@
-172,7
+177,7
@@
dhclient_create(const char *netdev_name,
return error;
}
return error;
}
- cli = x
calloc(1,
sizeof *cli);
+ cli = x
zalloc(
sizeof *cli);
cli->modify_request = modify_request;
cli->validate_offer = validate_offer;
cli->aux = aux;
cli->modify_request = modify_request;
cli->validate_offer = validate_offer;
cli->aux = aux;
@@
-768,7
+773,7
@@
dhclient_run_REBINDING(struct dhclient *cli)
}
static void
}
static void
-dhclient_run_RELEASED(struct dhclient *cli UNUSED)
+dhclient_run_RELEASED(struct dhclient *cli
OVS_
UNUSED)
{
/* Nothing to do. */
}
{
/* Nothing to do. */
}
@@
-799,13
+804,8
@@
void
dhclient_wait(struct dhclient *cli)
{
if (cli->min_timeout != UINT_MAX) {
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,
}
/* Reset timeout to 1 second. This will have no effect ordinarily, because
* dhclient_run() will typically set it back to a higher value. If,
@@
-924,7
+924,7
@@
do_receive_msg(struct dhclient *cli, struct dhcp_msg *msg)
goto drained;
}
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)
if (flow.dl_type != htons(ETH_TYPE_IP)
|| flow.nw_proto != IP_TYPE_UDP
|| flow.tp_dst != htons(DHCP_CLIENT_PORT)