Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/Makefile,v
retrieving revision 1.31
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.31 Makefile
--- Makefile	3 Jul 2011 11:27:55 -0000	1.31
+++ Makefile	3 Jan 2012 18:51:01 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	openbgpd
 PORTVERSION=	4.9.20110612
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_OPENBSD}
 MASTER_SITE_SUBDIR=	OpenBGPD
Index: files/patch-bgpd_bgpd.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_bgpd.c,v
retrieving revision 1.5
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.5 patch-bgpd_bgpd.c
--- files/patch-bgpd_bgpd.c	3 Jul 2011 05:18:37 -0000	1.5
+++ files/patch-bgpd_bgpd.c	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/bgpd.c,v
 retrieving revision 1.1.1.7
-diff -u -p -r1.1.1.7 bgpd.c
+retrieving revision 1.1.1.10
+diff -u -p -r1.1.1.7 -r1.1.1.10
 --- bgpd/bgpd.c	14 Feb 2010 20:19:57 -0000	1.1.1.7
-+++ bgpd/bgpd.c	3 Jul 2011 04:34:14 -0000
++++ bgpd/bgpd.c	12 Jun 2011 10:44:24 -0000	1.1.1.10
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: bgpd.c,v 1.148 2009/06/07 00:30:23 claudio Exp $ */
 +/*	$OpenBSD: bgpd.c,v 1.167 2011/05/01 10:42:28 claudio Exp $ */
Index: files/patch-bgpd_parse.y
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_parse.y,v
retrieving revision 1.8
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.8 patch-bgpd_parse.y
--- files/patch-bgpd_parse.y	3 Jul 2011 05:18:37 -0000	1.8
+++ files/patch-bgpd_parse.y	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/parse.y,v
 retrieving revision 1.1.1.8
-diff -u -p -r1.1.1.8 parse.y
+retrieving revision 1.9
+diff -u -p -r1.1.1.8 -r1.9
 --- bgpd/parse.y	14 Feb 2010 20:19:57 -0000	1.1.1.8
-+++ bgpd/parse.y	3 Jul 2011 04:43:32 -0000
++++ bgpd/parse.y	2 Jul 2011 16:06:38 -0000	1.9
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: parse.y,v 1.231 2009/06/06 01:10:29 claudio Exp $ */
 +/*	$OpenBSD: parse.y,v 1.250 2010/03/31 18:53:23 claudio Exp $ */
Index: files/patch-bgpd_rde.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_rde.c,v
retrieving revision 1.5
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.5 patch-bgpd_rde.c
--- files/patch-bgpd_rde.c	3 Jul 2011 05:18:37 -0000	1.5
+++ files/patch-bgpd_rde.c	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/rde.c,v
 retrieving revision 1.1.1.8
-diff -u -p -r1.1.1.8 rde.c
+retrieving revision 1.10
+diff -u -p -r1.1.1.8 -r1.10
 --- bgpd/rde.c	14 Feb 2010 20:19:57 -0000	1.1.1.8
-+++ bgpd/rde.c	3 Jul 2011 04:43:59 -0000
++++ bgpd/rde.c	2 Jul 2011 16:06:38 -0000	1.10
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: rde.c,v 1.264 2009/06/29 12:22:16 claudio Exp $ */
 +/*	$OpenBSD: rde.c,v 1.290 2010/03/30 15:43:30 claudio Exp $ */
Index: files/patch-bgpd_rde_decide.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_rde_decide.c,v
retrieving revision 1.4
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.4 patch-bgpd_rde_decide.c
--- files/patch-bgpd_rde_decide.c	3 Jul 2011 05:18:37 -0000	1.4
+++ files/patch-bgpd_rde_decide.c	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/rde_decide.c,v
 retrieving revision 1.1.1.6
-diff -u -p -r1.1.1.6 rde_decide.c
+retrieving revision 1.3
+diff -u -p -r1.1.1.6 -r1.3
 --- bgpd/rde_decide.c	14 Feb 2010 20:19:57 -0000	1.1.1.6
-+++ bgpd/rde_decide.c	3 Jul 2011 04:44:36 -0000
++++ bgpd/rde_decide.c	2 Jul 2011 16:06:38 -0000	1.3
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: rde_decide.c,v 1.58 2009/06/29 14:10:13 claudio Exp $ */
 +/*	$OpenBSD: rde_decide.c,v 1.59 2009/08/06 08:53:11 claudio Exp $ */
