]> git.puffer.fish Git - mirror/frr.git/commitdiff
Import of zebra.org 20030428-18:07 IST
authorpaul <paul>
Mon, 28 Apr 2003 17:11:02 +0000 (17:11 +0000)
committerpaul <paul>
Mon, 28 Apr 2003 17:11:02 +0000 (17:11 +0000)
bgpd/bgp_nexthop.c
bgpd/bgp_snmp.c
bgpd/bgpd.h
ospf6d/ospf6d.h

index ad932b51fca2a22d224d163ff4a75620a60d8be6..77b024e5ecd6f066f9359f1c4b816be8d80e1eb3 100644 (file)
@@ -1119,9 +1119,11 @@ bgp_import_check (struct prefix *p, u_int32_t *igpmetric, struct in_addr *igpnex
 int
 bgp_import (struct thread *t)
 {
+  struct bgp_master *bm;
   struct bgp *bgp;
   struct bgp_node *rn;
   struct bgp_static *bgp_static;
+  struct listnode *nn;
   int valid;
   u_int32_t metric;
   struct in_addr nexthop;
@@ -1131,49 +1133,52 @@ bgp_import (struct thread *t)
   bgp_import_thread = 
     thread_add_timer (master, bgp_import, NULL, bgp_import_interval);
 
-  bgp = bgp_get_default ();
-  if (! bgp)
+  bm = bgp_get_master ();
+  if (! bm)
     return 0;
 
-  for (afi = AFI_IP; afi < AFI_MAX; afi++)
-    for (safi = SAFI_UNICAST; safi < SAFI_MPLS_VPN; safi++)
-      for (rn = bgp_table_top (bgp->route[afi][safi]); rn;
-          rn = bgp_route_next (rn))
-       if ((bgp_static = rn->info) != NULL)
-         {
-           if (bgp_static->backdoor)
-             continue;
-
-           valid = bgp_static->valid;
-           metric = bgp_static->igpmetric;
-           nexthop = bgp_static->igpnexthop;
-
-           if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK)
-               && afi == AFI_IP && safi == SAFI_UNICAST)
-             bgp_static->valid = bgp_import_check (&rn->p, &bgp_static->igpmetric,
-                                                   &bgp_static->igpnexthop);
-           else
+  LIST_LOOP (bm->bgp, bgp, nn)
+    {
+      for (afi = AFI_IP; afi < AFI_MAX; afi++)
+       for (safi = SAFI_UNICAST; safi < SAFI_MPLS_VPN; safi++)
+         for (rn = bgp_table_top (bgp->route[afi][safi]); rn;
+              rn = bgp_route_next (rn))
+           if ((bgp_static = rn->info) != NULL)
              {
-               bgp_static->valid = 1;
-               bgp_static->igpmetric = 0;
-               bgp_static->igpnexthop.s_addr = 0;
-             }
+               if (bgp_static->backdoor)
+                 continue;
 
-           if (bgp_static->valid != valid)
-             {
-               if (bgp_static->valid)
-                 bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
+               valid = bgp_static->valid;
+               metric = bgp_static->igpmetric;
+               nexthop = bgp_static->igpnexthop;
+
+               if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK)
+                   && afi == AFI_IP && safi == SAFI_UNICAST)
+                 bgp_static->valid = bgp_import_check (&rn->p, &bgp_static->igpmetric,
+                                                       &bgp_static->igpnexthop);
                else
-                 bgp_static_withdraw (bgp, &rn->p, afi, safi);
+                 {
+                   bgp_static->valid = 1;
+                   bgp_static->igpmetric = 0;
+                   bgp_static->igpnexthop.s_addr = 0;
+                 }
+
+               if (bgp_static->valid != valid)
+                 {
+                   if (bgp_static->valid)
+                     bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
+                   else
+                     bgp_static_withdraw (bgp, &rn->p, afi, safi);
+                 }
+               else if (bgp_static->valid)
+                 {
+                   if (bgp_static->igpmetric != metric
+                       || bgp_static->igpnexthop.s_addr != nexthop.s_addr
+                       || bgp_static->rmap.name)
+                     bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
+                 }
              }
-           else if (bgp_static->valid)
-             {
-               if (bgp_static->igpmetric != metric
-                   || bgp_static->igpnexthop.s_addr != nexthop.s_addr
-                   || bgp_static->rmap.name)
-                 bgp_static_update (bgp, &rn->p, bgp_static, afi, safi);
-             }
-         }
+    }
   return 0;
 }
 
@@ -1197,10 +1202,6 @@ zlookup_connect (struct thread *t)
   if (zlookup->sock < 0)
     return -1;
 
-  /* Make BGP import there. */
-  bgp_import_thread = 
-    thread_add_timer (master, bgp_import, NULL, 0);
-
   return 0;
 }
 
@@ -1396,6 +1397,8 @@ bgp_scan_init ()
 
   /* Make BGP scan thread. */
   bgp_scan_thread = thread_add_timer (master, bgp_scan, NULL, bgp_scan_interval);
+  /* Make BGP import there. */
+  bgp_import_thread = thread_add_timer (master, bgp_import, NULL, 0);
 
   install_element (BGP_NODE, &bgp_scan_time_cmd);
   install_element (BGP_NODE, &no_bgp_scan_time_cmd);
index 8104aefbc7bf8e72381525d6d99edc08fd1406d8..598fc3cddc1d24f4edd30094c115ddfa1ce51137 100644 (file)
@@ -829,7 +829,6 @@ bgp4PathAttrTable (struct variable *v, oid name[], size_t *length,
 /* BGP Traps. */
 struct trap_object bgpTrapList[] =
 {
-  {bgpPeerTable, 3, {3, 1, BGPPEERREMOTEADDR}},
   {bgpPeerTable, 3, {3, 1, BGPPEERLASTERROR}},
   {bgpPeerTable, 3, {3, 1, BGPPEERSTATE}}
 };
index e3ac73f161d971226ceed0a7a9582bf2eed6f0de..933516d061fd5d52e0810b5816a05fcfbeef9670 100644 (file)
@@ -691,6 +691,7 @@ void bgp_reset (void);
 void bgp_zclient_reset ();
 int bgp_nexthop_set (union sockunion *, union sockunion *, 
                     struct bgp_nexthop *, struct peer *);
+struct bgp_master *bgp_get_master ();
 struct bgp *bgp_get_default ();
 struct bgp *bgp_lookup (as_t, char *);
 struct bgp *bgp_lookup_by_name (char *);
index 4c9f7dc3e8b4a4d6f9850ec50a7e3fa6b8166cd7..8c7af99e1958d04a94ed6cf4c9263b1054d85026 100644 (file)
@@ -73,7 +73,7 @@
 #define HASHVAL 64
 #define MAXIOVLIST 1024
 
-#define OSPF6_DAEMON_VERSION    "0.9.6o"
+#define OSPF6_DAEMON_VERSION    "0.9.6p"
 
 #define AF_LINKSTATE  0xff