diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2009-07-19 00:18:03 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2009-07-19 00:18:03 +0000 |
commit | 906efef01f5ab7d1d82c1f4358d4548429b929e3 (patch) | |
tree | 695821ba8307d8eeff8c17997f9269870c2f2bab /sbin | |
parent | ab0e7f8f132ba2976f4b55d4566f73c1a702d55e (diff) |
use addr_eq() where we can; ok krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/clparse.c | 11 | ||||
-rw-r--r-- | sbin/dhclient/dhclient.c | 7 |
2 files changed, 5 insertions, 13 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index 3661018d6ab..1bd7583502c 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.35 2009/05/27 15:04:34 stevesk Exp $ */ +/* $OpenBSD: clparse.c,v 1.36 2009/07/19 00:18:02 stevesk Exp $ */ /* Parser for dhclient config and lease files... */ @@ -440,9 +440,7 @@ parse_client_lease_statement(FILE *cfile, int is_static) */ pl = NULL; for (lp = client->leases; lp; lp = lp->next) { - if (lp->address.len == lease->address.len && - !memcmp(lp->address.iabuf, lease->address.iabuf, - lease->address.len)) { + if (addr_eq(lp->address, lease->address)) { if (pl) pl->next = lp->next; else @@ -480,10 +478,7 @@ parse_client_lease_statement(FILE *cfile, int is_static) if (client->active) { if (client->active->expiry < cur_time) free_client_lease(client->active); - else if (client->active->address.len == - lease->address.len && - !memcmp(client->active->address.iabuf, - lease->address.iabuf, lease->address.len)) + else if (addr_eq(client->active->address, lease->address)) free_client_lease(client->active); else { client->active->next = client->leases; diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 6cbe8e80679..ec81acf5c39 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.130 2009/06/12 20:07:35 stevesk Exp $ */ +/* $OpenBSD: dhclient.c,v 1.131 2009/07/19 00:18:02 stevesk Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -803,10 +803,7 @@ dhcpoffer(struct iaddr client_addr, struct option_data *options) /* If this is the lease we asked for, put it at the head of the list, and don't mess with the arp request timeout. */ - if (lease->address.len == client->requested_address.len && - !memcmp(lease->address.iabuf, - client->requested_address.iabuf, - client->requested_address.len)) { + if (addr_eq(lease->address, client->requested_address)) { lease->next = client->offered_leases; client->offered_leases = lease; } else { |