Index: files/patch-bgpd_rde_rib.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_rde_rib.c,v
retrieving revision 1.7
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.7 patch-bgpd_rde_rib.c
--- files/patch-bgpd_rde_rib.c	3 Jul 2011 05:18:37 -0000	1.7
+++ files/patch-bgpd_rde_rib.c	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/rde_rib.c,v
 retrieving revision 1.1.1.7
-diff -u -p -r1.1.1.7 rde_rib.c
+retrieving revision 1.7
+diff -u -p -r1.1.1.7 -r1.7
 --- bgpd/rde_rib.c	14 Feb 2010 20:19:57 -0000	1.1.1.7
-+++ bgpd/rde_rib.c	3 Jul 2011 04:45:31 -0000
++++ bgpd/rde_rib.c	2 Jul 2011 16:06:38 -0000	1.7
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: rde_rib.c,v 1.116 2009/06/29 14:13:48 claudio Exp $ */
 +/*	$OpenBSD: rde_rib.c,v 1.125 2010/04/07 09:44:11 claudio Exp $ */
Index: files/patch-bgpd_rde_update.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_rde_update.c,v
retrieving revision 1.6
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.6 patch-bgpd_rde_update.c
--- files/patch-bgpd_rde_update.c	3 Jul 2011 05:18:37 -0000	1.6
+++ files/patch-bgpd_rde_update.c	3 Jan 2012 18:50:50 -0000
@@ -2,9 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/rde_update.c,v
 retrieving revision 1.1.1.7
-diff -u -p -r1.1.1.7 rde_update.c
+retrieving revision 1.7
+diff -u -p -r1.1.1.7 -r1.7
 --- bgpd/rde_update.c	14 Feb 2010 20:19:57 -0000	1.1.1.7
-+++ bgpd/rde_update.c	3 Jul 2011 04:45:50 -0000
++++ bgpd/rde_update.c	2 Jul 2011 16:06:38 -0000	1.7
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: rde_update.c,v 1.68 2009/06/06 01:10:29 claudio Exp $ */
 +/*	$OpenBSD: rde_update.c,v 1.77 2010/01/13 06:02:37 claudio Exp $ */
Index: files/patch-bgpd_session.c
===================================================================
RCS file: /home/ncvs/ports/net/openbgpd/files/patch-bgpd_session.c,v
retrieving revision 1.9
diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.9 patch-bgpd_session.c
--- files/patch-bgpd_session.c	3 Jul 2011 11:27:55 -0000	1.9
+++ files/patch-bgpd_session.c	3 Jan 2012 18:50:50 -0000
@@ -2,10 +2,10 @@
 ===================================================================
 RCS file: /home/cvs/private/hrs/openbgpd/bgpd/session.c,v
 retrieving revision 1.1.1.8
-retrieving revision 1.9
-diff -u -p -r1.1.1.8 -r1.9
+retrieving revision 1.10
+diff -u -p -r1.1.1.8 -r1.10
 --- bgpd/session.c	14 Feb 2010 20:19:57 -0000	1.1.1.8
-+++ bgpd/session.c	3 Jul 2011 11:18:26 -0000	1.9
++++ bgpd/session.c	3 Jan 2012 18:50:04 -0000	1.10
 @@ -1,4 +1,4 @@
 -/*	$OpenBSD: session.c,v 1.293 2009/06/07 05:56:24 eric Exp $ */
 +/*	$OpenBSD: session.c,v 1.304 2010/01/05 08:49:57 claudio Exp $ */
@@ -88,7 +88,25 @@
  int			 csock = -1, rcsock = -1;
  u_int			 peer_cnt;
  struct imsgbuf		*ibuf_rde;
