| OLD | NEW |
| 1 /* | 1 /* |
| 2 * dhcpcd - DHCP client daemon | 2 * dhcpcd - DHCP client daemon |
| 3 * Copyright (c) 2006-2009 Roy Marples <roy@marples.name> | 3 * Copyright (c) 2006-2009 Roy Marples <roy@marples.name> |
| 4 * All rights reserved | 4 * All rights reserved |
| 5 | 5 |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 355 |
| 356 exit: | 356 exit: |
| 357 if (valid_length(opt, bl, type) == -1) { | 357 if (valid_length(opt, bl, type) == -1) { |
| 358 errno = EINVAL; | 358 errno = EINVAL; |
| 359 return NULL; | 359 return NULL; |
| 360 } | 360 } |
| 361 if (len) | 361 if (len) |
| 362 *len = bl; | 362 *len = bl; |
| 363 if (bp) { | 363 if (bp) { |
| 364 memcpy(bp, op, ol); | 364 memcpy(bp, op, ol); |
| 365 » » return (const uint8_t *)&opt_buffer; | 365 » » return (const uint8_t *)opt_buffer; |
| 366 } | 366 } |
| 367 if (op) | 367 if (op) |
| 368 return op; | 368 return op; |
| 369 errno = ENOENT; | 369 errno = ENOENT; |
| 370 return NULL; | 370 return NULL; |
| 371 } | 371 } |
| 372 | 372 |
| 373 int | 373 int |
| 374 get_option_addr(struct in_addr *a, const struct dhcp_message *dhcp, | 374 get_option_addr(struct in_addr *a, const struct dhcp_message *dhcp, |
| 375 uint8_t option) | 375 uint8_t option) |
| (...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 lease->leasetime = ~0U; /* Infinite lease */ | 1391 lease->leasetime = ~0U; /* Infinite lease */ |
| 1392 } else | 1392 } else |
| 1393 lease->leasetime = ~0U; /* Default to infinite lease */ | 1393 lease->leasetime = ~0U; /* Default to infinite lease */ |
| 1394 if (get_option_uint32(&lease->renewaltime, dhcp, DHO_RENEWALTIME) != 0) | 1394 if (get_option_uint32(&lease->renewaltime, dhcp, DHO_RENEWALTIME) != 0) |
| 1395 lease->renewaltime = 0; | 1395 lease->renewaltime = 0; |
| 1396 if (get_option_uint32(&lease->rebindtime, dhcp, DHO_REBINDTIME) != 0) | 1396 if (get_option_uint32(&lease->rebindtime, dhcp, DHO_REBINDTIME) != 0) |
| 1397 lease->rebindtime = 0; | 1397 lease->rebindtime = 0; |
| 1398 if (get_option_addr(&lease->server, dhcp, DHO_SERVERID) != 0) | 1398 if (get_option_addr(&lease->server, dhcp, DHO_SERVERID) != 0) |
| 1399 lease->server.s_addr = INADDR_ANY; | 1399 lease->server.s_addr = INADDR_ANY; |
| 1400 } | 1400 } |
| OLD | NEW |