From: Ingo Flaschberger Date: Sun, 17 Apr 2011 18:28:20 +0000 (+0000) Subject: ospf6d: solve segfaults with ospf6d on FreeBSD X-Git-Tag: frr-2.0-rc1~1627 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1db65fadf627637621c342b789b9a3604ca5fab5;p=mirror%2Ffrr.git ospf6d: solve segfaults with ospf6d on FreeBSD Do not send ospf6d hellos on fresh created interfaces without configuration (ie. no vlan configured). Ospf6d use ip6_mtu, if it's not initalised, Ospf6d tries to alloc indefinite size of memory. Signed-off-by: David Lamparter --- diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 5fb5a21647..0756ef34c9 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -1721,6 +1721,13 @@ ospf6_hello_send (struct thread *thread) return 0; } + if (iobuflen == 0) + { + zlog_debug ("Unable to send Hello on interface %s iobuflen is 0", + oi->interface->name); + return 0; + } + /* set next thread */ oi->thread_send_hello = thread_add_timer (master, ospf6_hello_send, oi, oi->hello_interval); diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 73fabd4c06..37b2ae2319 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -299,6 +299,7 @@ ifan_read (struct if_announcemsghdr *ifan) sizeof(ifan->ifan_name))); ifp->ifindex = ifan->ifan_index; + if_get_metric (ifp); if_add_update (ifp); } else if (ifp != NULL && ifan->ifan_what == IFAN_DEPARTURE)