mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Report error on dhcp_release
If no IPv4 address is present on given interface, the tool would not send any request. It would not report any error at the same time. Report error if request send failed. Signed-off-by: Petr Mensik <pemensik@redhat.com>
This commit is contained in:
committed by
Simon Kelley
parent
e710c34469
commit
6fe436a448
@@ -223,7 +223,11 @@ static struct in_addr find_interface(struct in_addr client, int fd, unsigned int
|
|||||||
ifr->ifr_addr.sa_family = AF_INET;
|
ifr->ifr_addr.sa_family = AF_INET;
|
||||||
if (ioctl(ifrfd, SIOCGIFADDR, ifr) != -1)
|
if (ioctl(ifrfd, SIOCGIFADDR, ifr) != -1)
|
||||||
return ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr;
|
return ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr;
|
||||||
exit(0);
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "error: local IPv4 address not found\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (h->nlmsg_type == RTM_NEWADDR)
|
else if (h->nlmsg_type == RTM_NEWADDR)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user