]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'c93c02088a026b83f452fbd260135ba4c8da7ecf' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Sat, 12 Jan 2013 23:36:29 +0000 (00:36 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sat, 12 Jan 2013 23:36:29 +0000 (00:36 +0100)
1  2 
nest/config.Y
nest/proto.c
nest/protocol.h
nest/route.h
nest/rt-table.c
proto/bgp/attrs.c
proto/ospf/iface.c
proto/ospf/topology.c
sysdep/config.h
sysdep/unix/krt.c

diff --cc nest/config.Y
index 4b9ba84f838590dc2d46536fdd3101b5eb9012d0,cb6a85c2547978744dd6df36adbe54e08c566e0a..c6bb63ccf1e0f00cf3acbdbd0bfcf9285c8a8849
@@@ -44,10 -44,9 +44,10 @@@ CF_DECL
  
  CF_KEYWORDS(ROUTER, ID, PROTOCOL, TEMPLATE, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT)
  CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS)
- CF_KEYWORDS(LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE)
 +CF_KEYWORDS(IPV4, IPVX, VPN4, VPN6, MPLS)
+ CF_KEYWORDS(LIMIT, ACTION, WARN, BLOCK, RESTART, DISABLE, KEEP, FILTERED)
  CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES)
 -CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, MAX, FLUSH)
 +CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE, ROA, AS, MAX, FLUSH)
  CF_KEYWORDS(LISTEN, BGP, V6ONLY, DUAL, ADDRESS, PORT, PASSWORDS, DESCRIPTION, SORTED)
  CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC)
  
@@@ -190,11 -187,8 +190,12 @@@ proto_item
   | EXPORT imexport { this_proto->out_filter = $2; }
   | IMPORT LIMIT limit_spec { this_proto->in_limit = $3; }
   | EXPORT LIMIT limit_spec { this_proto->out_limit = $3; }
 - | TABLE rtable { this_proto->table = $2; }
+  | IMPORT KEEP FILTERED bool { this_proto->in_keep_filtered = $4; }
 + | TABLE rtable {
 +     if (!rt_match($2->addr_type, this_proto->protocol->tables))
 +       cf_error("Incompatible table class");
 +     this_proto->table = $2;
 +   }
   | ROUTER ID idval { this_proto->router_id = $3; }
   | DESCRIPTION TEXT { this_proto->dsc = $2; }
   ;
diff --cc nest/proto.c
Simple merge
diff --cc nest/protocol.h
Simple merge
diff --cc nest/route.h
index ffae8457da5f77e3807403dda916ca10a5787bf3,177baa3858e293b71dfda41aaff727f53e16c15d..4a0d3ddfec4f433d277f47f46aec72aa0a60a2d8
@@@ -241,29 -221,15 +241,37 @@@ typedef struct rte 
  } rte;
  
  #define REF_COW               1               /* Copy this rte on write */
+ #define REF_FILTERED  2               /* Route is rejected by import filter */
+ /* Route is valid for propagation (may depend on other flags in the future), accepts NULL */
+ static inline int rte_is_valid(rte *r) { return r && !(r->flags & REF_FILTERED); }
+ /* Route just has REF_FILTERED flag */
+ static inline int rte_is_filtered(rte *r) { return !!(r->flags & REF_FILTERED); }
  
 +/* Types of routing tables/entries */
 +#define RT_IPV4               1
 +#define RT_IPV6               2
 +#define RT_VPN4               3
 +#define RT_VPN6               4
 +#define RT_MPLS               5
 +
 +#define RT_MAX                6
 +
 +/* Same tables using bit positions. Used for appropriate table linking on protocol init */
 +#define RTB_IPV4      (1 << RT_IPV4)
 +#define RTB_IPV6      (1 << RT_IPV6)
 +#define RTB_VPN4      (1 << RT_VPN4)
 +#define RTB_VPN6      (1 << RT_VPN6)
 +#define RTB_MPLS      (1 << RT_MPLS)
 +
 +#define RTB_IP                (RTB_IPV4 | RTB_IPV6)
 +
 +// XXXX these should probably go away, check their users
 +#define RT_IP         RT_IPV6
 +
 +
  /* Types of route announcement, also used as flags */
  #define RA_OPTIMAL    1               /* Announcement of optimal route change */
  #define RA_ACCEPTED   2               /* Announcement of first accepted route */
