summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-04-17 16:36:56 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-04-18 12:16:19 -0400
commit25521d49a78f0e792c00c72e730c188877829751 (patch)
tree35deb2ef4b5148cc76f97760257d9246868609ac
parent6451e84664d5735922c087733f1000a9ebd99504 (diff)
pimd: avoid writing to negative fd
Coverty #1465483 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--pimd/mtracebis_routeget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pimd/mtracebis_routeget.c b/pimd/mtracebis_routeget.c
index d75aaa3708..8c1cd8d963 100644
--- a/pimd/mtracebis_routeget.c
+++ b/pimd/mtracebis_routeget.c
@@ -81,7 +81,7 @@ int routeget(struct in_addr dst, struct in_addr *src, struct in_addr *gw)
ret = rtnl_open(&rth, 0);
- if (ret < 0)
+ if (ret < 0 || rth.fd <= 0)
return ret;
if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0) {