mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-20 02:38:32 +00:00
dhcp_buff2 not availble in log_packet, use daemon->addrbuff
This commit is contained in:
@@ -1698,9 +1698,9 @@ static void log_packet(char *type, void *addr, unsigned char *ext_mac,
|
|||||||
if (!err && !option_bool(OPT_LOG_OPTS) && option_bool(OPT_QUIET_DHCP))
|
if (!err && !option_bool(OPT_LOG_OPTS) && option_bool(OPT_QUIET_DHCP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
daemon->dhcp_buff2[0] = 0;
|
daemon->addrbuff[0] = 0;
|
||||||
if (addr)
|
if (addr)
|
||||||
inet_ntop(AF_INET, addr, daemon->dhcp_buff2, DHCP_BUFF_SZ - 1);
|
inet_ntop(AF_INET, addr, daemon->addrbuff, ADDRSTRLEN);
|
||||||
|
|
||||||
print_mac(daemon->namebuff, ext_mac, mac_len);
|
print_mac(daemon->namebuff, ext_mac, mac_len);
|
||||||
|
|
||||||
@@ -1709,7 +1709,7 @@ static void log_packet(char *type, void *addr, unsigned char *ext_mac,
|
|||||||
ntohl(xid),
|
ntohl(xid),
|
||||||
type,
|
type,
|
||||||
interface,
|
interface,
|
||||||
daemon->dhcp_buff2,
|
daemon->addrbuff,
|
||||||
addr ? " " : "",
|
addr ? " " : "",
|
||||||
daemon->namebuff,
|
daemon->namebuff,
|
||||||
string ? string : "",
|
string ? string : "",
|
||||||
@@ -1718,7 +1718,7 @@ static void log_packet(char *type, void *addr, unsigned char *ext_mac,
|
|||||||
my_syslog(MS_DHCP | LOG_INFO, "%s(%s) %s%s%s %s%s",
|
my_syslog(MS_DHCP | LOG_INFO, "%s(%s) %s%s%s %s%s",
|
||||||
type,
|
type,
|
||||||
interface,
|
interface,
|
||||||
daemon->dhcp_buff2,
|
daemon->addrbuff,
|
||||||
addr ? " " : "",
|
addr ? " " : "",
|
||||||
daemon->namebuff,
|
daemon->namebuff,
|
||||||
string ? string : "",
|
string ? string : "",
|
||||||
@@ -1726,9 +1726,9 @@ static void log_packet(char *type, void *addr, unsigned char *ext_mac,
|
|||||||
|
|
||||||
#ifdef HAVE_UBUS
|
#ifdef HAVE_UBUS
|
||||||
if (!strcmp(type, "DHCPACK"))
|
if (!strcmp(type, "DHCPACK"))
|
||||||
ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? daemon->dhcp_buff2 : NULL, string, interface);
|
ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? daemon->addrbuff : NULL, string, interface);
|
||||||
else if (!strcmp(type, "DHCPRELEASE"))
|
else if (!strcmp(type, "DHCPRELEASE"))
|
||||||
ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? daemon->dhcp_buff2 : NULL, string, interface);
|
ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? daemon->addrbuff : NULL, string, interface);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user