]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix crash on *BSD
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 2 May 2018 03:24:53 +0000 (23:24 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 2 May 2018 03:24:53 +0000 (23:24 -0400)
The zns->ns pointer is not created until we get a callback
from the kernel that a ns exists.  This should potentially
fix a crash in the *BSD code path.

Fixes: #2152
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/kernel_socket.c

index 1a94807317242f6f9a850d334cc0c2b071ad0d30..e60e05bcdf3c5eddf53ca2b259d595542d0d1f85 100644 (file)
@@ -1386,7 +1386,7 @@ static void routing_socket(struct zebra_ns *zns)
                zlog_err("routing_socket: Can't raise privileges");
 
        routing_sock =
-               ns_socket(AF_ROUTE, SOCK_RAW, 0, (ns_id_t)zns->ns->ns_id);
+               ns_socket(AF_ROUTE, SOCK_RAW, 0, zns->ns_id);
 
        if (routing_sock < 0) {
                if (zserv_privs.change(ZPRIVS_LOWER))