diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2020-10-20 22:43:31 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2020-10-20 22:47:17 +0300 |
| commit | aebb5bfaf7e3cc22b01c9066af2534e5029bb651 (patch) | |
| tree | b0a1c7447adb9c28394e31d3e2c987d8ac317bd2 /ospf6d/ospf6_message.c | |
| parent | 175b6f3585307f1ffd47eacabb0275c33a8405be (diff) | |
ospf6d: fix crash on message receive
OSPF6 daemon starts listening on its socket and reading messages right
after the initialization before the ospf6 router is created. If any
message is received, ospf6d crashes because ospf6_receive doesn't
NULL-check ospf6 pointer.
Fix this by opening the socket and reading messages only after the
creation of ospf6 router.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospf6d/ospf6_message.c')
| -rw-r--r-- | ospf6d/ospf6_message.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 4830b38a66..0311ff4c2c 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -1535,7 +1535,7 @@ int ospf6_receive(struct thread *thread) /* add next read thread */ sockfd = THREAD_FD(thread); - thread_add_read(master, ospf6_receive, NULL, sockfd, NULL); + thread_add_read(master, ospf6_receive, NULL, sockfd, &ospf6->t_ospf6_receive); /* initialize */ memset(&src, 0, sizeof(src)); |
