Mailing List Archive

Problem with bgpd from quagga-0.96.4-20040329
Hello,

I have just switched to quagga-0.96.4-20040329 on one of my routers (r1
- XXX.YYY.210.1). After a while I decided to add one more bgp peer (to
r9 - XXX.YYY.210.9). Unfortunately, routers were not able setup bgp
session. Router with new quagga (r1) logged such strange message:

2004/03/29 14:06:51 BGP: bgp_connect_success peer's fd is negative value -1

There were no problem with setting up bgp sessions from r9 to other
routers: r2 (zebra-0.95-pre1) and r3 (cisco 12.2). I solved this
problem with r1 by switching to old bgpd from quagga-20031108.

Full logs:

From r9:
2004/03/29 14:06:51 BGP: XXX.YYY.210.1 [FSM] Timer (start timer expire).
2004/03/29 14:06:51 BGP: XXX.YYY.210.1 [FSM] BGP_Start (Idle->Connect)
2004/03/29 14:06:51 BGP: XXX.YYY.210.1 [Event] Connect start to XXX.YYY.210.1 fd 12
2004/03/29 14:06:51 BGP: XXX.YYY.210.1 [FSM] Non blocking connect waiting result
2004/03/29 14:06:51 BGP: XXX.YYY.210.1 [FSM] TCP_connection_open (Connect->OpenSent)
2004/03/29 14:08:14 BGP: [Event] BGP connection from host XXX.YYY.210.1
2004/03/29 14:08:14 BGP: XXX.YYY.210.1 [FSM] TCP_connection_open (OpenSent->Idle)
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [FSM] Timer (start timer expire).
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [FSM] BGP_Start (Idle->Connect)
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [Event] Connect start to XXX.YYY.210.1 fd 12
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [FSM] Non blocking connect waiting result
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [FSM] TCP_connection_open (Connect->OpenSent)
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [Error] bgp_read_packet error: Connection reset by peer
2004/03/29 14:08:18 BGP: XXX.YYY.210.1 [FSM] TCP_fatal_error (OpenSent->Idle)
2004/03/29 14:08:19 BGP: [Event] BGP connection from host XXX.YYY.210.1
2004/03/29 14:08:19 BGP: [Event] BGP connection IP address XXX.YYY.210.1 is Idle state
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [FSM] Timer (start timer expire).
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [FSM] BGP_Start (Idle->Connect)
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [Event] Connect start to XXX.YYY.210.1 fd 12
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [FSM] Non blocking connect waiting result
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [FSM] TCP_connection_open (Connect->OpenSent)
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [Error] bgp_read_packet error: Connection reset by peer
2004/03/29 14:08:22 BGP: XXX.YYY.210.1 [FSM] TCP_fatal_error (OpenSent->Idle)
2004/03/29 14:08:24 BGP: [Event] BGP connection from host XXX.YYY.210.1
2004/03/29 14:08:24 BGP: [Event] BGP connection IP address XXX.YYY.210.1 is Idle state
2004/03/29 14:08:28 BGP: [Event] BGP connection from host XXX.YYY.210.1
2004/03/29 14:08:28 BGP: [Event] BGP connection IP address XXX.YYY.210.1 is Idle state
2004/03/29 14:08:29 BGP: XXX.YYY.210.1 [FSM] Timer (start timer expire).
2004/03/29 14:08:29 BGP: XXX.YYY.210.1 [FSM] BGP_Start (Idle->Connect)
2004/03/29 14:08:29 BGP: XXX.YYY.210.1 [Event] Connect start to XXX.YYY.210.1 fd 12
2004/03/29 14:08:29 BGP: XXX.YYY.210.1 [FSM] Non blocking connect waiting result
2004/03/29 14:08:29 BGP: XXX.YYY.210.1 [FSM] TCP_connection_open (Connect->OpenSent)

