summaryrefslogtreecommitdiffstats
path: root/nhrpd/netlink_arp.c
diff options
context:
space:
mode:
authorJorge Boncompte <jbonor@gmail.com>2017-08-10 21:21:14 +0200
committerJorge Boncompte <jbonor@gmail.com>2017-08-10 21:21:14 +0200
commit6c8ca260505bf1d96c87371ad71278576345bb5c (patch)
treebf5b48ca98b8c2fd96cc571ebc3669f8b6428ac4 /nhrpd/netlink_arp.c
parentMerge pull request #941 from dwalton76/bgpd-peer-group-rebind (diff)
downloadfrr-6c8ca260505bf1d96c87371ad71278576345bb5c.tar.xz
frr-6c8ca260505bf1d96c87371ad71278576345bb5c.zip
nhrpd: fix issues found by coverity
Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
Diffstat (limited to 'nhrpd/netlink_arp.c')
-rw-r--r--nhrpd/netlink_arp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c
index 2b222e3c5..425526ced 100644
--- a/nhrpd/netlink_arp.c
+++ b/nhrpd/netlink_arp.c
@@ -230,20 +230,27 @@ void netlink_set_nflog_group(int nlgroup)
netlink_nflog_group = nlgroup;
if (nlgroup) {
netlink_log_fd = znl_open(NETLINK_NETFILTER, 0);
+ if (netlink_log_fd < 0)
+ return;
+
netlink_log_register(netlink_log_fd, nlgroup);
thread_add_read(master, netlink_log_recv, 0, netlink_log_fd,
&netlink_log_thread);
}
}
-int netlink_init(void)
+void netlink_init(void)
{
netlink_req_fd = znl_open(NETLINK_ROUTE, 0);
+ if (netlink_req_fd < 0)
+ return;
+
netlink_listen_fd = znl_open(NETLINK_ROUTE, RTMGRP_NEIGH);
+ if (netlink_listen_fd < 0)
+ return;
+
thread_add_read(master, netlink_route_recv, 0, netlink_listen_fd,
NULL);
-
- return 0;
}
int netlink_configure_arp(unsigned int ifindex, int pf)