diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-11-08 21:32:56 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-11-08 21:32:56 +0000 |
commit | a10f0fb87cf2a387fb9baadde502dbd3b14ee038 (patch) | |
tree | d4dc9f00e5c3dea5eb6ac157b7c463220f95c21f /sbin/dhclient/options.c | |
parent | 574d003669e9f6a8e4d129189d1446d6fdd9faa5 (diff) |
Remove confusing extra address abstraction 'struct iaddr'. Just use
'in_addr'. Remove many double conversions and other perversions.
piaddr() replaced with inet_ntoa(). dhclient is extremely unlikely
to support anything but ipv4/dhcp without a complete rewrite.
Joint work with chris@.
Positive feedback from deraadt@ zinke@ phessler@.
Diffstat (limited to 'sbin/dhclient/options.c')
-rw-r--r-- | sbin/dhclient/options.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index caf51105d29..f7959c6dd68 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.43 2012/11/07 15:20:28 krw Exp $ */ +/* $OpenBSD: options.c,v 1.44 2012/11/08 21:32:55 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -448,13 +448,13 @@ pretty_print_option(unsigned int code, struct option_data *option, } void -do_packet(int len, unsigned int from_port, struct iaddr from, +do_packet(int len, unsigned int from_port, struct in_addr from, struct hardware *hfrom) { struct dhcp_packet *packet = &client->packet; struct option_data options[256]; - struct iaddrlist *ap; - void (*handler)(struct iaddr, struct option_data *); + struct reject_elem *ap; + void (*handler)(struct in_addr, struct option_data *); char *type; int i, options_valid = 1; @@ -522,16 +522,16 @@ do_packet(int len, unsigned int from_port, struct iaddr from, if (handler && client->xid == client->packet.xid) { if (hfrom->hlen == 6) - note("%s from %s (%s)", type, piaddr(from), + note("%s from %s (%s)", type, inet_ntoa(from), ether_ntoa((struct ether_addr *)hfrom->haddr)); else - note("%s from %s", type, piaddr(from)); + note("%s from %s", type, inet_ntoa(from)); } else handler = NULL; for (ap = config->reject_list; ap && handler; ap = ap->next) - if (addr_eq(from, ap->addr)) { - note("%s from %s rejected.", type, piaddr(from)); + if (from.s_addr == ap->addr.s_addr) { + note("%s from %s rejected.", type, inet_ntoa(from)); handler = NULL; } |