diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-03-20 19:14:18 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-03-20 19:14:18 -0400 |
| commit | 4307629f18a33af99ccc8241d50344f9eeeca2e0 (patch) | |
| tree | 1b25d64bd1d20fe15466e898966c87022836fb83 /zebra/zebra_netns_id.c | |
| parent | 267bf505c5604e1b1c3629f08d068aef68ef5777 (diff) | |
zebra: close fd when not needed
Upon decision that the vrf is not going to be supported
by namespaces close the fd.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_netns_id.c')
| -rw-r--r-- | zebra/zebra_netns_id.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c index d278ebe913..57f311aac5 100644 --- a/zebra/zebra_netns_id.c +++ b/zebra/zebra_netns_id.c @@ -349,8 +349,10 @@ ns_id_t zebra_ns_id_get_default(void) if (fd == -1) return NS_DEFAULT_INTERNAL; - if (!vrf_is_backend_netns()) + if (!vrf_is_backend_netns()) { + close(fd); return NS_DEFAULT_INTERNAL; + } close(fd); return zebra_ns_id_get((char *)NS_DEFAULT_NAME); #else /* HAVE_NETNS */ |