From r1:
2004/03/29 14:06:15 BGP: XXX.YYY.210.9 [Event] Connect start to XXX.YYY.210.9 fd 23
2004/03/29 14:06:15 BGP: XXX.YYY.210.9 [Event] Connect failed (Operation now in progress)
2004/03/29 14:06:51 BGP: [Event] BGP connection from host XXX.YYY.210.9
2004/03/29 14:06:51 BGP: bgp_connect_success peer's fd is negative value -1
2004/03/29 14:08:15 BGP: XXX.YYY.210.9 [Event] Connect start to XXX.YYY.210.9 fd 25
2004/03/29 14:08:15 BGP: XXX.YYY.210.9 [Error] bgp_read_packet error: Connection reset by peer
2004/03/29 14:08:19 BGP: [Event] BGP connection from host XXX.YYY.210.9
2004/03/29 14:08:19 BGP: [Event] BGP connection IP address XXX.YYY.210.9 is Idle state
2004/03/29 14:08:20 BGP: XXX.YYY.210.9 [Event] Connect start to XXX.YYY.210.9 fd 23
2004/03/29 14:08:20 BGP: XXX.YYY.210.9 [Error] bgp_read_packet error: Connection reset by peer
2004/03/29 14:08:23 BGP: [Event] BGP connection from host XXX.YYY.210.9
2004/03/29 14:08:23 BGP: [Event] BGP connection IP address XXX.YYY.210.9 is Idle state
2004/03/29 14:08:25 BGP: XXX.YYY.210.9 [Event] Connect start to XXX.YYY.210.9 fd 23
2004/03/29 14:08:25 BGP: XXX.YYY.210.9 [Error] bgp_read_packet error: Connection reset by peer
2004/03/29 14:08:29 BGP: XXX.YYY.210.9 [Event] Connect start to XXX.YYY.210.9 fd 23
2004/03/29 14:08:29 BGP: XXX.YYY.210.9 [Event] BGP connection closed fd 23
2004/03/29 14:08:30 BGP: [Event] BGP connection from host XXX.YYY.210.9
2004/03/29 14:08:30 BGP: bgp_connect_success peer's fd is negative value -1

r9 config:
log file /var/log/zebra/bgpd.log

router bgp MMMMM
bgp router-id 195.177.210.9

neighbor XXX.YYY.210.1 remote-as NNNNN
neighbor XXX.YYY.210.1 soft-reconfiguration inbound

debug bgp events
debug bgp filters
debug bgp fsm
debug bgp keepalives
debug bgp updates

Best regards,

Krzysztof Olêdzki
Re: Problem with bgpd from quagga-0.96.4-20040329 [ In reply to ]
On Mon, 29 Mar 2004, Krzysztof Oledzki wrote:

> Hello,
>
> I have just switched to quagga-0.96.4-20040329 on one of my routers (r1
> - XXX.YYY.210.1). After a while I decided to add one more bgp peer (to
> r9 - XXX.YYY.210.9). Unfortunately, routers were not able setup bgp
> session. Router with new quagga (r1) logged such strange message:

urg.

> 2004/03/29 14:06:51 BGP: bgp_connect_success peer's fd is negative value -1

hmmm... Can you try this patch?

Index: bgpd/bgp_fsm.c
===================================================================
RCS file: /var/cvsroot/quagga/bgpd/bgp_fsm.c,v
retrieving revision 1.3
diff -u -r1.3 bgp_fsm.c
--- bgpd/bgp_fsm.c 17 Feb 2004 19:45:10 -0000 1.3
+++ bgpd/bgp_fsm.c 7 Apr 2004 23:07:27 -0000
@@ -488,13 +488,13 @@
int
bgp_connect_success (struct peer *peer)
{
- if (peer->fd_local < 0)
+ if (*peer->fd < 0)
{
zlog_err ("bgp_connect_success peer's fd is negative value %d",
- peer->fd_local);
+ *peer->fd);
return -1;
}
- BGP_READ_ON (peer->t_read, bgp_read, peer->fd_local);
+ BGP_READ_ON (peer->t_read, bgp_read, *peer->fd);

/* bgp_getsockname (peer); */


regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
Xerox never comes up with anything original.
Re: Problem with bgpd from quagga-0.96.4-20040329 [ In reply to ]
On Thu, 8 Apr 2004, Paul Jakma wrote:

> On Mon, 29 Mar 2004, Krzysztof Oledzki wrote:
>
> > Hello,
> >
> > I have just switched to quagga-0.96.4-20040329 on one of my routers (r1
> > - XXX.YYY.210.1). After a while I decided to add one more bgp peer (to
> > r9 - XXX.YYY.210.9). Unfortunately, routers were not able setup bgp
> > session. Router with new quagga (r1) logged such strange message:
>
> urg.
>
> > 2004/03/29 14:06:51 BGP: bgp_connect_success peer's fd is negative value -1
>
> hmmm... Can you try this patch?