-@@ -175,12 +181,11 @@ setup_listeners(u_int *la_cnt)
+@@ -140,6 +146,7 @@ setup_listeners(u_int *la_cnt)
+ 		}
+ 
+ 		opt = 1;
++#if !defined(__FreeBSD__)
+ 		if (setsockopt(la->fd, IPPROTO_TCP, TCP_MD5SIG,
+ 		    &opt, sizeof(opt)) == -1) {
+ 			if (errno == ENOPROTOOPT) {	/* system w/o md5sig */
+@@ -148,6 +155,9 @@ setup_listeners(u_int *la_cnt)
+ 			} else
+ 				fatal("setsockopt TCP_MD5SIG");
+ 		}
++#else
++		/* XXX: TCP_MD5SIG option should be handled properly here. */
++#endif /* !defined(__FreeBSD__) */
+ 
+ 		/* set ttl to 255 so that ttl-security works */
+ 		if (la->sa.ss_family == AF_INET && setsockopt(la->fd,
+@@ -175,12 +185,11 @@ setup_listeners(u_int *la_cnt)
  }
  
  pid_t
@@ -105,7 +123,7 @@
  	unsigned int		 i, j, idx_peers, idx_listeners, idx_mrts;
  	pid_t			 pid;
  	u_int			 pfd_elms = 0, peer_l_elms = 0, mrt_l_elms = 0;
-@@ -189,19 +194,13 @@ session_main(struct bgpd_config *config,
+@@ -189,19 +198,13 @@ session_main(struct bgpd_config *config,
  	u_int32_t		 ctl_queued;
  	struct passwd		*pw;
  	struct peer		*p, **peer_l = NULL, *last, *next;
@@ -126,7 +144,7 @@
  	switch (pid = fork()) {
  	case -1:
  		fatal("cannot fork");
-@@ -211,13 +210,6 @@ session_main(struct bgpd_config *config,
+@@ -211,13 +214,6 @@ session_main(struct bgpd_config *config,
  		return (pid);
  	}
  
@@ -140,7 +158,7 @@
  	if ((pw = getpwnam(BGPD_USER)) == NULL)
  		fatal(NULL);
  
-@@ -229,28 +221,31 @@ session_main(struct bgpd_config *config,
+@@ -229,28 +225,31 @@ session_main(struct bgpd_config *config,
  	setproctitle("session engine");
  	bgpd_process = PROC_SE;
  
@@ -179,7 +197,7 @@
  	if ((ibuf_rde = malloc(sizeof(struct imsgbuf))) == NULL ||
  	    (ibuf_rde_ctl = malloc(sizeof(struct imsgbuf))) == NULL ||
  	    (ibuf_main = malloc(sizeof(struct imsgbuf))) == NULL)
-@@ -258,37 +253,21 @@ session_main(struct bgpd_config *config,
+@@ -258,37 +257,21 @@ session_main(struct bgpd_config *config,
  	imsg_init(ibuf_rde, pipe_s2r[0]);
  	imsg_init(ibuf_rde_ctl, pipe_s2rctl[0]);
  	imsg_init(ibuf_main, pipe_m2s[1]);
@@ -226,7 +244,7 @@
  
  	while (session_quit == 0) {
  		/* check for peers to be initialized or deleted */
-@@ -308,8 +287,9 @@ session_main(struct bgpd_config *config,
+@@ -308,8 +291,9 @@ session_main(struct bgpd_config *config,
  
  				/* reinit due? */
  				if (p->conf.reconf_action == RECONF_REINIT) {
@@ -238,7 +256,7 @@
  				}
  
  				/* deletion due? */
-@@ -317,7 +297,7 @@ session_main(struct bgpd_config *config,
+@@ -317,7 +301,7 @@ session_main(struct bgpd_config *config,
  					if (p->demoted)
  						session_demote(p, -1);
  					p->conf.demote_group[0] = 0;
@@ -247,7 +265,7 @@
  					log_peer_warnx(&p->conf, "removed");
  					if (last != NULL)
  						last->next = next;
-@@ -346,9 +326,17 @@ session_main(struct bgpd_config *config,
+@@ -346,9 +330,17 @@ session_main(struct bgpd_config *config,
  		}
  
  		mrt_cnt = 0;
@@ -266,7 +284,7 @@
  
  		if (mrt_cnt > mrt_l_elms) {
  			if ((newp = realloc(mrt_l, sizeof(struct mrt *) *
-@@ -394,14 +382,19 @@ session_main(struct bgpd_config *config,
+@@ -394,14 +386,19 @@ session_main(struct bgpd_config *config,
  		if (ctl_queued < SESSION_CTL_QUEUE_MAX)
  			/*
  			 * Do not act as unlimited buffer. Don't read in more
@@ -288,7 +306,7 @@
  		i = PFD_LISTENERS_START;
  		TAILQ_FOREACH(la, conf->listen_addrs, entry) {
  			pfd[i].fd = la->fd;
-@@ -534,6 +527,14 @@ session_main(struct bgpd_config *config,
+@@ -534,6 +531,14 @@ session_main(struct bgpd_config *config,
  			ctl_cnt += control_accept(rcsock, 1);
  		}
  
@@ -303,7 +321,7 @@
  		for (j = PFD_LISTENERS_START; nfds > 0 && j < idx_listeners;
  		    j++)
  			if (pfd[j].revents & POLLIN) {
-@@ -557,7 +558,7 @@ session_main(struct bgpd_config *config,
+@@ -557,7 +562,7 @@ session_main(struct bgpd_config *config,
  
  	while ((p = peers) != NULL) {
  		peers = p->next;
@@ -312,7 +330,7 @@
  		pfkey_remove(p);
  		free(p);
  	}
-@@ -643,10 +644,9 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -643,10 +648,9 @@ bgp_fsm(struct peer *peer, enum session_
  			timer_stop(peer, Timer_IdleHold);
  
  			/* allocate read buffer */
@@ -324,7 +342,7 @@
  
  			/* init write buffer */
  			msgbuf_init(&peer->wbuf);
-@@ -746,7 +746,6 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -746,7 +750,6 @@ bgp_fsm(struct peer *peer, enum session_
  			/* ignore */
  			break;
  		case EVNT_STOP:
@@ -332,7 +350,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		case EVNT_CON_CLOSED:
-@@ -780,7 +779,8 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -780,7 +783,8 @@ bgp_fsm(struct peer *peer, enum session_
  				change_state(peer, STATE_IDLE, event);
  			break;
  		default:
@@ -342,7 +360,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		}
-@@ -791,7 +791,6 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -791,7 +795,6 @@ bgp_fsm(struct peer *peer, enum session_
  			/* ignore */
  			break;
  		case EVNT_STOP:
@@ -350,7 +368,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		case EVNT_CON_CLOSED:
-@@ -815,7 +814,8 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -815,7 +818,8 @@ bgp_fsm(struct peer *peer, enum session_
  			change_state(peer, STATE_IDLE, event);
  			break;
  		default:
@@ -360,7 +378,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		}
-@@ -826,7 +826,6 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -826,7 +830,6 @@ bgp_fsm(struct peer *peer, enum session_
  			/* ignore */
  			break;
  		case EVNT_STOP:
@@ -368,7 +386,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		case EVNT_CON_CLOSED:
-@@ -856,7 +855,8 @@ bgp_fsm(struct peer *peer, enum session_
+@@ -856,7 +859,8 @@ bgp_fsm(struct peer *peer, enum session_
  			change_state(peer, STATE_IDLE, event);
  			break;
  		default:
@@ -378,7 +396,7 @@
  			change_state(peer, STATE_IDLE, event);
  			break;
  		}
-@@ -923,6 +923,7 @@ change_state(struct peer *peer, enum ses
+@@ -923,6 +927,7 @@ change_state(struct peer *peer, enum ses
  		timer_stop(peer, Timer_ConnectRetry);
  		timer_stop(peer, Timer_Keepalive);
  		timer_stop(peer, Timer_Hold);
@@ -386,7 +404,7 @@
  		timer_stop(peer, Timer_IdleHoldReset);
  		session_close_connection(peer);
  		msgbuf_clear(&peer->wbuf);
-@@ -1069,7 +1070,7 @@ session_connect(struct peer *peer)
+@@ -1069,7 +1074,7 @@ session_connect(struct peer *peer)
  	if (peer->fd != -1)
  		return (-1);
  
@@ -395,7 +413,7 @@
  	    IPPROTO_TCP)) == -1) {
  		log_peer_warn(&peer->conf, "session_connect socket");
  		bgp_fsm(peer, EVNT_CON_OPENFAIL);
-@@ -1100,8 +1101,7 @@ session_connect(struct peer *peer)
+@@ -1100,8 +1105,7 @@ session_connect(struct peer *peer)
  	peer->wbuf.fd = peer->fd;
  
  	/* if update source is set we need to bind() */
@@ -405,7 +423,7 @@
  		if (bind(peer->fd, sa, sa->sa_len) == -1) {
  			log_peer_warn(&peer->conf, "session_connect bind");
  			bgp_fsm(peer, EVNT_CON_OPENFAIL);
-@@ -1139,42 +1139,50 @@ session_setup_socket(struct peer *p)
+@@ -1139,42 +1143,50 @@ session_setup_socket(struct peer *p)
  	int	nodelay = 1;
  	int	bsize;
  
@@ -486,7 +504,7 @@
  	}
  
  	/* set TCP_NODELAY */
-@@ -1185,14 +1193,6 @@ session_setup_socket(struct peer *p)
+@@ -1185,14 +1197,6 @@ session_setup_socket(struct peer *p)
  		return (-1);
  	}
  
@@ -501,7 +519,7 @@
  	/* only increase bufsize (and thus window) if md5 or ipsec is in use */
  	if (p->conf.auth.method != AUTH_NONE) {
  		/* try to increase bufsize. no biggie if it fails */
-@@ -1244,40 +1244,32 @@ session_tcp_established(struct peer *pee
+@@ -1244,40 +1248,32 @@ session_tcp_established(struct peer *pee
  void
  session_capa_ann_none(struct peer *peer)
  {
@@ -555,7 +573,7 @@
  
  	return (errs);
  }
-@@ -1287,23 +1279,22 @@ session_newmsg(enum msg_type msgtype, u_
+@@ -1287,23 +1283,22 @@ session_newmsg(enum msg_type msgtype, u_
  {
  	struct bgp_msg		*msg;
  	struct msg_header	 hdr;
@@ -587,7 +605,7 @@
  		return (NULL);
  	}
  
-@@ -1329,7 +1320,7 @@ session_sendmsg(struct bgp_msg *msg, str
+@@ -1329,7 +1324,7 @@ session_sendmsg(struct bgp_msg *msg, str
  			mrt_dump_bgp_msg(mrt, msg->buf->buf, msg->len, p);
  	}
  
@@ -596,7 +614,7 @@
  	free(msg);
  	return (0);
  }
-@@ -1338,40 +1329,38 @@ void
+@@ -1338,40 +1333,38 @@ void
  session_open(struct peer *p)
  {
  	struct bgp_msg		*buf;
@@ -651,7 +669,7 @@
  	}
  
  	/* 4-bytes AS numbers, draft-ietf-idr-as4bytes-13 */
-@@ -1379,13 +1368,17 @@ session_open(struct peer *p)
+@@ -1379,13 +1372,17 @@ session_open(struct peer *p)
  		u_int32_t	nas;
  
  		nas = htonl(conf->as);
@@ -672,7 +690,7 @@
  		bgp_fsm(p, EVNT_CON_FATAL);
  		return;
  	}
-@@ -1399,19 +1392,24 @@ session_open(struct peer *p)
+@@ -1399,19 +1396,24 @@ session_open(struct peer *p)
  	msg.bgpid = conf->bgpid;	/* is already in network byte order */
  	msg.optparamlen = optparamlen;
  
@@ -708,7 +726,7 @@
  		free(buf);
  		bgp_fsm(p, EVNT_CON_FATAL);
  		return;
-@@ -1459,8 +1457,8 @@ session_update(u_int32_t peerid, void *d
+@@ -1459,8 +1461,8 @@ session_update(u_int32_t peerid, void *d
  		return;
  	}
  
@@ -719,7 +737,7 @@
  		free(buf);
  		bgp_fsm(p, EVNT_CON_FATAL);
  		return;
-@@ -1480,29 +1478,27 @@ session_notification(struct peer *p, u_i
+@@ -1480,29 +1482,27 @@ session_notification(struct peer *p, u_i
      void *data, ssize_t datalen)
  {
  	struct bgp_msg		*buf;
@@ -757,7 +775,7 @@
  		free(buf);
  		bgp_fsm(p, EVNT_CON_FATAL);
  		return;
-@@ -1521,23 +1517,29 @@ session_notification(struct peer *p, u_i
+@@ -1521,23 +1521,29 @@ session_notification(struct peer *p, u_i
  int
  session_neighbor_rrefresh(struct peer *p)
  {
@@ -793,7 +811,7 @@
  
  	if ((buf = session_newmsg(RREFRESH, MSGSIZE_RREFRESH)) == NULL) {
  		bgp_fsm(p, EVNT_CON_FATAL);
-@@ -1545,12 +1547,12 @@ session_rrefresh(struct peer *p, u_int16
+@@ -1545,12 +1551,12 @@ session_rrefresh(struct peer *p, u_int16
  	}
  
  	afi = htons(afi);
@@ -811,7 +829,7 @@
  		free(buf);
  		bgp_fsm(p, EVNT_CON_FATAL);
  		return;
-@@ -1853,12 +1855,6 @@ parse_open(struct peer *peer)
+@@ -1853,12 +1859,6 @@ parse_open(struct peer *peer)
  	p += sizeof(short_as);
  	as = peer->short_as = ntohs(short_as);
  
@@ -824,7 +842,7 @@
  	memcpy(&oholdtime, p, sizeof(oholdtime));
  	p += sizeof(oholdtime);
  
-@@ -1966,6 +1962,15 @@ parse_open(struct peer *peer)
+@@ -1966,6 +1966,15 @@ parse_open(struct peer *peer)
  		}
  	}
  
@@ -840,7 +858,7 @@
  	if (peer->conf.remote_as != as) {
  		log_peer_warnx(&peer->conf, "peer sent wrong AS %s",
  		    log_as(as));
-@@ -1974,6 +1979,14 @@ parse_open(struct peer *peer)
+@@ -1974,6 +1983,14 @@ parse_open(struct peer *peer)
  		return (-1);
  	}
  
@@ -855,7 +873,7 @@
  	return (0);
  }
  
-@@ -2008,24 +2021,35 @@ int
+@@ -2008,24 +2025,35 @@ int
  parse_refresh(struct peer *peer)
  {
  	u_char		*p;
@@ -897,7 +915,7 @@
  		return (-1);
  
  	return (0);
-@@ -2035,11 +2059,12 @@ int
+@@ -2035,11 +2063,12 @@ int
  parse_notification(struct peer *peer)
  {
  	u_char		*p;
@@ -911,7 +929,7 @@
  
  	/* just log */
  	p = peer->rbuf->rptr;
-@@ -2059,7 +2084,7 @@ parse_notification(struct peer *peer)
+@@ -2059,7 +2088,7 @@ parse_notification(struct peer *peer)
  	p += sizeof(subcode);
  	datalen -= sizeof(subcode);
  
@@ -920,7 +938,7 @@
  	peer->errcnt++;
  
  	if (errcode == ERR_OPEN && subcode == ERR_OPEN_CAPA) {
-@@ -2094,8 +2119,8 @@ parse_notification(struct peer *peer)
+@@ -2094,8 +2123,8 @@ parse_notification(struct peer *peer)
  			datalen -= capa_len;
  			switch (capa_code) {
  			case CAPA_MP:
@@ -931,7 +949,7 @@
  				log_peer_warnx(&peer->conf,
  				    "disabling multiprotocol capability");
  				break;
-@@ -2139,13 +2164,14 @@ parse_notification(struct peer *peer)
+@@ -2139,13 +2168,14 @@ parse_notification(struct peer *peer)
  int
  parse_capabilities(struct peer *peer, u_char *d, u_int16_t dlen, u_int32_t *as)
  {
@@ -950,7 +968,7 @@
  
  	len = dlen;
  	while (len > 0) {
-@@ -2182,29 +2208,16 @@ parse_capabilities(struct peer *peer, u_
+@@ -2182,29 +2212,16 @@ parse_capabilities(struct peer *peer, u_
  				    "expect len 4, len is %u", capa_len);
  				return (-1);
  			}
@@ -988,7 +1006,7 @@
  			break;
  		case CAPA_REFRESH:
  			peer->capa.peer.refresh = 1;
-@@ -2232,6 +2245,37 @@ parse_capabilities(struct peer *peer, u_
+@@ -2232,6 +2249,37 @@ parse_capabilities(struct peer *peer, u_
  	return (0);
  }
  
@@ -1026,7 +1044,7 @@
  void
  session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt)
  {
-@@ -2244,7 +2288,7 @@ session_dispatch_imsg(struct imsgbuf *ib
+@@ -2244,7 +2292,7 @@ session_dispatch_imsg(struct imsgbuf *ib
  	struct kif		*kif;
  	u_char			*data;
  	enum reconf_action	 reconf;
@@ -1035,7 +1053,7 @@
  	u_int8_t		 errcode, subcode;
  
  	if ((n = imsg_read(ibuf)) == -1)
-@@ -2332,15 +2376,42 @@ session_dispatch_imsg(struct imsgbuf *ib
+@@ -2332,15 +2380,42 @@ session_dispatch_imsg(struct imsgbuf *ib
  			}
  
  			break;
@@ -1079,7 +1097,7 @@
  
  			/* add new peers */
  			for (p = npeers; p != NULL; p = next) {
-@@ -2408,7 +2479,8 @@ session_dispatch_imsg(struct imsgbuf *ib
+@@ -2408,7 +2483,8 @@ session_dispatch_imsg(struct imsgbuf *ib
  						bgp_fsm(p, EVNT_START);
  					} else if (!depend_ok && p->depend_ok) {
  						p->depend_ok = depend_ok;
@@ -1089,7 +1107,7 @@
  					}
  				}
  			break;
-@@ -2456,10 +2528,10 @@ session_dispatch_imsg(struct imsgbuf *ib
+@@ -2456,10 +2532,10 @@ session_dispatch_imsg(struct imsgbuf *ib
  			}
  			break;
  		case IMSG_CTL_KROUTE:
@@ -1101,7 +1119,7 @@
  			if (idx != PFD_PIPE_MAIN)
  				fatalx("ctl kroute request not from parent");
  			control_imsg_relay(&imsg);
-@@ -2469,7 +2541,6 @@ session_dispatch_imsg(struct imsgbuf *ib
+@@ -2469,7 +2545,6 @@ session_dispatch_imsg(struct imsgbuf *ib
  		case IMSG_CTL_SHOW_RIB_ATTR:
  		case IMSG_CTL_SHOW_RIB_MEM:
  		case IMSG_CTL_SHOW_NETWORK:
@@ -1109,7 +1127,7 @@
  		case IMSG_CTL_SHOW_NEIGHBOR:
  			if (idx != PFD_PIPE_ROUTE_CTL)
  				fatalx("ctl rib request not from RDE");
-@@ -2612,29 +2683,23 @@ getpeerbydesc(const char *descr)
+@@ -2612,29 +2687,23 @@ getpeerbydesc(const char *descr)
  struct peer *
  getpeerbyip(struct sockaddr *ip)
  {
@@ -1146,7 +1164,7 @@
  			if (loose == NULL || loose->conf.remote_masklen <
  			    p->conf.remote_masklen)
  				loose = p;
-@@ -2653,21 +2718,19 @@ getpeerbyip(struct sockaddr *ip)
+@@ -2653,21 +2722,19 @@ getpeerbyip(struct sockaddr *ip)
  				break;
  			}
  		}
@@ -1175,7 +1193,7 @@
  		newpeer->rbuf = NULL;
  		init_peer(newpeer);
  		bgp_fsm(newpeer, EVNT_START);
-@@ -2680,40 +2743,24 @@ getpeerbyip(struct sockaddr *ip)
+@@ -2680,40 +2747,24 @@ getpeerbyip(struct sockaddr *ip)
  }
  
  int
@@ -1227,7 +1245,7 @@
  	return (0);
  }
  
-@@ -2733,6 +2780,7 @@ getpeerbyid(u_int32_t peerid)
+@@ -2733,6 +2784,7 @@ getpeerbyid(u_int32_t peerid)
  void
  session_down(struct peer *peer)
  {
@@ -1235,7 +1253,7 @@
  	peer->stats.last_updown = time(NULL);
  	if (imsg_compose(ibuf_rde, IMSG_SESSION_DOWN, peer->conf.id, 0, -1,
  	    NULL, 0) == -1)
-@@ -2748,35 +2796,12 @@ session_up(struct peer *p)
+@@ -2748,35 +2800,12 @@ session_up(struct peer *p)
  	    &p->conf, sizeof(p->conf)) == -1)
  		fatalx("imsg_compose error");
  
@@ -1274,7 +1292,7 @@
  	p->stats.last_updown = time(NULL);
  	if (imsg_compose(ibuf_rde, IMSG_SESSION_UP, p->conf.id, 0, -1,
  	    &sup, sizeof(sup)) == -1)
-@@ -2784,9 +2809,10 @@ session_up(struct peer *p)
+@@ -2784,9 +2813,10 @@ session_up(struct peer *p)
  }
  
  int
@@ -1287,7 +1305,7 @@
  }
  
  int
-@@ -2795,34 +2821,6 @@ imsg_compose_rde(int type, pid_t pid, vo
+@@ -2795,34 +2825,6 @@ imsg_compose_rde(int type, pid_t pid, vo
  	return (imsg_compose(ibuf_rde, type, 0, pid, -1, data, datalen));
  }
  
@@ -1322,7 +1340,7 @@
  void
  session_demote(struct peer *p, int level)
  {
-@@ -2837,3 +2835,19 @@ session_demote(struct peer *p, int level
+@@ -2837,3 +2839,19 @@ session_demote(struct peer *p, int level
  
  	p->demoted += level;
  }
