summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dispatch.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-01-11 02:36:30 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-01-11 02:36:30 +0000
commita247524df82685265845e77b7df45728ff011677 (patch)
tree7c235c77efc8736bc1a16dbb631e142cbcfb7369 /sbin/dhclient/dispatch.c
parent1124f9512c12c95519a730c29ad801dc4be66469 (diff)
Since bootp_packet_handler is always set to do_packet before we
process any packets, eliminate that abstraction and just call do_packet directly. No functional change. ok stevesk
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r--sbin/dhclient/dispatch.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index 10e7e1a0ef2..8db2a9b888a 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.36 2007/01/04 22:17:48 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.37 2007/01/11 02:36:29 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -51,8 +51,6 @@ struct protocol *protocols;
struct timeout *timeouts;
static struct timeout *free_timeouts;
static int interfaces_invalidated;
-void (*bootp_packet_handler)(int, unsigned int, struct iaddr,
- struct hardware *);
static int interface_status(void);
@@ -120,10 +118,9 @@ reinitialize_interface(void)
}
/*
- * Wait for packets to come in using poll(). When a packet comes in,
- * call receive_packet to receive the packet and possibly strip hardware
- * addressing information from it, and then call through the
- * bootp_packet_handler hook to try to do something with it.
+ * Wait for packets to come in using poll(). When a packet comes in, call
+ * receive_packet to receive the packet and possibly strip hardware addressing
+ * information from it, and then call do_packet to try to do something with it.
*/
void
dispatch(void)
@@ -242,12 +239,10 @@ got_one(struct protocol *l)
if (result == 0)
return;
- if (bootp_packet_handler) {
- ifrom.len = 4;
- memcpy(ifrom.iabuf, &from.sin_addr, ifrom.len);
+ ifrom.len = 4;
+ memcpy(ifrom.iabuf, &from.sin_addr, ifrom.len);
- (*bootp_packet_handler)(result, from.sin_port, ifrom, &hfrom);
- }
+ do_packet(result, from.sin_port, ifrom, &hfrom);
}
int