-/*
+/*
* dhcpcd - DHCP client daemon
* Copyright (c) 2006-2013 Roy Marples <roy@marples.name>
* All rights reserved
#define IPV4A ADDRIPV4 | ARRAY
#define IPV4R ADDRIPV4 | REQUEST
-/* We should define a maximum for the NAK exponential backoff */
+/* We should define a maximum for the NAK exponential backoff */
#define NAKOFF_MAX 60
/* Wait N nanoseconds between sending a RELEASE and dropping the address.
{ 1, ADDRIPV4 | REQUEST, "subnet_mask" },
/* RFC 3442 states that the CSR has to come before all other
* routes. For completeness, we also specify static routes,
- * then routers. */
+ * then routers. */
{ 121, RFC3442, "classless_static_routes" },
{ 249, RFC3442, "ms_classless_static_routes" },
{ 33, IPV4A | REQUEST, "static_routes" },
{ 6, IPV4A, "domain_name_servers" },
{ 7, IPV4A, "log_servers" },
{ 8, IPV4A, "cookie_servers" },
- { 9, IPV4A, "lpr_servers" },
+ { 9, IPV4A, "lpr_servers" },
{ 10, IPV4A, "impress_servers" },
{ 11, IPV4A, "resource_location_servers" },
{ 12, STRING, "host_name" },
{ 31, UINT8, "router_discovery" },
{ 32, ADDRIPV4, "router_solicitation_address" },
{ 34, UINT8, "trailer_encapsulation" },
- { 35, UINT32, "arp_cache_timeout" },
+ { 35, UINT32, "arp_cache_timeout" },
{ 36, UINT16, "ieee802_3_encapsulation" },
{ 37, UINT8, "default_tcp_ttl" },
{ 38, UINT32, "tcp_keepalive_interval" },
{ 47, STRING, "netbios_scope" },
{ 48, IPV4A, "font_servers" },
{ 49, IPV4A, "x_display_manager" },
- { 50, ADDRIPV4, "dhcp_requested_address" },
+ { 50, ADDRIPV4, "dhcp_requested_address" },
{ 51, UINT32 | REQUEST, "dhcp_lease_time" },
{ 52, UINT8, "dhcp_option_overload" },
{ 53, UINT8, "dhcp_message_type" },
atexit(free_option_buffer);
#endif
}
- if (!bp)
+ if (!bp)
bp = opt_buffer;
memcpy(bp, op, ol);
bp += ol;
errno = EINVAL;
return 0;
}
-
+
ipv4masklen = *p++;
pl--;
ipv6prefixlen = *p++;
pl--;
-
+
for (i = 0; i < 16; i++) {
ipv6prefix[i] = *p++;
pl--;
ipv6prefix[8], ipv6prefix[9], ipv6prefix[10],ipv6prefix[11],
ipv6prefix[12],ipv6prefix[13],ipv6prefix[14], ipv6prefix[15]
);
-
+
len -= b;
out += b;
bytes += b;
br[2] = *p++;
br[3] = *p++;
pl -= 4;
-
+
if (out) {
b= snprintf(out, len, " %d.%d.%d.%d",
br[0], br[1], br[2], br[3]);
bytes += (4 * 4);
}
}
-
+
return bytes;
}
dhcp->xid = htonl(state->xid);
dhcp->cookie = htonl(MAGIC_COOKIE);
- *p++ = DHO_MESSAGETYPE;
+ *p++ = DHO_MESSAGETYPE;
*p++ = 1;
*p++ = type;
n_params = p;
*p++ = 0;
for (opt = dhcp_opts; opt->option; opt++) {
- if (!(opt->type & REQUEST ||
+ if (!(opt->type & REQUEST ||
has_option_mask(ifo->requestmask, opt->option)))
continue;
if (type == DHCP_INFORM &&
uint32_t xid;
if (ifp->options->options & DHCPCD_XID_HWADDR &&
- ifp->hwlen >= sizeof(xid))
+ ifp->hwlen >= sizeof(xid))
/* The lower bits are probably more unique on the network */
memcpy(&xid, (ifp->hwaddr + ifp->hwlen) - sizeof(xid),
sizeof(xid));
goto eexit;
#endif
/* As we don't use this socket for receiving, set the
- * * receive buffer to 1 */
+ * receive buffer to 1 */
n = 1;
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1)
goto eexit;
struct if_options *ifo;
struct dhcp_state *state;
struct in_addr addr, net, dst;
-
+
ifo = ifp->options;
if (ifo->req_addr.s_addr != INADDR_ANY)
return 0;
blacklisted_ip(const struct if_options *ifo, in_addr_t addr)
{
size_t i;
-
+
for (i = 0; i < ifo->blacklist_len; i += 2)
if (ifo->blacklist[i] == (addr & ifo->blacklist[i + 1]))
return 1;
state->interval = 0;
/* We may have found a BOOTP server */
- if (get_option_uint8(&type, dhcp, DHO_MESSAGETYPE) == -1)
+ if (get_option_uint8(&type, dhcp, DHO_MESSAGETYPE) == -1)
type = 0;
if (type == DHCP_NAK) {
ifo = ifp->options;
/* We need to drop the leasefile so that start_interface
- * doesn't load it. */
+ * doesn't load it. */
if (ifo->options & DHCPCD_REQUEST)
unlink(state->leasefile);
else
dhcp_reboot(ifp);
}
-