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:
14
bootp.c
14
bootp.c
@@ -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
3
dhcp.c
@@ -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);
|
||||
|
@@ -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");
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user