]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Now sending IF_CHANGE_CREATE when a new interface appears and IF_CHANGE_UP
authorMartin Mares <mj@ucw.cz>
Thu, 4 Jun 1998 20:30:11 +0000 (20:30 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 4 Jun 1998 20:30:11 +0000 (20:30 +0000)
only if it's really up.

nest/iface.c
nest/iface.h

index 3f21c435fe9271582bb57adae868ea568ce1f304..41cb05bbead04a8c60e1748adc7159cb2691ef27 100644 (file)
@@ -193,7 +193,7 @@ if_dump_all(void)
 {
   struct iface *i;
 
-  debug("Known network interfaces:\n\n");
+  debug("Known network interfaces:\n");
   WALK_LIST(i, iface_list)
     if_dump(i);
   debug("\n");
@@ -292,7 +292,8 @@ newif:
   memcpy(i, new, sizeof(*i));
   i->flags |= IF_UPDATED;
   add_tail(&iface_list, &i->n);
-  if_notify_change(IF_CHANGE_UP | IF_CHANGE_FLAGS | IF_CHANGE_MTU, NULL, i);
+  if_notify_change(IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0)
+                  | IF_CHANGE_FLAGS | IF_CHANGE_MTU, NULL, i);
 }
 
 void
index c3594493c39d0337a0a045ed4ee89fceef1681fe..b1984b398025a8c7ebc9502e45ba47f43ac155fe 100644 (file)
@@ -44,6 +44,7 @@ struct iface {
 #define IF_CHANGE_DOWN 2
 #define IF_CHANGE_FLAGS 4              /* Can be converted to down/up internally */
 #define IF_CHANGE_MTU 8
+#define IF_CHANGE_CREATE 16            /* Seen this interface for the first time */
 
 void if_init(void);
 void if_dump(struct iface *);