]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '0aeac9cb7f9887374ce0258c8653f9518529bf08' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 29 Apr 2014 14:17:09 +0000 (16:17 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 29 Apr 2014 14:17:09 +0000 (16:17 +0200)
Conflicts:

configure.in
lib/printf.c
proto/ospf/config.Y
proto/ospf/hello.c
proto/ospf/iface.c
proto/ospf/ospf.h

1  2 
conf/confbase.Y
configure.in
filter/filter.h
lib/printf.c
nest/proto.c
proto/ospf/config.Y
proto/ospf/iface.c
proto/ospf/neighbor.c
sysdep/unix/io.c

diff --cc conf/confbase.Y
Simple merge
diff --cc configure.in
index 3b0f2e323e5faed3ee9927f11c2e6d8a3a332461,9b5dc3e2b499d290001c2b7e3a1f9ed39c328c64..971532e10aa12a38262924f8759d964546b1cc72
@@@ -9,6 -9,9 +9,7 @@@ AC_CONFIG_AUX_DIR(tools
  AC_ARG_ENABLE(debug,  [  --enable-debug          enable internal debugging routines (default: disabled)],,enable_debug=no)
  AC_ARG_ENABLE(memcheck,       [  --enable-memcheck       check memory allocations when debugging (default: enabled)],,enable_memcheck=yes)
  AC_ARG_ENABLE(client, [  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
 -AC_ARG_ENABLE(ipv6,   [  --enable-ipv6           enable building of IPv6 version (default: disabled)],,enable_ipv6=no)
+ AC_ARG_ENABLE(pthreads,       [  --enable-pthreads       enable POSIX threads support (default: detect)],,enable_pthreads=try)
 -AC_ARG_WITH(suffix,   [  --with-suffix=STRING    use specified suffix for BIRD files (default: 6 for IPv6 version)],[given_suffix="yes"])
  AC_ARG_WITH(sysconfig,        [  --with-sysconfig=FILE   use specified BIRD system configuration file])
  AC_ARG_WITH(protocols,        [  --with-protocols=LIST   include specified routing protocols (default: all)],,[with_protocols="all"])
  AC_ARG_WITH(sysinclude,       [  --with-sysinclude=PATH  search for system includes on specified place])
@@@ -42,19 -45,26 +43,13 @@@ AC_SUBST(exedir
  AC_SUBST(srcdir_rel_mf)
  AC_SUBST(runtimedir)
  
- # all_protocols=bfd,bgp,ospf,pipe,radv,rip,static
- all_protocols=pipe,radv,rip,static
 -if test "$enable_ipv6" = yes ; then
 -      ip=ipv6
 -      SUFFIX=6
 -      proto_radv=radv
 -else
 -      ip=ipv4
 -      SUFFIX=""
 -fi
--
- if test "$with_protocols" = all ; then
-       with_protocols="$all_protocols"
 -if test "$given_suffix" = yes ; then
 -      SUFFIX="$with_suffix"
--fi
 -AC_SUBST(SUFFIX)
  
  if test "$enable_debug" = yes ; then
 -      CONFIG_FILE="bird$SUFFIX.conf"
 -      CONTROL_SOCKET="bird$SUFFIX.ctl"
 +      CONFIG_FILE="bird.conf"
 +      CONTROL_SOCKET="bird.ctl"
  else
 -      CONFIG_FILE="\$(sysconfdir)/bird$SUFFIX.conf"
 -      CONTROL_SOCKET="$runtimedir/bird$SUFFIX.ctl"
 +      CONFIG_FILE="\$(sysconfdir)/bird.conf"
 +      CONTROL_SOCKET="$runtimedir/bird.ctl"
  fi
  AC_SUBST(CONFIG_FILE)
  AC_SUBST(CONTROL_SOCKET)
  
  AC_SUBST(iproutedir)
  
 -all_protocols="$proto_bfd bgp ospf pipe $proto_radv rip static"
++# all_protocols="$proto_bfd bgp ospf pipe radv rip static"
++all_protocols="pipe radv rip static"
+ all_protocols=`echo $all_protocols | sed 's/ /,/g'`
+ if test "$with_protocols" = all ; then
+       with_protocols="$all_protocols"
+ fi
  AC_MSG_CHECKING([protocols])
  protocols=`echo "$with_protocols" | sed 's/,/ /g'`
  if test "$protocols" = no ; then protocols= ; fi
diff --cc filter/filter.h
Simple merge
diff --cc lib/printf.c
index 10068192886df211b117210050a58259d35629d0,41e1cc0de651f6cc37d6494b7933d7cbff819ad4..1a6943b96ea2287567e44bcdc54b21d38b6bdc99
@@@ -273,16 -272,11 +273,16 @@@ int bvsnprintf(char *buf, int size, con
  
                /* IP address */
                case 'I':
 +                      ip = va_arg(args, ip_addr);
                        if (flags & SPECIAL)
 -                              ip_ntox(va_arg(args, ip_addr), ipbuf);
 +                              ip6_ntox(ip, ipbuf);
                        else {
 -                              ip_ntop(va_arg(args, ip_addr), ipbuf);
 +                              // XXXX better IPv4 / IPv6 distinction
 +                              if (ipa_is_ip4(ip))
 +                                      ip4_ntop(ipa_to_ip4(ip), ipbuf);
 +                              else
 +                                      ip6_ntop(ipa_to_ip6(ip), ipbuf);
-                               if (field_width > 0)
+                               if (field_width == 1)
                                        field_width = STD_ADDRESS_P_LENGTH;
                        }
                        s = ipbuf;
diff --cc nest/proto.c
Simple merge
index 68d13fb649a2c7604e9862b22603b3c1847dc17e,68efa23077e02bfe1684582ade302886af64450c..defc67edf4beb2194350db6e56d48da76e6d61d0
@@@ -299,7 -309,8 +299,8 @@@ ospf_iface_item
   | TX PRIORITY expr { OSPF_PATT->tx_priority = $3; }
   | TTL SECURITY bool { OSPF_PATT->ttl_security = $3; }
   | TTL SECURITY TX ONLY { OSPF_PATT->ttl_security = 2; }
 - | password_list
+  | BFD bool { OSPF_PATT->bfd = $2; cf_check_bfd($2); }
 + | password_list { ospf_check_auth(); }
   ;
  
  pref_list:
index fcac697e5a318899d9372d69d10affbe181a196d,f1409840933d365cf2db471f0297c0174a98a322..4fa3dcddc4a3641165811a7db3c1cc4846756c1d
@@@ -537,10 -536,11 +537,11 @@@ ospf_iface_new(struct ospf_area *oa, st
    ifa->check_link = ip->check_link;
    ifa->ecmp_weight = ip->ecmp_weight;
    ifa->check_ttl = (ip->ttl_security == 1);
 -
 -#ifdef OSPFv2
+   ifa->bfd = ip->bfd;
    ifa->autype = ip->autype;
    ifa->passwords = ip->passwords;
 +  ifa->instance_id = ip->instance_id;
 +
    ifa->ptp_netmask = addr ? !(addr->flags & IA_PEER) : 0;
    if (ip->ptp_netmask < 2)
      ifa->ptp_netmask = ip->ptp_netmask;
index 8d7abc9518a87ab280adbc91c8a420c6fe8ab3e6,61224ec2da29034837f3dc1c3fa305a8dbf1caef..fad2ce73f94e24e74b46c58d55d1637efc5827ad
@@@ -557,9 -579,39 +557,39 @@@ ospf_neigh_remove(struct ospf_neighbor 
    neigh_chstate(n, NEIGHBOR_DOWN);
    rem_node(NODE n);
    rfree(n->pool);
 -  OSPF_TRACE(D_EVENTS, "Deleting neigbor.");
 +  OSPF_TRACE(D_EVENTS, "Deleting neigbor %R", rid);
  }
  
+ static void
+ ospf_neigh_bfd_hook(struct bfd_request *req)
+ {
+   struct ospf_neighbor *n = req->data;
+   struct proto *p = &n->ifa->oa->po->proto;
+   if (req->down)
+   {
+     OSPF_TRACE(D_EVENTS, "BFD session down for %I on %s",
+              n->ip, n->ifa->iface->name);
+     ospf_neigh_remove(n);
+   }
+ }
+ void
+ ospf_neigh_update_bfd(struct ospf_neighbor *n, int use_bfd)
+ {
+   if (use_bfd && !n->bfd_req)
+     n->bfd_req = bfd_request_session(n->pool, n->ip, n->ifa->addr->ip, n->ifa->iface,
+                                    ospf_neigh_bfd_hook, n);
+   if (!use_bfd && n->bfd_req)
+   {
+     rfree(n->bfd_req);
+     n->bfd_req = NULL;
+   }
+ }
  void
  ospf_sh_neigh_info(struct ospf_neighbor *n)
  {
Simple merge