Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: dhcp.c

Issue 6738002: CHROMIUMOS: dhcp: Remove errant extra ref (Closed) Base URL: http://git.chromium.org/git/dhcpcd.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698