Blame SOURCES/0002-macvtap-fix-error-condition.patch

db1822
From cf7e43786749fcb1325d5b8e4cf0816f0eed3556 Mon Sep 17 00:00:00 2001
db1822
From: Aaron Conole <aconole@redhat.com>
db1822
Date: Wed, 25 Aug 2021 10:22:20 -0400
db1822
Subject: [PATCH 2/8] macvtap: fix error condition
db1822
db1822
If the socket() call fails, we will jump to out and pass a
db1822
negative value to close() which is not allowed.
db1822
db1822
Fixes: d43abb0267f3 ("lldpad: do not use macv[tap/lan] interfaces as ports")
db1822
closes https://github.com/intel/openlldp/issues/75
db1822
Signed-off-by: Aaron Conole <aconole@redhat.com>
db1822
---
db1822
 lldp_util.c | 2 +-
db1822
 1 file changed, 1 insertion(+), 1 deletion(-)
db1822
db1822
diff --git a/lldp_util.c b/lldp_util.c
db1822
index 1e58b1e..be1333e 100644
db1822
--- a/lldp_util.c
db1822
+++ b/lldp_util.c
db1822
@@ -681,7 +681,7 @@ int is_macvtap(const char *ifname)
db1822
 	s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
db1822
 
db1822
 	if (s < 0) {
db1822
-		goto out;
db1822
+		return false;
db1822
 	}
db1822
 
db1822
 	nlh = malloc(NLMSG_SIZE);
db1822
-- 
db1822
2.31.1
db1822