Hm.. Still bad :( This time bgpd was not able to setup connections with
all bgp peers from bgpd.conf. There are 3 IPv4 BGP peers and 3 IPv6 BGP peers:

2004/04/14 21:47:04 BGP: BGPd 0.96.4 starting: vty@2605, bgp@179
2004/04/14 21:47:07 BGP: [Event] BGP connection from host YYY.YY.32.45
2004/04/14 21:47:07 BGP: [Event] BGP connection IP address YYY.YY.32.45 is Idle state
2004/04/14 21:47:07 BGP: ZZZZ:ZZZZ:f03::1 [Event] Connect start to ZZZZ:ZZZZ:f03::1 fd 10
2004/04/14 21:47:08 BGP: YYY.YY.32.45 [Event] Connect start to YYY.YY.32.45 fd 11
2004/04/14 21:47:09 BGP: [Event] BGP connection from host YYYY:YYYY:1::aa
2004/04/14 21:47:09 BGP: [Event] BGP connection IP address YYYY:YYYY:1::aa is Idle state
2004/04/14 21:47:10 BGP: XXX.XXX.210.3 [Event] Connect start to XXX.XXX.210.3 fd 12
2004/04/14 21:47:11 BGP: XXX.XXX.210.2 [Event] Connect start to XXX.XXX.210.2 fd 13
2004/04/14 21:47:11 BGP: YYYY:YYYY:1::aa [Event] Connect start to YYYY:YYYY:1::aa fd 14
2004/04/14 21:47:11 BGP: YYYY:YYYY:1::aa [Event] BGP connection closed fd 14
2004/04/14 21:47:12 BGP: [Event] BGP connection from host YYYY:YYYY:1::aa
2004/04/14 21:47:12 BGP: bgp_connect_success peer's fd is negative value -1
2004/04/14 21:47:12 BGP: XXXX:XXXX:1:1::2 [Event] Connect start to XXXX:XXXX:1:1::2 fd 15
2004/04/14 21:47:16 BGP: [Event] BGP connection from host XXXX:XXXX:1:1::2
2004/04/14 21:47:17 BGP: XXX.XXX.210.2 [Error] bgp_read_packet error: Connection reset by peer
2004/04/14 21:47:20 BGP: [Event] BGP connection from host XXX.XXX.210.2
2004/04/14 21:47:20 BGP: [Event] BGP connection IP address XXX.XXX.210.2 is Idle state
2004/04/14 21:47:21 BGP: [Event] BGP connection from host XXXX:XXXX:1:1::2
2004/04/14 21:47:21 BGP: [Event] BGP connection IP address XXXX:XXXX:1:1::2 is Idle state
2004/04/14 21:47:22 BGP: XXXX:XXXX:1:1::2 [Event] Connect start to XXXX:XXXX:1:1::2 fd 13
2004/04/14 21:47:22 BGP: XXXX:XXXX:1:1::2 [Event] BGP connection closed fd 13
2004/04/14 21:47:23 BGP: XXX.XXX.210.2 [Event] Connect start to XXX.XXX.210.2 fd 13
2004/04/14 21:47:23 BGP: XXX.XXX.210.2 [Event] BGP connection closed fd 13
2004/04/14 21:47:26 BGP: [Event] BGP connection from host XXX.XXX.210.2
2004/04/14 21:47:26 BGP: bgp_connect_success peer's fd is negative value -1
2004/04/14 21:47:27 BGP: [Event] BGP connection from host XXXX:XXXX:1:1::2
2004/04/14 21:47:27 BGP: bgp_connect_success peer's fd is negative value -1
2004/04/14 21:48:38 BGP: [Event] BGP connection from host XXXX:XXXX:1:1::2
(...)

Best regards,

Krzysztof Olêdzki
Re: Problem with bgpd from quagga-0.96.4-20040329 [ In reply to ]
On Thu, 15 Apr 2004, Krzysztof Oledzki wrote:

> Hm.. Still bad

That's good in a way, i would have been quite puzzled had it worked.
:)

> :( This time bgpd was not able to setup connections
> with all bgp peers from bgpd.conf. There are 3 IPv4 BGP peers and 3
> IPv6 BGP peers:

Can you try recent bgpd again, without that patch, but with 'debug
bgp fsm' set? (it didnt seem to be set for R1 in first set of logs
you posted).

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
George Washington was first in war, first in peace -- and the first to
have his birthday juggled to make a long weekend.
-- Ashley Cooper
Re: Problem with bgpd from quagga-0.96.4-20040329 [ In reply to ]
On Thu, 15 Apr 2004, Krzysztof Oledzki wrote:

> Hm.. Still bad :( This time bgpd was not able to setup connections
> with all bgp peers from bgpd.conf. There are 3 IPv4 BGP peers and 3
> IPv6 BGP peers:

Ok, there's still some brain-damage left over from the ACCEPT_PEER
stuff that needs to be excised. (and a wee bit of RFC 1771
brain-damage to work out too).

working on a patch.

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
Polymer physicists are into chains.