]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '9ff5257357d9975654279db17bbc8525583ba1cc' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Wed, 22 May 2013 21:59:54 +0000 (23:59 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Wed, 22 May 2013 21:59:54 +0000 (23:59 +0200)
Conflicts:

proto/ospf/config.Y

1  2 
proto/ospf/config.Y
proto/ospf/iface.c

index 1ba7725246ba6c514d2d5f4b8e544ab8642fcdf8,b16d46a905bc2a1d5dd3c2591e506bd78bc6c522..3325a5de7e5dc11b80dfab4f1fed1506c0bb4bb0
@@@ -120,7 -135,7 +120,7 @@@ CF_KEYWORDS(GLOBAL, LSID, ROUTER, SELF
  
  %type <t> opttext
  %type <ld> lsadb_args
- %type <i> ospf_proto_key
 -%type <i> nbma_eligible
++%type <i> ospf_proto_key nbma_eligible
  
  CF_GRAMMAR
  
@@@ -286,10 -296,10 +286,10 @@@ ospf_iface_item
   | STUB bool { OSPF_PATT->stub = $2 ; }
   | CHECK LINK bool { OSPF_PATT->check_link = $3; }
   | ECMP WEIGHT expr { OSPF_PATT->ecmp_weight = $3 - 1; if (($3<1) || ($3>256)) cf_error("ECMP weight must be in range 1-256"); }
-  | NEIGHBORS '{' ipa_list '}'
+  | NEIGHBORS '{' nbma_list '}'
 - | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; }
 - | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE ; }
 - | AUTHENTICATION CRYPTOGRAPHIC { OSPF_PATT->autype = OSPF_AUTH_CRYPT ; }
 + | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE; }
 + | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE; ospf_check_auth(); }
 + | AUTHENTICATION CRYPTOGRAPHIC { OSPF_PATT->autype = OSPF_AUTH_CRYPT; ospf_check_auth(); }
   | RX BUFFER LARGE { OSPF_PATT->rxbuf = OSPF_RXBUF_LARGE ; } 
   | RX BUFFER NORMAL { OSPF_PATT->rxbuf = OSPF_RXBUF_NORMAL ; } 
   | RX BUFFER expr { OSPF_PATT->rxbuf = $3 ; if (($3 < OSPF_RXBUF_MINSIZE) || ($3 > OSPF_MAX_PKT_SIZE)) cf_error("Buffer size must be in range 256-65535"); } 
@@@ -318,16 -328,17 +318,17 @@@ pref_opt
   | TAG expr { this_pref->tag = $2; }
   ;
  
ipa_list:
nbma_list:
   /* empty */
-  | ipa_list ipa_item
+  | nbma_list nbma_item
   ;
  
- ipa_item:
-     ipa_el
-   | ipa_ne;
+ nbma_eligible:
+  /* empty */ { $$ = 0; }
+  | ELIGIBLE { $$ = 1; }
+  ;
   
- ipa_el: ipa ';'
 -nbma_item: IPA nbma_eligible ';'
++nbma_item: ipa nbma_eligible ';'
   {
     this_nbma = cfg_allocz(sizeof(struct nbma_node));
     add_tail(&OSPF_PATT->nbma_list, NODE this_nbma);
index 6025d2d1b4885c233fdc53beb5dd31f6384283c8,39084cef04199a2c7797028e8d0958b7847f0834..8613ec8511d21116b581b8cb8431e30cfff99b5c
@@@ -567,8 -574,22 +567,20 @@@ ospf_iface_new(struct ospf_area *oa, st
    init_list(&ifa->nbma_list);
  
    WALK_LIST(nb, ip->nbma_list)
-     if (ipa_in_net(nb->ip, addr->prefix, addr->pxlen))
-       add_nbma_node(ifa, nb, 0);
+   {
+     /* In OSPFv3, addr is link-local while configured neighbors could
+        have global IP (although RFC 5340 C.5 says link-local addresses
+        should be used). Because OSPFv3 iface is not subnet-specific,
+        there is no need for ipa_in_net() check */
 -#ifdef OSPFv2
 -    if (!ipa_in_net(nb->ip, addr->prefix, addr->pxlen))
++    if (ospf_is_v2(po) && !ipa_in_net(nb->ip, addr->prefix, addr->pxlen))
+       continue;
 -#else
 -    if (!ipa_has_link_scope(nb->ip))
++
++    if (ospf_is_v3(po) && !ipa_has_link_scope(nb->ip))
+       log(L_WARN "In OSPFv3, configured neighbor address (%I) should be link-local", nb->ip);
 -#endif
+     add_nbma_node(ifa, nb, 0);
+   }
  
    ifa->state = OSPF_IS_DOWN;
    add_tail(&oa->po->iface_list, NODE ifa);
@@@ -758,9 -785,15 +770,13 @@@ ospf_iface_reconfigure(struct ospf_ifac
    /* NBMA LIST - add new */
    WALK_LIST(nb, new->nbma_list)
    {
-     if (!ipa_in_net(nb->ip, ifa->addr->prefix, ifa->addr->pxlen))
+     /* See related note in ospf_iface_new() */
 -#ifdef OSPFv2
 -    if (!ipa_in_net(nb->ip, ifa->addr->prefix, ifa->addr->pxlen))
++    if (ospf_is_v2(po) && !ipa_in_net(nb->ip, ifa->addr->prefix, ifa->addr->pxlen))
        continue;
 -#else
 -    if (!ipa_has_link_scope(nb->ip))
 +
++    if (ospf_is_v3(po) && !ipa_has_link_scope(nb->ip))
+       log(L_WARN "In OSPFv3, configured neighbor address (%I) should be link-local", nb->ip);
 -#endif
      if (! find_nbma_node(ifa, nb->ip))
      {
        OSPF_TRACE(D_EVENTS, "Adding NBMA neighbor %I on interface %s",