- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 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.
#define DHCLIENT_STATES \
DHCLIENT_STATE(INIT, 1 << 0) \
#define DHCLIENT_STATES \
DHCLIENT_STATE(INIT, 1 << 0) \
do_send_msg(cli, &msg);
cli->delay = MIN(cli->max_timeout, MAX(4, cli->delay * 2));
cli->retransmit += fuzz(cli->delay, 1);
do_send_msg(cli, &msg);
cli->delay = MIN(cli->max_timeout, MAX(4, cli->delay * 2));
cli->retransmit += fuzz(cli->delay, 1);
- netdev_get_mtu(cli->netdev, &mtu);
- ofpbuf_init(&b, mtu + VLAN_ETH_HEADER_LEN);
+ ofpbuf_init(&b, ETH_TOTAL_MAX + VLAN_ETH_HEADER_LEN);
netdev_get_etheraddr(cli->netdev, cli_mac);
for (; cli->received < 50; cli->received++) {
const struct ip_header *ip;
const struct dhcp_header *dhcp;
netdev_get_etheraddr(cli->netdev, cli_mac);
for (; cli->received < 50; cli->received++) {
const struct ip_header *ip;
const struct dhcp_header *dhcp;
flow_extract(&b, 0, 0, &flow);
if (flow.dl_type != htons(ETH_TYPE_IP)
flow_extract(&b, 0, 0, &flow);
if (flow.dl_type != htons(ETH_TYPE_IP)
|| flow.tp_dst != htons(DHCP_CLIENT_PORT)
|| !(eth_addr_is_broadcast(flow.dl_dst)
|| eth_addr_equals(flow.dl_dst, cli_mac))) {
|| flow.tp_dst != htons(DHCP_CLIENT_PORT)
|| !(eth_addr_is_broadcast(flow.dl_dst)
|| eth_addr_equals(flow.dl_dst, cli_mac))) {
nh.ip_csum = 0;
nh.ip_src = dhclient_get_ip(cli);
/* XXX need to use UDP socket for nonzero server IPs so that we can get
nh.ip_csum = 0;
nh.ip_src = dhclient_get_ip(cli);
/* XXX need to use UDP socket for nonzero server IPs so that we can get
th.udp_csum = 0;
udp_csum = csum_add32(0, nh.ip_src);
udp_csum = csum_add32(udp_csum, nh.ip_dst);
th.udp_csum = 0;
udp_csum = csum_add32(0, nh.ip_src);
udp_csum = csum_add32(udp_csum, nh.ip_dst);
udp_csum = csum_add16(udp_csum, th.udp_len);
udp_csum = csum_continue(udp_csum, &th, sizeof th);
th.udp_csum = csum_finish(csum_continue(udp_csum, b.data, b.size));
udp_csum = csum_add16(udp_csum, th.udp_len);
udp_csum = csum_continue(udp_csum, &th, sizeof th);
th.udp_csum = csum_finish(csum_continue(udp_csum, b.data, b.size));