summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-07-19 08:50:01 -0400
committerGitHub <noreply@github.com>2018-07-19 08:50:01 -0400
commitd1a85fe40d93d31f7f0daf54912a159fcabfaddc (patch)
treee947467da69832a04e10e24334e4fbc06285884d /lib
parent06a5959f10f30740dcdf7d09a9c77f1504fc3328 (diff)
parent2e1cc436791c3d2e39af9ffbd8194e9e4abc7795 (diff)
Merge pull request #2608 from pacovn/PVS-Studio_dead_code_1
eigrpd lib pimd zebra: dead code (PVS-Studio)
Diffstat (limited to 'lib')
-rw-r--r--lib/filter.c3
-rw-r--r--lib/module.c2
-rw-r--r--lib/vrf.c5
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/filter.c b/lib/filter.c
index 5f391aa767..670c65374a 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -549,8 +549,7 @@ static int vty_access_list_remark_unset(struct vty *vty, afi_t afi,
access->remark = NULL;
}
- if (access->head == NULL && access->tail == NULL
- && access->remark == NULL)
+ if (access->head == NULL && access->tail == NULL)
access_list_delete(access);
return CMD_SUCCESS;
diff --git a/lib/module.c b/lib/module.c
index 0c85364003..7d5671290b 100644
--- a/lib/module.c
+++ b/lib/module.c
@@ -85,7 +85,7 @@ struct frrmod_runtime *frrmod_load(const char *spec, const char *dir, char *err,
*args++ = '\0';
if (!strchr(name, '/')) {
- if (!handle && execname) {
+ if (execname) {
snprintf(fullpath, sizeof(fullpath), "%s/%s_%s.so", dir,
execname, name);
handle = dlopen(fullpath, RTLD_NOW | RTLD_GLOBAL);
diff --git a/lib/vrf.c b/lib/vrf.c
index 643ad29cf8..ca50c1e70e 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -628,7 +628,7 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname,
}
if (vrf->ns_ctxt != NULL) {
ns = (struct ns *)vrf->ns_ctxt;
- if (ns && 0 != strcmp(ns->name, pathname)) {
+ if (!strcmp(ns->name, pathname)) {
if (vty)
vty_out(vty,
"VRF %u already configured with NETNS %s\n",
@@ -661,8 +661,7 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname,
ns->vrf_ctxt = (void *)vrf;
vrf->ns_ctxt = (void *)ns;
/* update VRF netns NAME */
- if (vrf)
- strlcpy(vrf->data.l.netns_name, basename(pathname), NS_NAMSIZ);
+ strlcpy(vrf->data.l.netns_name, basename(pathname), NS_NAMSIZ);
if (!ns_enable(ns, vrf_update_vrf_id)) {
if (vty)