]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Fix bug in device proto
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 23 Nov 2015 10:13:40 +0000 (11:13 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 23 Nov 2015 10:13:40 +0000 (11:13 +0100)
If an interface address notification is received during device protocol
shutdown/restart, BIRD crashed.

Thanks to Wei Huang for the bugreport.

sysdep/linux/netlink.c
sysdep/unix/krt.c
sysdep/unix/krt.h

index f2f6010098f2d4702cc51c01cafbb132a55c5ce3..efbf41a6d712d71af4442bdb97edc7a34820f09d 100644 (file)
@@ -1116,12 +1116,14 @@ nl_async_msg(struct nlmsghdr *h)
     case RTM_NEWLINK:
     case RTM_DELLINK:
       DBG("KRT: Received async link notification (%d)\n", h->nlmsg_type);
-      nl_parse_link(h, 0);
+      if (kif_proto)
+       nl_parse_link(h, 0);
       break;
     case RTM_NEWADDR:
     case RTM_DELADDR:
       DBG("KRT: Received async address notification (%d)\n", h->nlmsg_type);
-      nl_parse_addr(h, 0);
+      if (kif_proto)
+       nl_parse_addr(h, 0);
       break;
     default:
       DBG("KRT: Received unknown async notification (%d)\n", h->nlmsg_type);
index 49bf9519d19e5fc606eb997f357194a9af26bb17..5e78586bfec9fb27bc5a462c9153b3c052cb9d7d 100644 (file)
@@ -84,8 +84,8 @@ krt_io_init(void)
  *     Interfaces
  */
 
+struct kif_proto *kif_proto;
 static struct kif_config *kif_cf;
-static struct kif_proto *kif_proto;
 static timer *kif_scan_timer;
 static bird_clock_t kif_last_shot;
 
index aea20102a891a036289bbc474f0c65c181248623..d4a8717e38ec9ce451ff58a489d92b256d9253ca 100644 (file)
@@ -112,6 +112,8 @@ struct kif_proto {
   struct kif_state sys;                /* Sysdep state */
 };
 
+struct kif_proto *kif_proto;
+
 #define KIF_CF ((struct kif_config *)p->p.cf)
 
 struct proto_config * krt_init_config(int class);