]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: remove defaults from iface config (BZ#550)
authorVyacheslav Trushkin <me@dogonthesun.net>
Fri, 10 Feb 2012 06:42:45 +0000 (10:42 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 21 Feb 2012 17:45:42 +0000 (21:45 +0400)
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h

index f6420513b22120b15e7d5e3f9002ebc0827243e6..71aa6859c78aa801273effbac5cc3dad90e45cc5 100644 (file)
@@ -108,14 +108,14 @@ ospf6_interface_create (struct interface *ifp)
   oi->neighbor_list = list_new ();
   oi->neighbor_list->cmp = ospf6_neighbor_cmp;
   oi->linklocal_addr = (struct in6_addr *) NULL;
-  oi->instance_id = 0;
-  oi->transdelay = 1;
-  oi->priority = 1;
-
-  oi->hello_interval = 10;
-  oi->dead_interval = 40;
-  oi->rxmt_interval = 5;
-  oi->cost = 1;
+  oi->instance_id = OSPF6_INTERFACE_INSTANCE_ID;
+  oi->transdelay = OSPF6_INTERFACE_TRANSDELAY;
+  oi->priority = OSPF6_INTERFACE_PRIORITY;
+
+  oi->hello_interval = OSPF6_INTERFACE_HELLO_INTERVAL;
+  oi->dead_interval = OSPF6_INTERFACE_DEAD_INTERVAL;
+  oi->rxmt_interval = OSPF6_INTERFACE_RXMT_INTERVAL;
+  oi->cost = OSPF6_INTERFACE_COST;
   oi->state = OSPF6_INTERFACE_DOWN;
   oi->flag = 0;
   oi->mtu_ignore = 0;
@@ -1522,23 +1522,36 @@ config_write_ospf6_interface (struct vty *vty)
 
       if (ifp->desc)
         vty_out (vty, " description %s%s", ifp->desc, VNL);
-
       if (ifp->mtu6 != oi->ifmtu)
         vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->ifmtu, VNL);
-      vty_out (vty, " ipv6 ospf6 cost %d%s",
-               oi->cost, VNL);
-      vty_out (vty, " ipv6 ospf6 hello-interval %d%s",
-               oi->hello_interval, VNL);
-      vty_out (vty, " ipv6 ospf6 dead-interval %d%s",
-               oi->dead_interval, VNL);
-      vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s",
-               oi->rxmt_interval, VNL);
-      vty_out (vty, " ipv6 ospf6 priority %d%s",
-               oi->priority, VNL);
-      vty_out (vty, " ipv6 ospf6 transmit-delay %d%s",
-               oi->transdelay, VNL);
-      vty_out (vty, " ipv6 ospf6 instance-id %d%s",
-               oi->instance_id, VNL);
+
+      if (oi->cost != OSPF6_INTERFACE_COST)
+        vty_out (vty, " ipv6 ospf6 cost %d%s",
+                 oi->cost, VNL);
+
+      if (oi->hello_interval != OSPF6_INTERFACE_HELLO_INTERVAL)
+        vty_out (vty, " ipv6 ospf6 hello-interval %d%s",
+                 oi->hello_interval, VNL);
+
+      if (oi->dead_interval != OSPF6_INTERFACE_DEAD_INTERVAL)
+        vty_out (vty, " ipv6 ospf6 dead-interval %d%s",
+                 oi->dead_interval, VNL);
+
+      if (oi->rxmt_interval != OSPF6_INTERFACE_RXMT_INTERVAL)
+        vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s",
+                 oi->rxmt_interval, VNL);
+
+      if (oi->priority != OSPF6_INTERFACE_PRIORITY)
+        vty_out (vty, " ipv6 ospf6 priority %d%s",
+                 oi->priority, VNL);
+
+      if (oi->transdelay != OSPF6_INTERFACE_TRANSDELAY)
+        vty_out (vty, " ipv6 ospf6 transmit-delay %d%s",
+                 oi->transdelay, VNL);
+
+      if (oi->instance_id != OSPF6_INTERFACE_INSTANCE_ID)
+        vty_out (vty, " ipv6 ospf6 instance-id %d%s",
+                 oi->instance_id, VNL);
 
       if (oi->plist_name)
         vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s",
index cf758c075218be6e3475fcc8467d4b188879771d..2d1ff34dbede2627b4435f015e507fb219163700 100644 (file)
@@ -124,6 +124,15 @@ extern const char *ospf6_interface_state_str[];
 #define OSPF6_INTERFACE_DISABLE      0x01
 #define OSPF6_INTERFACE_PASSIVE      0x02
 
+/* default values */
+#define OSPF6_INTERFACE_HELLO_INTERVAL 10
+#define OSPF6_INTERFACE_DEAD_INTERVAL  40
+#define OSPF6_INTERFACE_RXMT_INTERVAL  5
+#define OSPF6_INTERFACE_COST           1
+#define OSPF6_INTERFACE_PRIORITY       1
+#define OSPF6_INTERFACE_TRANSDELAY     1
+#define OSPF6_INTERFACE_INSTANCE_ID    0
+
 \f
 /* Function Prototypes */