]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: solve segfaults with ospf6d on FreeBSD
authorIngo Flaschberger <if@xip.at>
Sun, 17 Apr 2011 18:28:20 +0000 (18:28 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 21 Mar 2014 05:28:23 +0000 (06:28 +0100)
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 <equinox@opensourcerouting.org>
ospf6d/ospf6_message.c
zebra/kernel_socket.c

index 5fb5a216476ef40f6072da406ba5ab51ba5510ab..0756ef34c94be912ed4472cac270eb8c59a53888 100644 (file)
@@ -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);
index 73fabd4c0622a8209b2d9c28e2c7563f626b7dc2..37b2ae2319b355168402d07eac549a724606f088 100644 (file)
@@ -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)