aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2013-12-01 05:25:21 +0800
committermelifaro <melifaro@FreeBSD.org>2013-12-01 05:25:21 +0800
commitd00797a73a34ef70de2171a0770ba0a3d4db7bf7 (patch)
tree3c8fbba86dc37eee9b7d9d229203969ebba1ef68
parentb130364cadb35f62d04a8ae5b6729d23c8494695 (diff)
downloadfreebsd-ports-graphics-d00797a73a34ef70de2171a0770ba0a3d4db7bf7.tar.gz
freebsd-ports-graphics-d00797a73a34ef70de2171a0770ba0a3d4db7bf7.tar.zst
freebsd-ports-graphics-d00797a73a34ef70de2171a0770ba0a3d4db7bf7.zip
Update net/bird,net/bird6 to 1.4.0
Fix simultaneous building for firewall/aggregator protocols. Reviewed by: az
-rw-r--r--net/bird/Makefile20
-rw-r--r--net/bird/distinfo4
-rw-r--r--net/bird/files/agg_support.patch82
-rw-r--r--net/bird/files/firewall_support.patch67
-rw-r--r--net/bird/files/patch-Makefile.in16
-rw-r--r--net/bird/files/patch-bird_addr_select77
-rw-r--r--net/bird/files/patch-netst-proto.c51
-rw-r--r--net/bird/files/patch-proto-ospf-hello.c31
-rw-r--r--net/bird/files/patch-proto-ospf-lsupd.c22
-rw-r--r--net/bird/files/patch-sysdep-bsd-krt-sock.c54
-rw-r--r--net/bird/files/patch-sysdep-unix-main.c118
-rw-r--r--net/bird6/Makefile3
-rw-r--r--net/bird6/distinfo4
-rw-r--r--net/bird6/files/patch-netst-proto.c51
-rw-r--r--net/bird6/files/patch-proto-ospf-lsupd.c22
-rw-r--r--net/bird6/files/patch-sysdep-unix-main.c118
16 files changed, 29 insertions, 711 deletions
diff --git a/net/bird/Makefile b/net/bird/Makefile
index 85c60dee393..c92ec2c927b 100644
--- a/net/bird/Makefile
+++ b/net/bird/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= bird
-PORTVERSION= 1.3.11
-PORTREVISION= 2
+PORTVERSION= 1.4.0
CATEGORIES= net
MASTER_SITES= ftp://bird.network.cz/pub/bird/ \
http://bird.mpls.in/distfiles/bird/
@@ -38,6 +37,23 @@ EXTRA_PATCHES+= ${FILESDIR}/firewall_support.patch
EXTRA_PATCHES+= ${FILESDIR}/agg_support.patch
.endif
+post-patch:
+.if ${PORT_OPTIONS:MAGG}
+ @${REINPLACE_CMD} -e 's/^\(all_protocols=".*\)"/\1 agg"/' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e '/proto_build(&proto_device);/{G;s/$$/ proto_build(\&proto_agg);/;}' ${WRKSRC}/nest/proto.c
+ @${REINPLACE_CMD} -e '/CONFIG_BFD/{G;s/$$/#undef CONFIG_AGG/;}' ${WRKSRC}/sysdep/autoconf.h.in
+ @${REINPLACE_CMD} -e 's/\(proto_bfd\)/\1, proto_agg/' ${WRKSRC}/nest/protocol.h
+.endif
+.if ${PORT_OPTIONS:MFIREWALL}
+ @${REINPLACE_CMD} -e 's/^\(all_protocols=".*\)"/\1 firewall"/' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e '/proto_build(&proto_device);/{G;s/$$/ proto_build(\&proto_firewall);/;}' ${WRKSRC}/nest/proto.c
+ @${REINPLACE_CMD} -e '/CONFIG_PIPE/{G;s/$$/#undef CONFIG_FIREWALL_IPSET/;}' ${WRKSRC}/sysdep/autoconf.h.in
+ @${REINPLACE_CMD} -e '/CONFIG_PIPE/{G;s/$$/#undef CONFIG_FIREWALL_PF/;}' ${WRKSRC}/sysdep/autoconf.h.in
+ @${REINPLACE_CMD} -e '/CONFIG_PIPE/{G;s/$$/#undef CONFIG_FIREWALL_IPFW/;}' ${WRKSRC}/sysdep/autoconf.h.in
+ @${REINPLACE_CMD} -e '/CONFIG_PIPE/{G;s/$$/#undef CONFIG_FIREWALL/;}' ${WRKSRC}/sysdep/autoconf.h.in
+ @${REINPLACE_CMD} -e 's/\(proto_bfd\)/\1, proto_firewall/' ${WRKSRC}/nest/protocol.h
+.endif
+
post-install:
@if [ ! -f ${PREFIX}/etc/bird.conf ]; then \
${CP} -p ${PREFIX}/etc/bird.conf.example ${PREFIX}/etc/bird.conf ; \
diff --git a/net/bird/distinfo b/net/bird/distinfo
index e133f7c6365..abe4022ccdb 100644
--- a/net/bird/distinfo
+++ b/net/bird/distinfo
@@ -1,2 +1,2 @@
-SHA256 (bird-1.3.11.tar.gz) = cad6f58dfd8fef9772d46be3fe51a53420f56ee5fbd79d6993889ae6596a8495
-SIZE (bird-1.3.11.tar.gz) = 1108400
+SHA256 (bird-1.4.0.tar.gz) = da1b41cab26388b01d861c30afe41678df22dc9ea0110a14c1cc7b7bffc693c5
+SIZE (bird-1.4.0.tar.gz) = 1242728
diff --git a/net/bird/files/agg_support.patch b/net/bird/files/agg_support.patch
index 9dd8ca459fa..07781bfb25f 100644
--- a/net/bird/files/agg_support.patch
+++ b/net/bird/files/agg_support.patch
@@ -30,24 +30,6 @@ Subject: [PATCH 1/1] Implement general aggregation protocol, v7
create mode 100644 proto/agg/agg.h
create mode 100644 proto/agg/config.Y
-diff --git a/configure.in b/configure.in
-index dd57ab5..ca9d72d 100644
---- configure.in
-+++ configure.in
-@@ -47,11 +47,11 @@ AC_SUBST(runtimedir)
- if test "$enable_ipv6" = yes ; then
- ip=ipv6
- SUFFIX=6
-- all_protocols=bgp,ospf,pipe,radv,rip,static
-+ all_protocols=bgp,ospf,pipe,radv,rip,static,agg
- else
- ip=ipv4
- SUFFIX=""
-- all_protocols=bgp,ospf,pipe,rip,static
-+ all_protocols=bgp,ospf,pipe,rip,static,agg
- fi
-
- if test "$given_suffix" = yes ; then
diff --git a/doc/bird.conf.example b/doc/bird.conf.example
index 5e07ab5..b48faad 100644
--- doc/bird.conf.example
@@ -159,9 +141,9 @@ diff --git a/filter/filter.h b/filter/filter.h
index 2386fc9..f2a5d06 100644
--- filter/filter.h
+++ filter/filter.h
-@@ -79,11 +79,13 @@ struct f_tree *build_tree(struct f_tree *);
- struct f_tree *find_tree(struct f_tree *t, struct f_val val);
+@@ -80,11 +80,13 @@
int same_tree(struct f_tree *t1, struct f_tree *t2);
+ void tree_format(struct f_tree *t, buffer *buf);
-struct f_trie *f_new_trie(linpool *lp);
-void trie_add_prefix(struct f_trie *t, ip_addr px, int plen, int l, int h);
@@ -170,19 +152,19 @@ index 2386fc9..f2a5d06 100644
int trie_match_prefix(struct f_trie *t, ip_addr px, int plen);
+void *trie_match_longest_prefix(struct f_trie *t, ip_addr px, int plen);
int trie_same(struct f_trie *t1, struct f_trie *t2);
- void trie_print(struct f_trie *t);
+ void trie_format(struct f_trie *t, buffer *buf);
+void trie_walk(struct f_trie *t, void *func, void *data);
void fprefix_get_bounds(struct f_prefix *px, int *l, int *h);
-@@ -186,6 +188,7 @@ struct f_trie
+@@ -204,6 +206,7 @@
{
linpool *lp;
int zero;
+ size_t node_size;
struct f_trie_node root;
};
-
+
diff --git a/filter/trie.c b/filter/trie.c
index 581332c..eba239b 100644
--- filter/trie.c
@@ -385,20 +367,6 @@ index e80f87e..22f22ca 100644
* if_notify - notify instance about interface changes
* @p: protocol instance
* @flags: interface change flags
-diff --git a/nest/proto.c b/nest/proto.c
-index 887d3e5..4ebc9d6 100644
---- nest/proto.c
-+++ nest/proto.c
-@@ -705,6 +705,9 @@ protos_build(void)
- #ifdef CONFIG_BGP
- proto_build(&proto_bgp);
- #endif
-+#ifdef CONFIG_AGG
-+ proto_build(&proto_agg);
-+#endif
- proto_pool = rp_new(&root_pool, "Protocols");
- proto_flush_event = ev_new(proto_pool);
- proto_flush_event->hook = proto_flush_loop;
diff --git a/nest/protocol.h b/nest/protocol.h
index 8a63271..0a0d8f7 100644
--- nest/protocol.h
@@ -427,15 +395,6 @@ index 8a63271..0a0d8f7 100644
};
void protos_build(void);
-@@ -75,7 +83,7 @@ void protos_dump_all(void);
-
- extern struct protocol
- proto_device, proto_radv, proto_rip, proto_static,
-- proto_ospf, proto_pipe, proto_bgp;
-+ proto_ospf, proto_pipe, proto_bgp, proto_agg;
-
- /*
- * Routing Protocol Instance
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 165f42b..f224cc4 100644
--- nest/rt-table.c
@@ -2778,34 +2737,3 @@ index c3adf25..ae62c30 100644
struct rta *bgp_decode_attrs(struct bgp_conn *conn, byte *a, unsigned int len, struct linpool *pool, int mandatory);
int bgp_get_attr(struct eattr *e, byte *buf, int buflen);
int bgp_rte_better(struct rte *, struct rte *);
-diff --git a/sysdep/autoconf.h.in b/sysdep/autoconf.h.in
-index ac6f7a8..4d4dba5 100644
---- sysdep/autoconf.h.in
-+++ sysdep/autoconf.h.in
-@@ -42,6 +42,7 @@
- #undef CONFIG_BGP
- #undef CONFIG_OSPF
- #undef CONFIG_PIPE
-+#undef CONFIG_AGG
-
- /* We have <syslog.h> and syslog() */
- #undef HAVE_SYSLOG
---
-1.7.3.2
-
---- configure.orig 2012-08-07 13:28:04.000000000 +0400
-+++ configure 2012-08-15 15:54:05.000000000 +0400
-@@ -2355,11 +2355,11 @@
- if test "$enable_ipv6" = yes ; then
- ip=ipv6
- SUFFIX=6
-- all_protocols=bgp,ospf,pipe,radv,rip,static
-+ all_protocols=bgp,ospf,pipe,radv,rip,static,agg
- else
- ip=ipv4
- SUFFIX=""
-- all_protocols=bgp,ospf,pipe,rip,static
-+ all_protocols=bgp,ospf,pipe,rip,static,agg
- fi
-
- if test "$given_suffix" = yes ; then
diff --git a/net/bird/files/firewall_support.patch b/net/bird/files/firewall_support.patch
index 025ac48e8e5..35b3528f160 100644
--- a/net/bird/files/firewall_support.patch
+++ b/net/bird/files/firewall_support.patch
@@ -29,15 +29,6 @@ diff --git a/configure.in b/configure.in
index 54993df..51b7cc2 100644
--- configure.in
+++ configure.in
-@@ -51,7 +51,7 @@ if test "$enable_ipv6" = yes ; then
- else
- ip=ipv4
- SUFFIX=""
-- all_protocols=bgp,ospf,pipe,rip,static
-+ all_protocols=bgp,ospf,pipe,rip,static,firewall
- fi
-
- if test "$given_suffix" = yes ; then
@@ -137,10 +137,13 @@ else
ipv4:netbsd*) sysdesc=bsd
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
@@ -105,33 +96,6 @@ index 24bc302..a01ec99 100644
<chapt>Conclusions
<sect>Future work
-diff --git a/nest/proto.c b/nest/proto.c
-index 53d3f1a..78d7600 100644
---- nest/proto.c
-+++ nest/proto.c
-@@ -707,6 +707,9 @@ protos_build(void)
- #ifdef CONFIG_BGP
- proto_build(&proto_bgp);
- #endif
-+#ifdef CONFIG_FIREWALL
-+ proto_build(&proto_firewall);
-+#endif
- proto_pool = rp_new(&root_pool, "Protocols");
- proto_flush_event = ev_new(proto_pool);
- proto_flush_event->hook = proto_flush_loop;
-diff --git a/nest/protocol.h b/nest/protocol.h
-index 11fcb16..c7275d6 100644
---- nest/protocol.h
-+++ nest/protocol.h
-@@ -75,7 +75,7 @@ void protos_dump_all(void);
-
- extern struct protocol
- proto_device, proto_radv, proto_rip, proto_static,
-- proto_ospf, proto_pipe, proto_bgp;
-+ proto_ospf, proto_pipe, proto_bgp, proto_firewall;
-
- /*
- * Routing Protocol Instance
diff --git a/nest/route.h b/nest/route.h
index 524e69b..f3062a2 100644
--- nest/route.h
@@ -512,22 +476,6 @@ index 0000000..c97ed38
+#define FW_ERR(x, y...) log_rl(&rl_fw_err, L_ERR x, ##y)
+
+#endif
-diff --git a/sysdep/autoconf.h.in b/sysdep/autoconf.h.in
-index ac6f7a8..2d5af5c 100644
---- sysdep/autoconf.h.in
-+++ sysdep/autoconf.h.in
-@@ -42,6 +42,11 @@
- #undef CONFIG_BGP
- #undef CONFIG_OSPF
- #undef CONFIG_PIPE
-+#undef CONFIG_FIREWALL
-+
-+#undef CONFIG_FIREWALL_IPFW
-+#undef CONFIG_FIREWALL_PF
-+#undef CONFIG_FIREWALL_IPSET
-
- /* We have <syslog.h> and syslog() */
- #undef HAVE_SYSLOG
diff --git a/sysdep/bsd/Modules b/sysdep/bsd/Modules
index 3729587..0607321 100644
--- sysdep/bsd/Modules
@@ -952,20 +900,6 @@ index 0000000..e841e06
--- configure.orig 2012-08-07 13:28:04.000000000 +0400
+++ configure 2012-08-15 15:54:05.000000000 +0400
-@@ -2355,11 +2355,11 @@
- if test "$enable_ipv6" = yes ; then
- ip=ipv6
- SUFFIX=6
-- all_protocols=bgp,ospf,pipe,radv,rip,static
-+ all_protocols=bgp,ospf,pipe,radv,rip,static,firewall
- else
- ip=ipv4
- SUFFIX=""
-- all_protocols=bgp,ospf,pipe,rip,static
-+ all_protocols=bgp,ospf,pipe,rip,static,firewall
- fi
-
- if test "$given_suffix" = yes ; then
@@ -4361,6 +4361,8 @@
ipv6:freebsd*) sysdesc=bsd-v6
;;
@@ -975,3 +909,4 @@ index 0000000..e841e06
;;
ipv6:dragonfly*) sysdesc=bsd-v6
;;
+
diff --git a/net/bird/files/patch-Makefile.in b/net/bird/files/patch-Makefile.in
deleted file mode 100644
index 25310282571..00000000000
--- a/net/bird/files/patch-Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
---- tools/Makefile.in.orig 2013-08-01 20:04:09.338432694 +0400
-+++ tools/Makefile.in 2013-08-01 20:04:29.477297340 +0400
-@@ -69,10 +69,10 @@
-
- install: all
- $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
-- $(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@
-- $(INSTALL_PROGRAM) -s $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@
-+ $(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@
-+ $(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl@SUFFIX@
- if test -n "@CLIENT@" ; then \
-- $(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ; \
-+ $(INSTALL_PROGRAM) $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ; \
- fi
- if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then \
- $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ; \
diff --git a/net/bird/files/patch-bird_addr_select b/net/bird/files/patch-bird_addr_select
deleted file mode 100644
index 67e066a11f5..00000000000
--- a/net/bird/files/patch-bird_addr_select
+++ /dev/null
@@ -1,77 +0,0 @@
-diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
-index e970d6b..202255e 100644
---- sysdep/bsd/krt-sock.c
-+++ sysdep/bsd/krt-sock.c
-@@ -594,6 +594,45 @@ krt_read_addr(struct ks_msg *msg)
- ifa_delete(&ifa);
- }
-
-+#ifndef IPV6
-+struct ifa *
-+kif_get_primary_ip(struct iface *i)
-+{
-+ struct ifreq ifr;
-+ int fd, res;
-+ struct sockaddr_in *sin;
-+ ip_addr addr = IPA_NONE;
-+ struct ifa *a = NULL;
-+
-+ fd = socket(AF_INET, SOCK_DGRAM, 0);
-+
-+ if (fd == -1)
-+ return NULL;
-+
-+ memset(&ifr, 0, sizeof(ifr));
-+
-+ strcpy(ifr.ifr_name, i->name);
-+
-+ res = ioctl(fd, SIOCGIFADDR, (char *)&ifr);
-+ close(fd);
-+
-+ if (res == -1)
-+ return NULL;
-+
-+ sin = (struct sockaddr_in *)&ifr.ifr_addr;
-+ memcpy(&addr, &sin->sin_addr, sizeof(ip_addr));
-+ ipa_ntoh(addr);
-+
-+ WALK_LIST(a, i->addrs)
-+ {
-+ if (a->ip == addr)
-+ return a;
-+ }
-+
-+ return NULL;
-+}
-+#endif
-+
-
- void
- krt_read_msg(struct proto *p, struct ks_msg *msg, int scan)
-diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
-index 3761ace..1fc4345 100644
---- sysdep/unix/krt.c
-+++ sysdep/unix/krt.c
-@@ -157,6 +157,9 @@ kif_choose_primary(struct iface *i)
- return a;
- }
-
-+ if (a = kif_get_primary_ip(i))
-+ return a;
-+
- return find_preferred_ifa(i, IPA_NONE, IPA_NONE);
- }
-
-diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
-index d6fbf72..3a037e3 100644
---- sysdep/unix/krt.h
-+++ sysdep/unix/krt.h
-@@ -78,6 +78,8 @@ void kif_request_scan(void);
- void krt_got_route(struct krt_proto *p, struct rte *e);
- void krt_got_route_async(struct krt_proto *p, struct rte *e, int new);
-
-+struct ifa *kif_get_primary_ip(struct iface *i);
-+
- /* Values for rte->u.krt_sync.src */
- #define KRT_SRC_UNKNOWN -1 /* Nobody knows */
- #define KRT_SRC_BIRD 0 /* Our route (not passed in async mode) */
diff --git a/net/bird/files/patch-netst-proto.c b/net/bird/files/patch-netst-proto.c
deleted file mode 100644
index c15d6e487d1..00000000000
--- a/net/bird/files/patch-netst-proto.c
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/nest/proto.c b/nest/proto.c
-index 60495aa..140ec94 100644
---- nest/proto.c
-+++ nest/proto.c
-@@ -376,6 +376,7 @@ int proto_reconfig_type; /* Hack to propagate type info to pipe reconfigure hoo
- static int
- proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config *nc, int type)
- {
-+ struct announce_hook *ah = p->main_ahook;
- /* If the protocol is DOWN, we just restart it */
- if (p->proto_state == PS_DOWN)
- return 0;
-@@ -407,14 +408,31 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config
-
- /* Update filters and limits in the main announce hook
- Note that this also resets limit state */
-- if (p->main_ahook)
-+ if (ah)
- {
-- p->main_ahook->in_filter = nc->in_filter;
-- p->main_ahook->out_filter = nc->out_filter;
-- p->main_ahook->rx_limit = nc->rx_limit;
-- p->main_ahook->in_limit = nc->in_limit;
-- p->main_ahook->out_limit = nc->out_limit;
-- p->main_ahook->in_keep_filtered = nc->in_keep_filtered;
-+ ah->in_filter = nc->in_filter;
-+ ah->out_filter = nc->out_filter;
-+ ah->rx_limit = nc->rx_limit;
-+ ah->in_limit = nc->in_limit;
-+ ah->out_limit = nc->out_limit;
-+ ah->in_keep_filtered = nc->in_keep_filtered;
-+
-+ if (p->proto_state == PS_UP) /* Recheck export/import/receive limit */
-+ {
-+ struct proto_stats *stats = ah->stats;
-+ struct proto_limit *l = ah->in_limit;
-+ u32 all_routes = stats->imp_routes + stats->filt_routes;
-+
-+ if (l && (stats->imp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_IN, stats->imp_routes);
-+
-+ l = ah->rx_limit;
-+
-+ if (l && ( all_routes >= l->limit)) proto_notify_limit(ah, l, PLD_RX, all_routes );
-+
-+ l = ah->out_limit;
-+
-+ if (l && ( stats->exp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_OUT, stats->exp_routes);
-+ }
- }
-
- /* Update routes when filters changed. If the protocol in not UP,
diff --git a/net/bird/files/patch-proto-ospf-hello.c b/net/bird/files/patch-proto-ospf-hello.c
deleted file mode 100644
index 253dc872e3b..00000000000
--- a/net/bird/files/patch-proto-ospf-hello.c
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c
-index d5aa1b9..58e87bb 100644
---- proto/ospf/hello.c
-+++ proto/ospf/hello.c
-@@ -101,6 +101,17 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
- return;
- }
-
-+#ifdef OSPFv2
-+ if (n && (n->rid != ntohl(ps_i->routerid)))
-+ {
-+ OSPF_TRACE(D_EVENTS,
-+ "Neighbor %I has changed router id from %R to %R.",
-+ n->ip, n->rid, ntohl(ps_i->routerid));
-+ ospf_neigh_remove(n);
-+ n = NULL;
-+ }
-+#endif
-+
- if (!n)
- {
- if ((ifa->type == OSPF_IT_NBMA) || (ifa->type == OSPF_IT_PTMP))
-@@ -132,7 +143,7 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
-
- n = ospf_neighbor_new(ifa);
-
-- n->rid = ntohl(((struct ospf_packet *) ps)->routerid);
-+ n->rid = ntohl(ps_i->routerid);
- n->ip = faddr;
- n->dr = ntohl(ps->dr);
- n->bdr = ntohl(ps->bdr);
diff --git a/net/bird/files/patch-proto-ospf-lsupd.c b/net/bird/files/patch-proto-ospf-lsupd.c
deleted file mode 100644
index bd25f3ad3bf..00000000000
--- a/net/bird/files/patch-proto-ospf-lsupd.c
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
-index a5da425..b19f261 100644
---- proto/ospf/lsupd.c
-+++ proto/ospf/lsupd.c
-@@ -205,7 +205,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
- en->lsa_body = NULL;
- DBG("Removing from lsreq list for neigh %R\n", nn->rid);
- ospf_hash_delete(nn->lsrqh, en);
-- if (EMPTY_SLIST(nn->lsrql))
-+ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING))
- ospf_neigh_sm(nn, INM_LOADDONE);
- continue;
- break;
-@@ -216,7 +216,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
- en->lsa_body = NULL;
- DBG("Removing from lsreq list for neigh %R\n", nn->rid);
- ospf_hash_delete(nn->lsrqh, en);
-- if (EMPTY_SLIST(nn->lsrql))
-+ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING))
- ospf_neigh_sm(nn, INM_LOADDONE);
- break;
- default:
diff --git a/net/bird/files/patch-sysdep-bsd-krt-sock.c b/net/bird/files/patch-sysdep-bsd-krt-sock.c
deleted file mode 100644
index 3518b1b085b..00000000000
--- a/net/bird/files/patch-sysdep-bsd-krt-sock.c
+++ /dev/null
@@ -1,54 +0,0 @@
-diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
-index 08dfccc..3d30036 100644
---- sysdep/bsd/krt-sock.c
-+++ sysdep/bsd/krt-sock.c
-@@ -676,22 +676,18 @@ krt_read_addr(struct ks_msg *msg)
-
- #ifdef IPV6
- /* Clean up embedded interface ID returned in link-local address */
-+
- if (ipa_has_link_scope(ifa.ip))
- _I0(ifa.ip) = 0xfe800000;
--#endif
-
--#ifdef IPV6
-- /* Why not the same check also for IPv4? */
-- if ((iface->flags & IF_MULTIACCESS) || (masklen != BITS_PER_IP_ADDRESS))
--#else
-- if (iface->flags & IF_MULTIACCESS)
-+ if (ipa_has_link_scope(ifa.brd))
-+ _I0(ifa.brd) = 0xfe800000;
- #endif
-+
-+ if (masklen < BITS_PER_IP_ADDRESS)
- {
- ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen));
-
-- if (masklen == BITS_PER_IP_ADDRESS)
-- ifa.flags |= IA_HOST;
--
- if (masklen == (BITS_PER_IP_ADDRESS - 1))
- ifa.opposite = ipa_opposite_m1(ifa.ip);
-
-@@ -699,11 +695,19 @@ krt_read_addr(struct ks_msg *msg)
- if (masklen == (BITS_PER_IP_ADDRESS - 2))
- ifa.opposite = ipa_opposite_m2(ifa.ip);
- #endif
-+
-+ if (!(iface->flags & IF_MULTIACCESS))
-+ ifa.opposite = ifa.brd;
- }
-- else /* PtP iface */
-+ else if (!(iface->flags & IF_MULTIACCESS) && ipa_nonzero(ifa.brd))
- {
-- ifa.flags |= IA_PEER;
- ifa.prefix = ifa.opposite = ifa.brd;
-+ ifa.flags |= IA_PEER;
-+ }
-+ else
-+ {
-+ ifa.prefix = ifa.ip;
-+ ifa.flags |= IA_HOST;
- }
-
- if (new)
diff --git a/net/bird/files/patch-sysdep-unix-main.c b/net/bird/files/patch-sysdep-unix-main.c
deleted file mode 100644
index 9caea0b791b..00000000000
--- a/net/bird/files/patch-sysdep-unix-main.c
+++ /dev/null
@@ -1,118 +0,0 @@
-diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
-index bd80ba2..c7db7c8 100644
---- sysdep/unix/main.c
-+++ sysdep/unix/main.c
-@@ -473,6 +473,58 @@ cli_init_unix(uid_t use_uid, gid_t use_gid)
- }
-
- /*
-+ * PID file
-+ */
-+
-+static char *pid_file;
-+static int pid_fd;
-+
-+static inline void
-+open_pid_file(void)
-+{
-+ if (!pid_file)
-+ return;
-+
-+ pid_fd = open(pid_file, O_WRONLY|O_CREAT, 0664);
-+ if (pid_fd < 0)
-+ die("Cannot create PID file %s: %m", pid_file);
-+}
-+
-+static inline void
-+write_pid_file(void)
-+{
-+ int pl, rv;
-+ char ps[24];
-+
-+ if (!pid_file)
-+ return;
-+
-+ /* We don't use PID file for uniqueness, so no need for locking */
-+
-+ pl = bsnprintf(ps, sizeof(ps), "%ld\n", (long) getpid());
-+ if (pl < 0)
-+ bug("PID buffer too small");
-+
-+ rv = ftruncate(pid_fd, 0);
-+ if (rv < 0)
-+ die("fruncate: %m");
-+
-+ rv = write(pid_fd, ps, pl);
-+ if(rv < 0)
-+ die("write: %m");
-+
-+ close(pid_fd);
-+}
-+
-+static inline void
-+unlink_pid_file(void)
-+{
-+ if (pid_file)
-+ unlink(pid_file);
-+}
-+
-+
-+/*
- * Shutdown
- */
-
-@@ -496,6 +548,7 @@ async_shutdown(void)
- void
- sysdep_shutdown_done(void)
- {
-+ unlink_pid_file();
- unlink(path_control_socket);
- log_msg(L_FATAL "Shutdown completed");
- exit(0);
-@@ -548,7 +601,7 @@ signal_init(void)
- * Parsing of command-line arguments
- */
-
--static char *opt_list = "c:dD:ps:u:g:";
-+static char *opt_list = "c:dD:ps:P:u:g:";
- static int parse_and_exit;
- char *bird_name;
- static char *use_user;
-@@ -557,7 +610,7 @@ static char *use_group;
- static void
- usage(void)
- {
-- fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-u <user>] [-g <group>]\n", bird_name);
-+ fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-P <pid-file>] [-u <user>] [-g <group>]\n", bird_name);
- exit(1);
- }
-
-@@ -656,6 +709,9 @@ parse_args(int argc, char **argv)
- case 's':
- path_control_socket = optarg;
- break;
-+ case 'P':
-+ pid_file = optarg;
-+ break;
- case 'u':
- use_user = optarg;
- break;
-@@ -709,6 +765,9 @@ main(int argc, char **argv)
- if (use_uid)
- drop_uid(use_uid);
-
-+ if (!parse_and_exit)
-+ open_pid_file();
-+
- protos_build();
- proto_build(&proto_unix_kernel);
- proto_build(&proto_unix_iface);
-@@ -733,6 +792,8 @@ main(int argc, char **argv)
- dup2(0, 2);
- }
-
-+ write_pid_file();
-+
- signal_init();
-
- #ifdef LOCAL_DEBUG
diff --git a/net/bird6/Makefile b/net/bird6/Makefile
index c8170dbd37b..72c564cb7da 100644
--- a/net/bird6/Makefile
+++ b/net/bird6/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= bird6
-PORTVERSION= 1.3.11
-PORTREVISION= 1
+PORTVERSION= 1.4.0
CATEGORIES= net
MASTER_SITES= ftp://bird.network.cz/pub/bird/ \
http://bird.mpls.in/distfiles/bird/
diff --git a/net/bird6/distinfo b/net/bird6/distinfo
index e133f7c6365..abe4022ccdb 100644
--- a/net/bird6/distinfo
+++ b/net/bird6/distinfo
@@ -1,2 +1,2 @@
-SHA256 (bird-1.3.11.tar.gz) = cad6f58dfd8fef9772d46be3fe51a53420f56ee5fbd79d6993889ae6596a8495
-SIZE (bird-1.3.11.tar.gz) = 1108400
+SHA256 (bird-1.4.0.tar.gz) = da1b41cab26388b01d861c30afe41678df22dc9ea0110a14c1cc7b7bffc693c5
+SIZE (bird-1.4.0.tar.gz) = 1242728
diff --git a/net/bird6/files/patch-netst-proto.c b/net/bird6/files/patch-netst-proto.c
deleted file mode 100644
index c15d6e487d1..00000000000
--- a/net/bird6/files/patch-netst-proto.c
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/nest/proto.c b/nest/proto.c
-index 60495aa..140ec94 100644
---- nest/proto.c
-+++ nest/proto.c
-@@ -376,6 +376,7 @@ int proto_reconfig_type; /* Hack to propagate type info to pipe reconfigure hoo
- static int
- proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config *nc, int type)
- {
-+ struct announce_hook *ah = p->main_ahook;
- /* If the protocol is DOWN, we just restart it */
- if (p->proto_state == PS_DOWN)
- return 0;
-@@ -407,14 +408,31 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config
-
- /* Update filters and limits in the main announce hook
- Note that this also resets limit state */
-- if (p->main_ahook)
-+ if (ah)
- {
-- p->main_ahook->in_filter = nc->in_filter;
-- p->main_ahook->out_filter = nc->out_filter;
-- p->main_ahook->rx_limit = nc->rx_limit;
-- p->main_ahook->in_limit = nc->in_limit;
-- p->main_ahook->out_limit = nc->out_limit;
-- p->main_ahook->in_keep_filtered = nc->in_keep_filtered;
-+ ah->in_filter = nc->in_filter;
-+ ah->out_filter = nc->out_filter;
-+ ah->rx_limit = nc->rx_limit;
-+ ah->in_limit = nc->in_limit;
-+ ah->out_limit = nc->out_limit;
-+ ah->in_keep_filtered = nc->in_keep_filtered;
-+
-+ if (p->proto_state == PS_UP) /* Recheck export/import/receive limit */
-+ {
-+ struct proto_stats *stats = ah->stats;
-+ struct proto_limit *l = ah->in_limit;
-+ u32 all_routes = stats->imp_routes + stats->filt_routes;
-+
-+ if (l && (stats->imp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_IN, stats->imp_routes);
-+
-+ l = ah->rx_limit;
-+
-+ if (l && ( all_routes >= l->limit)) proto_notify_limit(ah, l, PLD_RX, all_routes );
-+
-+ l = ah->out_limit;
-+
-+ if (l && ( stats->exp_routes >= l->limit)) proto_notify_limit(ah, l, PLD_OUT, stats->exp_routes);
-+ }
- }
-
- /* Update routes when filters changed. If the protocol in not UP,
diff --git a/net/bird6/files/patch-proto-ospf-lsupd.c b/net/bird6/files/patch-proto-ospf-lsupd.c
deleted file mode 100644
index bd25f3ad3bf..00000000000
--- a/net/bird6/files/patch-proto-ospf-lsupd.c
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
-index a5da425..b19f261 100644
---- proto/ospf/lsupd.c
-+++ proto/ospf/lsupd.c
-@@ -205,7 +205,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
- en->lsa_body = NULL;
- DBG("Removing from lsreq list for neigh %R\n", nn->rid);
- ospf_hash_delete(nn->lsrqh, en);
-- if (EMPTY_SLIST(nn->lsrql))
-+ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING))
- ospf_neigh_sm(nn, INM_LOADDONE);
- continue;
- break;
-@@ -216,7 +216,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
- en->lsa_body = NULL;
- DBG("Removing from lsreq list for neigh %R\n", nn->rid);
- ospf_hash_delete(nn->lsrqh, en);
-- if (EMPTY_SLIST(nn->lsrql))
-+ if ((EMPTY_SLIST(nn->lsrql)) && (nn->state == NEIGHBOR_LOADING))
- ospf_neigh_sm(nn, INM_LOADDONE);
- break;
- default:
diff --git a/net/bird6/files/patch-sysdep-unix-main.c b/net/bird6/files/patch-sysdep-unix-main.c
deleted file mode 100644
index 9caea0b791b..00000000000
--- a/net/bird6/files/patch-sysdep-unix-main.c
+++ /dev/null
@@ -1,118 +0,0 @@
-diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
-index bd80ba2..c7db7c8 100644
---- sysdep/unix/main.c
-+++ sysdep/unix/main.c
-@@ -473,6 +473,58 @@ cli_init_unix(uid_t use_uid, gid_t use_gid)
- }
-
- /*
-+ * PID file
-+ */
-+
-+static char *pid_file;
-+static int pid_fd;
-+
-+static inline void
-+open_pid_file(void)
-+{
-+ if (!pid_file)
-+ return;
-+
-+ pid_fd = open(pid_file, O_WRONLY|O_CREAT, 0664);
-+ if (pid_fd < 0)
-+ die("Cannot create PID file %s: %m", pid_file);
-+}
-+
-+static inline void
-+write_pid_file(void)
-+{
-+ int pl, rv;
-+ char ps[24];
-+
-+ if (!pid_file)
-+ return;
-+
-+ /* We don't use PID file for uniqueness, so no need for locking */
-+
-+ pl = bsnprintf(ps, sizeof(ps), "%ld\n", (long) getpid());
-+ if (pl < 0)
-+ bug("PID buffer too small");
-+
-+ rv = ftruncate(pid_fd, 0);
-+ if (rv < 0)
-+ die("fruncate: %m");
-+
-+ rv = write(pid_fd, ps, pl);
-+ if(rv < 0)
-+ die("write: %m");
-+
-+ close(pid_fd);
-+}
-+
-+static inline void
-+unlink_pid_file(void)
-+{
-+ if (pid_file)
-+ unlink(pid_file);
-+}
-+
-+
-+/*
- * Shutdown
- */
-
-@@ -496,6 +548,7 @@ async_shutdown(void)
- void
- sysdep_shutdown_done(void)
- {
-+ unlink_pid_file();
- unlink(path_control_socket);
- log_msg(L_FATAL "Shutdown completed");
- exit(0);
-@@ -548,7 +601,7 @@ signal_init(void)
- * Parsing of command-line arguments
- */
-
--static char *opt_list = "c:dD:ps:u:g:";
-+static char *opt_list = "c:dD:ps:P:u:g:";
- static int parse_and_exit;
- char *bird_name;
- static char *use_user;
-@@ -557,7 +610,7 @@ static char *use_group;
- static void
- usage(void)
- {
-- fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-u <user>] [-g <group>]\n", bird_name);
-+ fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-P <pid-file>] [-u <user>] [-g <group>]\n", bird_name);
- exit(1);
- }
-
-@@ -656,6 +709,9 @@ parse_args(int argc, char **argv)
- case 's':
- path_control_socket = optarg;
- break;
-+ case 'P':
-+ pid_file = optarg;
-+ break;
- case 'u':
- use_user = optarg;
- break;
-@@ -709,6 +765,9 @@ main(int argc, char **argv)
- if (use_uid)
- drop_uid(use_uid);
-
-+ if (!parse_and_exit)
-+ open_pid_file();
-+
- protos_build();
- proto_build(&proto_unix_kernel);
- proto_build(&proto_unix_iface);
-@@ -733,6 +792,8 @@ main(int argc, char **argv)
- dup2(0, 2);
- }
-
-+ write_pid_file();
-+
- signal_init();
-
- #ifdef LOCAL_DEBUG