From: Donald Sharp Date: Wed, 2 May 2018 03:24:53 +0000 (-0400) Subject: zebra: Fix crash on *BSD X-Git-Tag: frr-5.0-dev~1^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=898a23caa76f6755f45fce937dd09026abbd7dd8;p=matthieu%2Ffrr.git zebra: Fix crash on *BSD 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 --- diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 1a94807317..e60e05bcdf 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -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))