diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-04 22:17:49 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-04 22:17:49 +0000 |
commit | 5e23b0060e1a09deda402f4ee3adc52ba4b1735a (patch) | |
tree | aeff0eee7168abf7d7b827c1f6ab40485f55e1ae /sbin/dhclient/dispatch.c | |
parent | 1d88fc608533f55ea47a0978e4b19767327d9868 (diff) |
Another round of cleanup. There is only one instance of struct
dhcp_packet and it is contained in the global *client. So don't pass
around pointers to a struct that contains a pointer to the dhcp_packet
instance. Just use the global client->packet. Eliminate unused struct
packet members and parameter lists accordingly.
No functional change.
Suggestions by stevesk@. ok stevesk@
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r-- | sbin/dhclient/dispatch.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index d23020454fd..10e7e1a0ef2 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.35 2006/12/26 21:19:52 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.36 2007/01/04 22:17:48 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -51,8 +51,8 @@ struct protocol *protocols; struct timeout *timeouts; static struct timeout *free_timeouts; static int interfaces_invalidated; -void (*bootp_packet_handler)(struct dhcp_packet *, int, unsigned int, - struct iaddr, struct hardware *); +void (*bootp_packet_handler)(int, unsigned int, struct iaddr, + struct hardware *); static int interface_status(void); @@ -222,17 +222,8 @@ got_one(struct protocol *l) struct hardware hfrom; struct iaddr ifrom; ssize_t result; - union { - /* - * Packet input buffer. Must be as large as largest - * possible MTU. - */ - unsigned char packbuf[4095]; - struct dhcp_packet packet; - } u; - if ((result = receive_packet(u.packbuf, sizeof(u), &from, &hfrom)) == - -1) { + if ((result = receive_packet(&from, &hfrom)) == -1) { warning("receive_packet failed on %s: %s", ifi->name, strerror(errno)); ifi->errors++; @@ -255,8 +246,7 @@ got_one(struct protocol *l) ifrom.len = 4; memcpy(ifrom.iabuf, &from.sin_addr, ifrom.len); - (*bootp_packet_handler)(&u.packet, result, - from.sin_port, ifrom, &hfrom); + (*bootp_packet_handler)(result, from.sin_port, ifrom, &hfrom); } } |