On Tue, Jan 05, 2010 at 12:04:10AM +0100, Claudio Jeker wrote:
> On Mon, Jan 04, 2010 at 10:11:00PM +0100, Laurent CARON wrote:
> > Hi,
> > 
> > Since I did update OpenBGPd (complete system update today), I did
> > notice a strange behavior:
> > 
> > None of my eBGP sessions are being taken up wether IPv4 or IPv6
> > 
> > Jan  4 22:02:26 bgpgw-002 bgpd[9545]: neighbor 2001:470:14:98::1
> > (he-ipv6-bgp-peer): received notification: error in OPEN message, AS
> > unacceptable
> > 
> > Tcpdump output:
> > 22:05:53.890039 bgpgw-002.lncsa.com.29176 >
> > interco-bgp-nerim.lncsa.com.bgp: P 1:46(45) ack 1 win 65535: BGP
> > (OPEN: Version 4, AS #0, Holdtime 30, ID bgpgw-002.lncsa.com, Option
> > length 16 ((CAP MULTI_PROTOCOL [IPv4 Unicast], CAP ROUTE_REFRESH,
> > CAP AS4 #49463))) (DF) [tos 0xc0] [ttl 1]
> > 22:05:53.937168 interco-bgp-nerim.lncsa.com.bgp >
> > bgpgw-002.lncsa.com.29176: P 1:24(23) ack 46 win 16339: BGP
> > (NOTIFICATION: error OPEN Message Error, subcode Bad Peer AS) [tos
> > 0xc0] [ttl 1]
> > 
> > The setup consists of two OpenBSD boxes (one running current from
> > last month, and the other one current from today).
> > 
> > To have it running again I have to copy the old (running on last
> > month's current machine) bgpd bgpctl binaries to the "new" system
> > and kill both instances of bgpd
> > 
> > Any clue ?
> > 
> 
> Yes, please send me the config (bgpd -nvv output is OK)
> For some reasons your AS number is not set in the open.
> 

OK, I see a problem here. The session engine does not copy the bgpd_conf
struct but instead does it bit by bit missing some important ones.
This diff should fix the problem for now. It would be better to swap the
config but that is a bit more complex. Need to look into that in the
morning.

-- 
:wq Claudio

Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.279
diff -u -p -r1.279 rde.c
--- rde.c       31 Dec 2009 15:34:02 -0000      1.279
+++ rde.c       4 Jan 2010 23:29:45 -0000
@@ -619,6 +619,9 @@ rde_dispatch_imsg_parent(struct imsgbuf 
                                        nconf->flags &= ~BGPD_FLAG_NO_EVALUATE;
                        }
                        memcpy(conf, nconf, sizeof(struct bgpd_config));
+                       conf->listen_addrs = NULL;
+                       conf->csock = NULL;
+                       conf->rcsock = NULL;
                        free(nconf);
                        nconf = NULL;
                        parent_set = NULL;
Index: session.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/session.c,v
retrieving revision 1.303
diff -u -p -r1.303 session.c
--- session.c   31 Dec 2009 15:34:02 -0000      1.303
+++ session.c   4 Jan 2010 23:31:19 -0000
@@ -2360,10 +2360,16 @@ session_dispatch_imsg(struct imsgbuf *ib
                                fatalx("reconf request not from parent");
                        if (nconf == NULL)
                                fatalx("got IMSG_RECONF_DONE but no config");
+                       conf->flags = nconf->flags;
+                       conf->log = nconf->log;
+                       conf->rtableid = nconf->rtableid;
+                       conf->bgpid = nconf->bgpid;
+                       conf->clusterid = nconf->clusterid;
                        conf->as = nconf->as;
+                       conf->short_as = nconf->short_as;
                        conf->holdtime = nconf->holdtime;
-                       conf->bgpid = nconf->bgpid;
                        conf->min_holdtime = nconf->min_holdtime;
+                       conf->connectretry = nconf->connectretry;
 
                        /* add new peers */
                        for (p = npeers; p != NULL; p = next) {

Reply via email to