From owner-svn-ports-head@FreeBSD.ORG Mon Dec 24 12:41:38 2012 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D827A48; Mon, 24 Dec 2012 12:41:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 106588FC0A; Mon, 24 Dec 2012 12:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBOCfcr6005979; Mon, 24 Dec 2012 12:41:38 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBOCfaZ1005969; Mon, 24 Dec 2012 12:41:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201212241241.qBOCfaZ1005969@svn.freebsd.org> From: Hiroki Sato Date: Mon, 24 Dec 2012 12:41:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r309456 - in head/net/openbgpd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2012 12:41:38 -0000 Author: hrs Date: Mon Dec 24 12:41:36 2012 New Revision: 309456 URL: http://svnweb.freebsd.org/changeset/ports/309456 Log: Update to 5.2.201201209. Modified: head/net/openbgpd/Makefile head/net/openbgpd/files/patch-bgpctl_bgpctl.c head/net/openbgpd/files/patch-bgpd_bgpd.c head/net/openbgpd/files/patch-bgpd_bgpd.conf.5 head/net/openbgpd/files/patch-bgpd_bgpd.h head/net/openbgpd/files/patch-bgpd_buffer.c head/net/openbgpd/files/patch-bgpd_carp.c head/net/openbgpd/files/patch-bgpd_kroute.c head/net/openbgpd/files/patch-bgpd_mrt.c head/net/openbgpd/files/patch-bgpd_parse.y head/net/openbgpd/files/patch-bgpd_printconf.c head/net/openbgpd/files/patch-bgpd_rde.h head/net/openbgpd/files/patch-bgpd_rde_filter.c head/net/openbgpd/files/patch-bgpd_session.c head/net/openbgpd/files/patch-openbsd-compat_imsg-buffer.c head/net/openbgpd/files/patch-openbsd-compat_imsg.c head/net/openbgpd/files/patch-openbsd-compat_imsg.h Modified: head/net/openbgpd/Makefile ============================================================================== --- head/net/openbgpd/Makefile Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/Makefile Mon Dec 24 12:41:36 2012 (r309456) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= openbgpd -PORTVERSION= 5.2.20121014 +PORTVERSION= 5.2.20121209 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_OPENBSD} MASTER_SITE_SUBDIR= OpenBGPD Modified: head/net/openbgpd/files/patch-bgpctl_bgpctl.c ============================================================================== --- head/net/openbgpd/files/patch-bgpctl_bgpctl.c Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/files/patch-bgpctl_bgpctl.c Mon Dec 24 12:41:36 2012 (r309456) @@ -2,12 +2,13 @@ Index: bgpctl/bgpctl.c =================================================================== RCS file: /home/cvs/private/hrs/openbgpd/bgpctl/bgpctl.c,v retrieving revision 1.1.1.7 -diff -u -p -r1.1.1.7 bgpctl.c +retrieving revision 1.10 +diff -u -p -r1.1.1.7 -r1.10 --- bgpctl/bgpctl.c 14 Feb 2010 20:20:14 -0000 1.1.1.7 -+++ bgpctl/bgpctl.c 13 Oct 2012 18:49:31 -0000 ++++ bgpctl/bgpctl.c 8 Dec 2012 20:17:55 -0000 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.142 2009/06/06 06:33:15 eric Exp $ */ -+/* $OpenBSD: bgpctl.c,v 1.165 2012/09/12 05:57:10 claudio Exp $ */ ++/* $OpenBSD: bgpctl.c,v 1.167 2012/11/15 19:55:08 sthen Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -391,7 +392,7 @@ diff -u -p -r1.1.1.7 bgpctl.c p->conf.remote_masklen != 128)) { if (asprintf(&s, "%s/%u", log_addr(&p->conf.remote_addr), -@@ -549,6 +643,10 @@ show_neighbor_msg(struct imsg *imsg, enu +@@ -549,9 +643,20 @@ show_neighbor_msg(struct imsg *imsg, enu printf(", Template"); if (p->conf.cloned) printf(", Cloned"); @@ -402,7 +403,17 @@ diff -u -p -r1.1.1.7 bgpctl.c printf("\n"); if (p->conf.descr[0]) printf(" Description: %s\n", p->conf.descr); -@@ -563,22 +661,24 @@ show_neighbor_msg(struct imsg *imsg, enu ++ if (p->conf.max_prefix) { ++ printf(" Max-prefix: %u", p->conf.max_prefix); ++ if (p->conf.max_prefix_restart) ++ printf(" (restart %u)", ++ p->conf.max_prefix_restart); ++ printf("\n"); ++ } + printf(" BGP version 4, remote router-id %s\n", + inet_ntoa(ina)); + printf(" BGP state = %s", statenames[p->state]); +@@ -563,22 +668,24 @@ show_neighbor_msg(struct imsg *imsg, enu printf(" Last read %s, holdtime %us, keepalive interval %us\n", fmt_timeframe(p->stats.last_read), p->holdtime, p->holdtime/3); @@ -439,7 +450,7 @@ diff -u -p -r1.1.1.7 bgpctl.c if (p->capa.peer.as4byte) printf(" 4-byte AS numbers\n"); } -@@ -633,20 +733,38 @@ show_neighbor_msg(struct imsg *imsg, enu +@@ -633,20 +740,38 @@ show_neighbor_msg(struct imsg *imsg, enu } void @@ -491,7 +502,7 @@ diff -u -p -r1.1.1.7 bgpctl.c } void -@@ -654,17 +772,17 @@ print_neighbor_msgstats(struct peer *p) +@@ -654,17 +779,17 @@ print_neighbor_msgstats(struct peer *p) { printf(" Message statistics:\n"); printf(" %-15s %-10s %-10s\n", "", "Sent", "Received"); @@ -515,7 +526,7 @@ diff -u -p -r1.1.1.7 bgpctl.c p->stats.msg_sent_open + p->stats.msg_sent_notification + p->stats.msg_sent_update + p->stats.msg_sent_keepalive + p->stats.msg_sent_rrefresh, -@@ -673,14 +791,16 @@ print_neighbor_msgstats(struct peer *p) +@@ -673,14 +798,16 @@ print_neighbor_msgstats(struct peer *p) p->stats.msg_rcvd_rrefresh); printf(" Update statistics:\n"); printf(" %-15s %-10s %-10s\n", "", "Sent", "Received"); @@ -535,7 +546,7 @@ diff -u -p -r1.1.1.7 bgpctl.c { printf(" %-20s ", name); -@@ -745,6 +865,12 @@ show_fib_head(void) +@@ -745,6 +872,12 @@ show_fib_head(void) } void @@ -548,7 +559,7 @@ diff -u -p -r1.1.1.7 bgpctl.c show_network_head(void) { printf("flags: S = Static\n"); -@@ -788,56 +914,44 @@ show_fib_flags(u_int16_t flags) +@@ -788,56 +921,44 @@ show_fib_flags(u_int16_t flags) int show_fib_msg(struct imsg *imsg) { @@ -597,10 +608,10 @@ diff -u -p -r1.1.1.7 bgpctl.c + if (imsg->hdr.len < IMSG_HEADER_SIZE + sizeof(*kt)) errx(1, "wrong imsg len"); - k6 = imsg->data; +- +- show_fib_flags(k6->flags); + kt = imsg->data; -- show_fib_flags(k6->flags); -- - if (asprintf(&p, "%s/%u", log_in6addr(&k6->prefix), - k6->prefixlen) == -1) - err(1, NULL); @@ -623,7 +634,7 @@ diff -u -p -r1.1.1.7 bgpctl.c default: break; } -@@ -848,35 +962,70 @@ show_fib_msg(struct imsg *imsg) +@@ -848,35 +969,70 @@ show_fib_msg(struct imsg *imsg) void show_nexthop_head(void) { @@ -712,7 +723,7 @@ diff -u -p -r1.1.1.7 bgpctl.c } printf("\n"); break; -@@ -898,9 +1047,8 @@ show_interface_head(void) +@@ -898,9 +1054,8 @@ show_interface_head(void) "Link state"); } @@ -724,7 +735,7 @@ diff -u -p -r1.1.1.7 bgpctl.c const struct ifmedia_description ifm_type_descriptions[] = IFM_TYPE_DESCRIPTIONS; -@@ -936,36 +1084,36 @@ get_media_descr(int media_type) +@@ -936,36 +1091,36 @@ get_media_descr(int media_type) const char * get_linkstate(int media_type, int link_state) { @@ -783,7 +794,7 @@ diff -u -p -r1.1.1.7 bgpctl.c } int -@@ -982,17 +1130,12 @@ show_interface_msg(struct imsg *imsg) +@@ -982,17 +1137,12 @@ show_interface_msg(struct imsg *imsg) printf("%-15s", k->flags & IFF_UP ? "UP" : ""); if ((ifms_type = ift2ifm(k->media_type)) != 0) @@ -806,7 +817,7 @@ diff -u -p -r1.1.1.7 bgpctl.c printf("\n"); break; case IMSG_CTL_END: -@@ -1008,10 +1151,10 @@ show_interface_msg(struct imsg *imsg) +@@ -1008,10 +1158,10 @@ show_interface_msg(struct imsg *imsg) void show_rib_summary_head(void) { @@ -820,7 +831,7 @@ diff -u -p -r1.1.1.7 bgpctl.c "gateway", "lpref", "med", "aspath origin"); } -@@ -1049,26 +1192,30 @@ print_flags(u_int8_t flags, int sum) +@@ -1049,26 +1199,30 @@ print_flags(u_int8_t flags, int sum) char *p = flagstr; if (sum) { @@ -859,7 +870,7 @@ diff -u -p -r1.1.1.7 bgpctl.c printf(", announced"); } } -@@ -1077,27 +1224,14 @@ int +@@ -1077,27 +1231,14 @@ int show_rib_summary_msg(struct imsg *imsg) { struct ctl_show_rib rib; @@ -888,7 +899,7 @@ diff -u -p -r1.1.1.7 bgpctl.c break; case IMSG_CTL_END: return (1); -@@ -1112,108 +1246,21 @@ int +@@ -1112,108 +1253,21 @@ int show_rib_detail_msg(struct imsg *imsg, int nodescr) { struct ctl_show_rib rib; @@ -1003,7 +1014,7 @@ diff -u -p -r1.1.1.7 bgpctl.c break; case IMSG_CTL_END: printf("\n"); -@@ -1225,67 +1272,128 @@ show_rib_detail_msg(struct imsg *imsg, i +@@ -1225,67 +1279,128 @@ show_rib_detail_msg(struct imsg *imsg, i return (0); } @@ -1182,7 +1193,7 @@ diff -u -p -r1.1.1.7 bgpctl.c } void -@@ -1328,30 +1436,6 @@ show_community(u_char *data, u_int16_t l +@@ -1328,30 +1443,6 @@ show_community(u_char *data, u_int16_t l } } @@ -1213,7 +1224,7 @@ diff -u -p -r1.1.1.7 bgpctl.c void show_ext_community(u_char *data, u_int16_t len) { -@@ -1372,34 +1456,101 @@ show_ext_community(u_char *data, u_int16 +@@ -1372,34 +1463,101 @@ show_ext_community(u_char *data, u_int16 case EXT_COMMUNITY_TWO_AS: memcpy(&as2, data + i + 2, sizeof(as2)); memcpy(&u32, data + i + 4, sizeof(u32)); @@ -1322,7 +1333,7 @@ diff -u -p -r1.1.1.7 bgpctl.c void send_filterset(struct imsgbuf *i, struct filter_set_head *set) { -@@ -1469,6 +1620,183 @@ show_result(struct imsg *imsg) +@@ -1469,6 +1627,183 @@ show_result(struct imsg *imsg) return (1); } @@ -1506,7 +1517,7 @@ diff -u -p -r1.1.1.7 bgpctl.c /* following functions are necessary for imsg framework */ void log_warnx(const char *emsg, ...) -@@ -1495,3 +1823,9 @@ fatal(const char *emsg) +@@ -1495,3 +1830,9 @@ fatal(const char *emsg) { err(1, emsg); } Modified: head/net/openbgpd/files/patch-bgpd_bgpd.c ============================================================================== --- head/net/openbgpd/files/patch-bgpd_bgpd.c Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/files/patch-bgpd_bgpd.c Mon Dec 24 12:41:36 2012 (r309456) @@ -2,13 +2,13 @@ Index: bgpd/bgpd.c =================================================================== RCS file: /home/cvs/private/hrs/openbgpd/bgpd/bgpd.c,v retrieving revision 1.1.1.7 -retrieving revision 1.1.1.11 -diff -u -p -r1.1.1.7 -r1.1.1.11 +retrieving revision 1.1.1.12 +diff -u -p -r1.1.1.7 -r1.1.1.12 --- bgpd/bgpd.c 14 Feb 2010 20:19:57 -0000 1.1.1.7 -+++ bgpd/bgpd.c 13 Oct 2012 18:22:38 -0000 1.1.1.11 ++++ bgpd/bgpd.c 8 Dec 2012 10:37:08 -0000 1.1.1.12 @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.148 2009/06/07 00:30:23 claudio Exp $ */ -+/* $OpenBSD: bgpd.c,v 1.168 2011/08/20 19:02:28 sthen Exp $ */ ++/* $OpenBSD: bgpd.c,v 1.169 2012/09/18 09:45:51 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -264,7 +264,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 log_info("Terminating"); return (0); -@@ -452,27 +414,32 @@ send_filterset(struct imsgbuf *i, struct +@@ -452,27 +414,33 @@ send_filterset(struct imsgbuf *i, struct int reconfigure(char *conffile, struct bgpd_config *conf, struct mrt_head *mrt_l, @@ -293,6 +293,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 + &rdom_l)) { log_warnx("config file %s has errors, not reloading", conffile); ++ reconfpending = 0; return (1); } @@ -305,7 +306,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 prepare_listeners(conf); /* start reconfiguration */ -@@ -483,12 +450,6 @@ reconfigure(char *conffile, struct bgpd_ +@@ -483,12 +451,6 @@ reconfigure(char *conffile, struct bgpd_ conf, sizeof(struct bgpd_config)) == -1) return (-1); @@ -318,7 +319,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 TAILQ_FOREACH(la, conf->listen_addrs, entry) { if (imsg_compose(ibuf_se, IMSG_RECONF_LISTENER, 0, 0, la->fd, la, sizeof(struct listen_addr)) == -1) -@@ -496,51 +457,104 @@ reconfigure(char *conffile, struct bgpd_ +@@ -496,51 +458,104 @@ reconfigure(char *conffile, struct bgpd_ la->fd = -1; } @@ -440,7 +441,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 /* mrt changes can be sent out of bound */ mrt_reconfigure(mrt_l); return (0); -@@ -550,8 +564,8 @@ int +@@ -550,8 +565,8 @@ int dispatch_imsg(struct imsgbuf *ibuf, int idx) { struct imsg imsg; @@ -451,7 +452,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 if ((n = imsg_read(ibuf)) == -1) return (-1); -@@ -573,46 +587,39 @@ dispatch_imsg(struct imsgbuf *ibuf, int +@@ -573,46 +588,39 @@ dispatch_imsg(struct imsgbuf *ibuf, int case IMSG_KROUTE_CHANGE: if (idx != PFD_PIPE_ROUTE) log_warnx("route request not from RDE"); @@ -516,7 +517,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 break; case IMSG_PFTABLE_ADD: if (idx != PFD_PIPE_ROUTE) -@@ -646,26 +653,28 @@ dispatch_imsg(struct imsgbuf *ibuf, int +@@ -646,26 +654,28 @@ dispatch_imsg(struct imsgbuf *ibuf, int case IMSG_CTL_RELOAD: if (idx != PFD_PIPE_SESSION) log_warnx("reload request not from SE"); @@ -548,7 +549,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 if (idx != PFD_PIPE_SESSION) log_warnx("kroute request not from SE"); else -@@ -692,6 +701,16 @@ dispatch_imsg(struct imsgbuf *ibuf, int +@@ -692,6 +702,16 @@ dispatch_imsg(struct imsgbuf *ibuf, int carp_demote_set(msg->demote_group, msg->level); } break; @@ -565,7 +566,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 default: break; } -@@ -707,7 +726,7 @@ send_nexthop_update(struct kroute_nextho +@@ -707,7 +727,7 @@ send_nexthop_update(struct kroute_nextho { char *gw = NULL; @@ -574,7 +575,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 if (asprintf(&gw, ": via %s", log_addr(&msg->gateway)) == -1) { log_warn("send_nexthop_update"); -@@ -717,7 +736,7 @@ send_nexthop_update(struct kroute_nextho +@@ -717,7 +737,7 @@ send_nexthop_update(struct kroute_nextho log_info("nexthop %s now %s%s%s", log_addr(&msg->nexthop), msg->valid ? "valid" : "invalid", msg->connected ? ": directly connected" : "", @@ -583,7 +584,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 free(gw); -@@ -733,56 +752,20 @@ send_imsg_session(int type, pid_t pid, v +@@ -733,56 +753,20 @@ send_imsg_session(int type, pid_t pid, v } int @@ -644,7 +645,7 @@ diff -u -p -r1.1.1.7 -r1.1.1.11 } int -@@ -810,3 +793,45 @@ bgpd_filternexthop(struct kroute *kr, st +@@ -810,3 +794,45 @@ bgpd_filternexthop(struct kroute *kr, st return (1); } Modified: head/net/openbgpd/files/patch-bgpd_bgpd.conf.5 ============================================================================== --- head/net/openbgpd/files/patch-bgpd_bgpd.conf.5 Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/files/patch-bgpd_bgpd.conf.5 Mon Dec 24 12:41:36 2012 (r309456) @@ -2,13 +2,13 @@ Index: bgpd/bgpd.conf.5 =================================================================== RCS file: /home/cvs/private/hrs/openbgpd/bgpd/bgpd.conf.5,v retrieving revision 1.1.1.7 -retrieving revision 1.9 -diff -u -p -r1.1.1.7 -r1.9 +retrieving revision 1.10 +diff -u -p -r1.1.1.7 -r1.10 --- bgpd/bgpd.conf.5 14 Feb 2010 20:19:57 -0000 1.1.1.7 -+++ bgpd/bgpd.conf.5 13 Oct 2012 18:36:00 -0000 1.9 ++++ bgpd/bgpd.conf.5 8 Dec 2012 20:17:59 -0000 1.10 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpd.conf.5,v 1.94 2009/06/07 00:31:22 claudio Exp $ -+.\" $OpenBSD: bgpd.conf.5,v 1.120 2012/07/07 08:22:57 claudio Exp $ ++.\" $OpenBSD: bgpd.conf.5,v 1.122 2012/11/13 09:47:20 claudio Exp $ .\" .\" Copyright (c) 2004 Claudio Jeker .\" Copyright (c) 2003, 2004 Henning Brauer @@ -17,7 +17,7 @@ diff -u -p -r1.1.1.7 -r1.9 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 7 2009 $ -+.Dd $Mdocdate: July 7 2012 $ ++.Dd $Mdocdate: November 13 2012 $ .Dt BGPD.CONF 5 .Os .Sh NAME @@ -249,7 +249,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc If set to .Ic yes , -@@ -376,6 +409,111 @@ to EBGP neighbors are not prepended with +@@ -376,6 +409,110 @@ to EBGP neighbors are not prepended with The default is .Ic no . .El @@ -356,12 +356,11 @@ diff -u -p -r1.1.1.7 -r1.9 +Whereas +.Ar local +can be chosen by the local operator. -+.Pp +.El .Sh NEIGHBORS AND GROUPS .Xr bgpd 8 establishes TCP connections to other BGP speakers called -@@ -470,21 +608,35 @@ The default for IBGP peers is +@@ -470,21 +607,35 @@ The default for IBGP peers is .Pp .It Xo .Ic announce @@ -403,7 +402,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc If set to .Ic no , -@@ -493,6 +645,29 @@ This can be helpful to connect to old or +@@ -493,6 +644,29 @@ This can be helpful to connect to old or The default is .Ic yes . .Pp @@ -433,7 +432,7 @@ diff -u -p -r1.1.1.7 -r1.9 .It Ic demote Ar group Increase the .Xr carp 4 -@@ -504,7 +679,7 @@ The demotion counter will be increased a +@@ -504,7 +678,7 @@ The demotion counter will be increased a .Xr bgpd 8 starts and decreased 60 seconds after the session went to state @@ -442,7 +441,7 @@ diff -u -p -r1.1.1.7 -r1.9 For neighbors added at runtime, the demotion counter is only increased after the session has been .Em ESTABLISHED -@@ -548,8 +723,8 @@ Do not start the session when bgpd comes +@@ -548,8 +722,8 @@ Do not start the session when bgpd comes .Pp .It Xo .Ic dump @@ -453,7 +452,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ar file Op Ar timeout .Xc Do a peer specific MRT dump. -@@ -564,7 +739,7 @@ section in +@@ -564,7 +738,7 @@ section in .Pp .It Xo .Ic enforce neighbor-as @@ -462,7 +461,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc If set to .Ic yes , -@@ -589,10 +764,16 @@ Inherited from the global configuration +@@ -589,10 +763,16 @@ Inherited from the global configuration Set the minimal acceptable holdtime. Inherited from the global configuration if not given. .Pp @@ -481,7 +480,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ic spi Ar spi-number authspec Op Ar encspec .Xc Enable IPsec with static keying. -@@ -627,7 +808,7 @@ Keys must be given in hexadecimal format +@@ -627,7 +807,7 @@ Keys must be given in hexadecimal format .Pp .It Xo .Ic ipsec @@ -490,7 +489,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ic ike .Xc Enable IPsec with dynamic keying. -@@ -639,11 +820,11 @@ is responsible for managing the session +@@ -639,11 +819,11 @@ is responsible for managing the session With .Xr isakmpd 8 , it is sufficient to copy the peer's public key, found in @@ -504,7 +503,7 @@ diff -u -p -r1.1.1.7 -r1.9 The local public key must be copied to the peer in the same way. As .Xr bgpd 8 -@@ -698,11 +879,11 @@ Do not attempt to actively open a TCP co +@@ -698,11 +878,11 @@ Do not attempt to actively open a TCP co .It Ic remote-as Ar as-number Set the AS number of the remote system. .Pp @@ -518,7 +517,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Em route-reflector for this neighbor. An optional cluster ID can be specified; otherwise the BGP ID will be used. -@@ -732,8 +913,8 @@ These sets are rewritten into filter rul +@@ -732,8 +912,8 @@ These sets are rewritten into filter rul .Pp .It Xo .Ic softreconfig @@ -529,7 +528,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc Turn soft reconfiguration on or off for the specified direction. If soft reconfiguration is turned on, filter changes will be applied on -@@ -760,7 +941,7 @@ tcp md5sig key deadbeef +@@ -760,7 +940,7 @@ tcp md5sig key deadbeef .Pp .It Xo .Ic transparent-as @@ -538,7 +537,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc If set to .Ic yes , -@@ -772,7 +953,7 @@ setting. +@@ -772,7 +952,7 @@ setting. .Pp .It Xo .Ic ttl-security @@ -547,7 +546,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Xc Enable or disable ttl-security. When enabled, -@@ -849,6 +1030,10 @@ is matched against a part of the +@@ -849,6 +1029,10 @@ is matched against a part of the .Em AS path specified by the .Ar as-type . @@ -558,7 +557,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ar as-type is one of the following operators: .Pp -@@ -917,7 +1102,32 @@ may be set to +@@ -917,7 +1101,32 @@ may be set to which is expanded to the current neighbor remote AS number. .Pp .It Xo @@ -592,7 +591,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ar peer .Xc This rule applies only to -@@ -945,7 +1155,7 @@ if enclosed in curly brackets: +@@ -945,7 +1154,7 @@ if enclosed in curly brackets: deny from { 128.251.16.1, 251.128.16.2, group hojo } .Ed .Pp @@ -601,7 +600,7 @@ diff -u -p -r1.1.1.7 -r1.9 This rule applies only to routes matching the stated address family. The address family needs to be set only in rules that use .Ic prefixlen -@@ -953,6 +1163,24 @@ without specifying a +@@ -953,6 +1162,37 @@ without specifying a .Ic prefix beforehand. .Pp @@ -623,10 +622,23 @@ diff -u -p -r1.1.1.7 -r1.9 +.Ar len +times. +.Pp ++.It Ic nexthop Ar address ++This rule applies only to ++.Em UPDATES ++where the nexthop is equal to ++.Ar address . ++The ++.Ar address ++can be set to ++.Em neighbor ++in which case the nexthop is compared against the address of the neighbor. ++Nexthop filtering is not supported on locally announced networks and one must ++take into consideration previous rules overwriting nexthops. ++.Pp .It Xo .Ic prefix .Ar address Ns Li / Ns Ar len -@@ -1028,6 +1256,12 @@ matches a rule which has the +@@ -1028,6 +1268,12 @@ matches a rule which has the option set, this rule is considered the last matching rule, and evaluation of subsequent rules is skipped. .Pp @@ -639,7 +651,7 @@ diff -u -p -r1.1.1.7 -r1.9 .It Ic set Ar attribute ... All matching rules can set the .Em AS path attributes -@@ -1079,6 +1313,48 @@ Alternately, well-known communities may +@@ -1079,6 +1325,48 @@ Alternately, well-known communities may or .Ic NO_PEER . .Pp @@ -688,7 +700,7 @@ diff -u -p -r1.1.1.7 -r1.9 .It Ic localpref Ar number Set the .Em LOCAL_PREF -@@ -1108,6 +1384,20 @@ otherwise it will be set to +@@ -1108,6 +1396,20 @@ otherwise it will be set to .Ar number . .Pp .It Xo @@ -709,7 +721,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Ic nexthop .Sm off .Po Ar address \*(Ba -@@ -1157,9 +1447,8 @@ times to the +@@ -1157,9 +1459,8 @@ times to the .Em AS path . .Pp .It Ic rtlabel Ar label @@ -721,7 +733,7 @@ diff -u -p -r1.1.1.7 -r1.9 .Pp .It Ic weight Ar number The -@@ -1181,8 +1470,8 @@ For prefixes with equally long paths, th +@@ -1181,8 +1482,8 @@ For prefixes with equally long paths, th is selected. .El .Sh FILES Modified: head/net/openbgpd/files/patch-bgpd_bgpd.h ============================================================================== --- head/net/openbgpd/files/patch-bgpd_bgpd.h Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/files/patch-bgpd_bgpd.h Mon Dec 24 12:41:36 2012 (r309456) @@ -2,13 +2,13 @@ Index: bgpd/bgpd.h =================================================================== RCS file: /home/cvs/private/hrs/openbgpd/bgpd/bgpd.h,v retrieving revision 1.1.1.8 -retrieving revision 1.13 -diff -u -p -r1.1.1.8 -r1.13 +retrieving revision 1.14 +diff -u -p -r1.1.1.8 -r1.14 --- bgpd/bgpd.h 14 Feb 2010 20:19:57 -0000 1.1.1.8 -+++ bgpd/bgpd.h 13 Oct 2012 18:36:00 -0000 1.13 ++++ bgpd/bgpd.h 8 Dec 2012 20:17:59 -0000 1.14 @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.241 2009/06/12 16:42:53 claudio Exp $ */ -+/* $OpenBSD: bgpd.h,v 1.272 2012/09/18 09:45:51 claudio Exp $ */ ++/* $OpenBSD: bgpd.h,v 1.273 2012/09/18 10:10:00 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -463,13 +463,13 @@ diff -u -p -r1.1.1.8 -r1.13 u_int32_t as; + u_int16_t flags; + enum as_spec type; -+}; -+ + }; + +struct filter_aslen { + u_int aslen; + enum aslen_spec type; - }; - ++}; ++ +#define AS_FLAG_NEIGHBORAS 0x01 + struct filter_community { @@ -477,8 +477,8 @@ diff -u -p -r1.1.1.8 -r1.13 - int type; + int as; + int type; -+}; -+ + }; + +struct filter_extcommunity { + u_int16_t flags; + u_int8_t type; @@ -498,8 +498,8 @@ diff -u -p -r1.1.1.8 -r1.13 + } ext_ip; + u_int64_t ext_opaq; /* only 48 bits */ + } data; - }; - ++}; ++ + struct ctl_show_rib_request { char rib[PEER_DESCR_LEN]; @@ -543,8 +543,17 @@ diff -u -p -r1.1.1.8 -r1.13 struct filter_prefix { -@@ -594,16 +757,18 @@ struct filter_prefix { +@@ -592,18 +755,28 @@ struct filter_prefix { + u_int8_t len; + }; ++struct filter_nexthop { ++ struct bgpd_addr addr; ++ u_int8_t flags; ++#define FILTER_NEXTHOP_ADDR 1 ++#define FILTER_NEXTHOP_NEIGHBOR 2 ++}; ++ struct filter_prefixlen { enum comp_ops op; - sa_family_t af; @@ -560,6 +569,7 @@ diff -u -p -r1.1.1.8 -r1.13 - struct filter_community community; + struct filter_prefix prefix; + struct filter_prefixlen prefixlen; ++ struct filter_nexthop nexthop; + struct filter_as as; + struct filter_aslen aslen; + struct filter_community community; @@ -567,7 +577,7 @@ diff -u -p -r1.1.1.8 -r1.13 }; TAILQ_HEAD(filter_head, filter_rule); -@@ -635,10 +800,13 @@ enum action_types { +@@ -635,10 +808,13 @@ enum action_types { ACTION_SET_NEXTHOP_SELF, ACTION_SET_COMMUNITY, ACTION_DEL_COMMUNITY, @@ -582,7 +592,7 @@ diff -u -p -r1.1.1.8 -r1.13 }; struct filter_set { -@@ -650,23 +818,53 @@ struct filter_set { +@@ -650,23 +826,53 @@ struct filter_set { int32_t relative; struct bgpd_addr nexthop; struct filter_community community; @@ -641,7 +651,7 @@ diff -u -p -r1.1.1.8 -r1.13 int64_t nexthop_cnt; int64_t aspath_cnt; int64_t aspath_size; -@@ -677,82 +875,117 @@ struct rde_memstats { +@@ -677,82 +883,117 @@ struct rde_memstats { int64_t attr_dcnt; }; @@ -685,12 +695,12 @@ diff -u -p -r1.1.1.8 -r1.13 }; -SIMPLEQ_HEAD(rib_names, rde_rib); -extern struct rib_names ribnames; -- + -/* Address Family Numbers as per RFC 1700 */ -#define AFI_IPv4 1 -#define AFI_IPv6 2 -#define AFI_ALL 0xffff - +- -/* Subsequent Address Family Identifier as per RFC 4760 */ -#define SAFI_NONE 0x00 -#define SAFI_UNICAST 0x01 @@ -812,7 +822,7 @@ diff -u -p -r1.1.1.8 -r1.13 /* name2id.c */ u_int16_t rib_name2id(const char *); -@@ -768,10 +1001,22 @@ const char *pftable_id2name(u_int16_t); +@@ -768,10 +1009,22 @@ const char *pftable_id2name(u_int16_t); void pftable_unref(u_int16_t); void pftable_ref(u_int16_t); @@ -835,7 +845,7 @@ diff -u -p -r1.1.1.8 -r1.13 const char *filterset_name(enum action_types); /* util.c */ -@@ -779,11 +1024,24 @@ const char *log_addr(const struct bgpd_a +@@ -779,11 +1032,24 @@ const char *log_addr(const struct bgpd_a const char *log_in6addr(const struct in6_addr *); const char *log_sockaddr(struct sockaddr *); const char *log_as(u_int32_t); Modified: head/net/openbgpd/files/patch-bgpd_buffer.c ============================================================================== --- head/net/openbgpd/files/patch-bgpd_buffer.c Mon Dec 24 10:52:25 2012 (r309455) +++ head/net/openbgpd/files/patch-bgpd_buffer.c Mon Dec 24 12:41:36 2012 (r309456) @@ -1,182 +1,39 @@ Index: bgpd/buffer.c =================================================================== -RCS file: bgpd/buffer.c -diff -N bgpd/buffer.c +RCS file: /home/cvs/private/hrs/openbgpd/bgpd/buffer.c,v +retrieving revision 1.1.1.7 +retrieving revision 1.3 +diff -u -p -r1.1.1.7 -r1.3 --- bgpd/buffer.c 14 Feb 2010 20:19:57 -0000 1.1.1.7 -+++ /dev/null 1 Jan 1970 00:00:00 -0000 -@@ -1,305 +0,0 @@ ++++ bgpd/buffer.c 8 Dec 2012 20:17:59 -0000 1.3 +@@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.43 2009/06/06 06:33:15 eric Exp $ */ -- --/* -- * Copyright (c) 2003, 2004 Henning Brauer -- * -- * Permission to use, copy, modify, and distribute this software for any -- * purpose with or without fee is hereby granted, provided that the above -- * copyright notice and this permission notice appear in all copies. -- * -- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- */ -- --#include --#include --#include --#include -- --#include --#include --#include --#include -- --#include "imsg.h" -- --int buf_realloc(struct buf *, size_t); --void buf_enqueue(struct msgbuf *, struct buf *); --void buf_dequeue(struct msgbuf *, struct buf *); -- --struct buf * --buf_open(size_t len) --{ -- struct buf *buf; -- -- if ((buf = calloc(1, sizeof(struct buf))) == NULL) -- return (NULL); -- if ((buf->buf = malloc(len)) == NULL) { -- free(buf); -- return (NULL); -- } -- buf->size = buf->max = len; -- buf->fd = -1; -- -- return (buf); --} -- --struct buf * --buf_dynamic(size_t len, size_t max) --{ -- struct buf *buf; -- -- if (max < len) -- return (NULL); -- -- if ((buf = buf_open(len)) == NULL) -- return (NULL); -- -- if (max > 0) -- buf->max = max; -- -- return (buf); --} -- --int --buf_realloc(struct buf *buf, size_t len) --{ -- u_char *b; -- -- /* on static buffers max is eq size and so the following fails */ -- if (buf->wpos + len > buf->max) { -- errno = ENOMEM; -- return (-1); -- } -- -- b = realloc(buf->buf, buf->wpos + len); -- if (b == NULL) -- return (-1); -- buf->buf = b; -- buf->size = buf->wpos + len; -- -- return (0); --} -- --int --buf_add(struct buf *buf, const void *data, size_t len) --{ -- if (buf->wpos + len > buf->size) -- if (buf_realloc(buf, len) == -1) -- return (-1); -- -- memcpy(buf->buf + buf->wpos, data, len); -- buf->wpos += len; -- return (0); --} -- --void * --buf_reserve(struct buf *buf, size_t len) --{ -- void *b; -- -- if (buf->wpos + len > buf->size) -- if (buf_realloc(buf, len) == -1) -- return (NULL); -- -- b = buf->buf + buf->wpos; -- buf->wpos += len; -- return (b); --} -- --void * --buf_seek(struct buf *buf, size_t pos, size_t len) --{ -- /* only allowed to seek in already written parts */ -- if (pos + len > buf->wpos) -- return (NULL); -- -- return (buf->buf + pos); --} -- --size_t --buf_size(struct buf *buf) --{ -- return (buf->wpos); --} -- --size_t --buf_left(struct buf *buf) --{ -- return (buf->max - buf->wpos); --} -- --void --buf_close(struct msgbuf *msgbuf, struct buf *buf) --{ -- buf_enqueue(msgbuf, buf); --} -- --int --buf_write(struct msgbuf *msgbuf) --{ -- struct iovec iov[IOV_MAX]; ++/* $OpenBSD: buffer.c,v 1.44 2009/07/23 18:58:42 eric Exp $ */ + + /* + * Copyright (c) 2003, 2004 Henning Brauer +@@ -144,7 +144,7 @@ int + buf_write(struct msgbuf *msgbuf) + { + struct iovec iov[IOV_MAX]; - struct buf *buf, *next; -- unsigned int i = 0; -- ssize_t n; -- -- bzero(&iov, sizeof(iov)); -- TAILQ_FOREACH(buf, &msgbuf->bufs, entry) { -- if (i >= IOV_MAX) -- break; -- iov[i].iov_base = buf->buf + buf->rpos; ++ struct buf *buf; + unsigned int i = 0; + ssize_t n; + +@@ -153,7 +153,7 @@ buf_write(struct msgbuf *msgbuf) + if (i >= IOV_MAX) + break; + iov[i].iov_base = buf->buf + buf->rpos; - iov[i].iov_len = buf->size - buf->rpos; -- i++; -- } -- -- if ((n = writev(msgbuf->fd, iov, i)) == -1) { -- if (errno == EAGAIN || errno == ENOBUFS || -- errno == EINTR) /* try later */ -- return (0); -- else -- return (-1); -- } -- -- if (n == 0) { /* connection closed */ -- errno = 0; -- return (-2); -- } -- ++ iov[i].iov_len = buf->wpos - buf->rpos; + i++; + } + +@@ -170,17 +170,7 @@ buf_write(struct msgbuf *msgbuf) + return (-2); + } + - for (buf = TAILQ_FIRST(&msgbuf->bufs); buf != NULL && n > 0; - buf = next) { - next = TAILQ_NEXT(buf, entry); @@ -188,95 +45,48 @@ diff -N bgpd/buffer.c - n = 0; - } - } -- -- return (0); --} -- --void --buf_free(struct buf *buf) --{ -- free(buf->buf); -- free(buf); --} -- --void --msgbuf_init(struct msgbuf *msgbuf) --{ -- msgbuf->queued = 0; -- msgbuf->fd = -1; -- TAILQ_INIT(&msgbuf->bufs); --} -- --void --msgbuf_clear(struct msgbuf *msgbuf) --{ -- struct buf *buf; -- -- while ((buf = TAILQ_FIRST(&msgbuf->bufs)) != NULL) -- buf_dequeue(msgbuf, buf); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***