diff --cc nest/rt-table.c
index 6a31000ea1ccfed1f6e18bed124b0846cb3fe39f,2f0840f0562c745d2b0aedef4a3fe6d37b72c2a0..e3f23647bad8e3648f2891f1442a0b057e2bce3b
@@@ -2060,15 -2024,20 +2105,20 @@@ rt_show_net(struct cli *c, net *n, stru
    struct announce_hook *a;
    int ok;
  
 -  bsprintf(ia, "%I/%d", n->n.prefix, n->n.pxlen);
 +  fn_print(prefix, sizeof(prefix), &n->n);
-   if (n->routes)
-     d->net_counter++;
    for(e=n->routes; e; e=e->next)
      {
+       if (rte_is_filtered(e) != d->filtered)
+       continue;
        struct ea_list *tmpa;
        struct proto *p0 = e->attrs->proto;
        struct proto *p1 = d->export_protocol;
        struct proto *p2 = d->show_protocol;
 -      if (ia[0])
++      if (prefix[0])
+       d->net_counter++;
        d->rt_counter++;
        ee = e;
        rte_update_lock();              /* We use the update buffer for filtering */
Simple merge
index cfd2219a7f95bb19d75f7740b61d7bcacf6b0bf9,290a86340650792240ff6715fa160be5697b852d..6025d2d1b4885c233fdc53beb5dd31f6384283c8
@@@ -964,44 -1000,19 +964,49 @@@ ospf_ifa_notify3(struct proto *p, unsig
    }
  }
  
 -static struct ospf_iface *
 -ospf_iface_find_by_key(struct ospf_area *oa, struct ifa *a, int iid)
 +
 +static void
 +ospf_ifaces_reconfigure2(struct ospf_area *oa, struct ospf_area_config *nac)
  {
 -  struct ospf_iface *ifa;
 -  WALK_LIST(ifa, oa->po->iface_list)
 -    if ((ifa->addr == a) && (ifa->oa == oa) && (ifa->instance_id == iid) && (ifa->type != OSPF_IT_VLINK))
 -      return ifa;
 +  struct ospf_iface_patt *ip;
 +  struct iface *iface;
 +  struct ifa *a;
  
 -  return NULL;
 +  WALK_LIST(iface, iface_list)
++  {
++    if (! (iface->flags & IF_UP))
++      continue;
++
 +    WALK_LIST(a, iface->addrs)
 +    {
 +      if (a->flags & IA_SECONDARY)
 +      continue;
 +
 +      if (a->scope <= SCOPE_LINK)
 +      continue;
 +
 +      if (ip = ospf_iface_patt_find2(oa->ac, a))
 +      {
 +      /* Main inner loop */
 +      struct ospf_iface *ifa = ospf_iface_find_by_key2(oa, a);
 +      if (ifa)
 +      {
 +        if (ospf_iface_reconfigure(ifa, ip))
 +          continue;
 +
 +        /* Hard restart */
 +        ospf_iface_shutdown(ifa);
 +        ospf_iface_remove(ifa);
 +      }
 +      
 +      ospf_iface_new(oa, a, ip);
 +      }
 +    }
++  }
  }
  
 -void
 -ospf_ifaces_reconfigure(struct ospf_area *oa, struct ospf_area_config *nac)
 +static void
 +ospf_ifaces_reconfigure3(struct ospf_area *oa, struct ospf_area_config *nac)
  {
    struct ospf_iface_patt *ip;
    struct iface *iface;
        ospf_iface_new(oa, a, ip);
        }
      }
+   }
  }
  
 -#endif
 +void
 +ospf_ifaces_reconfigure(struct ospf_area *oa, struct ospf_area_config *nac)
 +{
 +  if (ospf_is_v2(oa->po))
 +    ospf_ifaces_reconfigure2(oa, nac);
 +  else
 +    ospf_ifaces_reconfigure3(oa, nac);
 +}
 +
  
  static void
  ospf_iface_change_mtu(struct proto_ospf *po, struct ospf_iface *ifa)
index ea1e8f1b711697135224e6bb5b4fb5d0ce5350f5,5f4d1d5434a1d0fb22ce91683b6d7599deca7307..cb5b4e96d80713b572e3ed13e5bc67a250b02e16
@@@ -262,8 -255,22 +262,15 @@@ originate_rt2_lsa_body(struct ospf_are
        WALK_LIST(neigh, ifa->neigh_list)
          if (neigh->state == NEIGHBOR_FULL)
          {
-           u32 data = (ifa->addr->flags & IA_PEER) ? ifa->iface_id : ipa_to_u32(ifa->addr->ip);
-           add_rt2_lsa_link(po, LSART_PTP, neigh->rid, data, ifa->cost);
 -          ln = lsab_alloc(po, sizeof(struct ospf_lsa_rt_link));
 -          ln->type = LSART_PTP;
 -          ln->id = neigh->rid;
 -
+           /*
+            * ln->data should be ifa->iface_id in case of no/ptp
+            * address (ifa->addr->flags & IA_PEER) on PTP link (see
+            * RFC 2328 12.4.1.1.), but the iface ID value has no use,
+            * while using IP address even in this case is here for
+            * compatibility with some broken implementations that use
+            * this address as a next-hop.
+            */
 -          ln->data = ipa_to_u32(ifa->addr->ip);
 -
 -          ln->metric = ifa->cost;
 -          ln->padding = 0;
++          add_rt2_lsa_link(po, LSART_PTP, neigh->rid, ipa_to_u32(ifa->addr->ip), ifa->cost);
            i++;
          }
        break;
diff --cc sysdep/config.h
index 76a4af6448061258d33642789950a02c70d02281,e97d9e20fac55d840c18888aa1ef7be8fd67377d..6e446547e0f2cb1c38c7ae9f8a55d90a649da77d
@@@ -7,11 -7,8 +7,11 @@@
  #define _BIRD_CONFIG_H_
  
  /* BIRD version */
- #define BIRD_VERSION "1.3.8"
+ #define BIRD_VERSION "1.3.9"
  
 +// XXXX temporary define
 +#define IPV1 1
 +
  /* Include parameters determined by configure script */
  #include "sysdep/autoconf.h"
  
Simple merge