2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-30 13:57:50 +00:00

Move packet location code out of dispatch

This commit is contained in:
Ted Lemon
1996-05-22 09:29:56 +00:00
parent 5e4ef7037a
commit 3a5811084f
4 changed files with 26 additions and 8 deletions

14
bootp.c
View File

@@ -51,9 +51,7 @@ void bootp (packet)
struct packet *packet;
{
int result;
struct host_decl *hp = find_hosts_by_haddr (packet -> raw -> htype,
packet -> raw -> chaddr,
packet -> raw -> hlen);
struct host_decl *hp;
struct host_decl *host = (struct host_decl *)0;
struct packet outgoing;
struct dhcp_packet raw;
@@ -69,6 +67,13 @@ void bootp (packet)
packet -> raw -> hlen,
packet -> raw -> chaddr));
if (!locate_network (packet))
return;
hp = find_hosts_by_haddr (packet -> raw -> htype,
packet -> raw -> chaddr,
packet -> raw -> hlen);
lease = find_lease (packet);
/* Find an IP address in the host_decl that matches the
@@ -224,7 +229,8 @@ void bootp (packet)
#ifdef USE_FALLBACK
result = send_fallback (&fallback_interface,
packet, &raw, outgoing.packet_length,
(struct packet *)0,
&raw, outgoing.packet_length,
raw.siaddr, &to, &hto);
if (result < 0)
warn ("send_fallback: %m");

3
dhcp.c
View File

@@ -52,6 +52,9 @@ static unsigned char dhcp_message [256];
void dhcp (packet)
struct packet *packet;
{
if (!locate_network (packet))
return;
switch (packet -> packet_type) {
case DHCPDISCOVER:
dhcpdiscover (packet);

View File

@@ -51,9 +51,7 @@ void bootp (packet)
struct packet *packet;
{
int result;
struct host_decl *hp = find_hosts_by_haddr (packet -> raw -> htype,
packet -> raw -> chaddr,
packet -> raw -> hlen);
struct host_decl *hp;
struct host_decl *host = (struct host_decl *)0;
struct packet outgoing;
struct dhcp_packet raw;
@@ -69,6 +67,13 @@ void bootp (packet)
packet -> raw -> hlen,
packet -> raw -> chaddr));
if (!locate_network (packet))
return;
hp = find_hosts_by_haddr (packet -> raw -> htype,
packet -> raw -> chaddr,
packet -> raw -> hlen);
lease = find_lease (packet);
/* Find an IP address in the host_decl that matches the
@@ -224,7 +229,8 @@ void bootp (packet)
#ifdef USE_FALLBACK
result = send_fallback (&fallback_interface,
packet, &raw, outgoing.packet_length,
(struct packet *)0,
&raw, outgoing.packet_length,
raw.siaddr, &to, &hto);
if (result < 0)
warn ("send_fallback: %m");

View File

@@ -52,6 +52,9 @@ static unsigned char dhcp_message [256];
void dhcp (packet)
struct packet *packet;
{
if (!locate_network (packet))
return;
switch (packet -> packet_type) {
case DHCPDISCOVER:
dhcpdiscover (packet);