Blame SOURCES/dnsmasq-2.79-rh1749092-fail.patch
|
|
85f98a |
From 8fda4b4620ca2b23152ca805d14c7cde1083fe31 Mon Sep 17 00:00:00 2001
|
|
|
85f98a |
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
|
|
85f98a |
Date: Tue, 1 Oct 2019 16:08:28 +0200
|
|
|
85f98a |
Subject: [PATCH] Report error on dhcp_release
|
|
|
85f98a |
|
|
|
85f98a |
If no IPv4 address is present on given interface, the tool would not
|
|
|
85f98a |
send any request. It would not report any error at the same time. Report
|
|
|
85f98a |
error if request send failed.
|
|
|
85f98a |
|
|
|
85f98a |
Signed-off-by: Petr Mensik <pemensik@redhat.com>
|
|
|
85f98a |
---
|
|
|
85f98a |
contrib/lease-tools/dhcp_release.c | 6 +++++-
|
|
|
85f98a |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
85f98a |
|
|
|
85f98a |
diff --git a/contrib/lease-tools/dhcp_release.c b/contrib/lease-tools/dhcp_release.c
|
|
|
85f98a |
index c866cd9..30e77c6 100644
|
|
|
85f98a |
--- a/contrib/lease-tools/dhcp_release.c
|
|
|
85f98a |
+++ b/contrib/lease-tools/dhcp_release.c
|
|
|
85f98a |
@@ -223,7 +223,11 @@ static struct in_addr find_interface(struct in_addr client, int fd, unsigned int
|
|
|
85f98a |
ifr->ifr_addr.sa_family = AF_INET;
|
|
|
85f98a |
if (ioctl(ifrfd, SIOCGIFADDR, ifr) != -1)
|
|
|
85f98a |
return ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr;
|
|
|
85f98a |
- exit(0);
|
|
|
85f98a |
+ else
|
|
|
85f98a |
+ {
|
|
|
85f98a |
+ fprintf(stderr, "error: local IPv4 address not found\n");
|
|
|
85f98a |
+ exit(1);
|
|
|
85f98a |
+ }
|
|
|
85f98a |
}
|
|
|
85f98a |
else if (h->nlmsg_type == RTM_NEWADDR)
|
|
|
85f98a |
{
|
|
|
85f98a |
--
|
|
|
85f98a |
2.20.1
|
|
|
85f98a |
|