On 05/04/06, Claudio Jeker <[EMAIL PROTECTED]> wrote:
>
> On Wed, Apr 05, 2006 at 08:45:22AM +0100, tony sarendal wrote:
> > I installed a route-collector in my test network to get a better view on
> > things.
> > Originator is backwards.
> >
> > /Tony
> >
> > quagga-bgpd# sh ip bgp 192.168.10.0
> > BGP routing table entry for 192.168.10.0/24
> > Paths: (11 available, best #2, table Default-IP-Routing-Table)
> > Not advertised to any peer
> > Local
> > 172.16.1.5 from 10.0.0.2 (1.0.16.172)
> > Origin IGP, metric 100, localpref 100, valid, internal
> > Originator: 1.0.16.172, Cluster list: 10.0.0.2
> > Last update: Wed Apr 5 02:50:50 2006
> >
>
> Oups, yes that looks like a missing htonl()
> Could you give the following diff a whirl?
>
> --
> :wq Claudio
>
> Index: rde.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
> retrieving revision 1.202
> diff -u -p -r1.202 rde.c
> --- rde.c 22 Mar 2006 10:18:49 -0000 1.202
> +++ rde.c 5 Apr 2006 11:33:05 -0000
> @@ -1432,17 +1432,22 @@ rde_reflector(struct rde_peer *peer, str
> {
> struct attr *a;
> u_int16_t len;
> + u_int32_t id;
>
> /* check for originator id if eq router_id drop */
> if ((a = attr_optget(asp, ATTR_ORIGINATOR_ID)) != NULL) {
> if (memcmp(&conf->bgpid, a->data, sizeof(conf->bgpid)) ==
> 0)
> /* this is coming from myself */
> return (0);
> - } else if ((conf->flags & BGPD_FLAG_REFLECTOR) &&
> - attr_optadd(asp, ATTR_OPTIONAL, ATTR_ORIGINATOR_ID,
> - peer->conf.ebgp == 0 ? &peer->remote_bgpid : &conf->bgpid,
> - sizeof(u_int32_t)) == -1)
> - fatalx("attr_optadd failed but impossible");
> + } else if (conf->flags & BGPD_FLAG_REFLECTOR) {
> + if (peer->conf.ebgp == 0)
> + id = htonl(peer->remote_bgpid);
> + else
> + id = conf->bgpid;
> + if (attr_optadd(asp, ATTR_OPTIONAL, ATTR_ORIGINATOR_ID,
> + &id, sizeof(u_int32_t)) == -1)
> + fatalx("attr_optadd failed but impossible");
> + }
>
> /* check for own id in the cluster list */
> if (conf->flags & BGPD_FLAG_REFLECTOR) {
> @@ -2281,14 +2286,14 @@ network_init(struct network_head *net_l)
> reloadtime = time(NULL);
> bzero(&peerself, sizeof(peerself));
> peerself.state = PEER_UP;
> - peerself.remote_bgpid = conf->bgpid;
> + peerself.remote_bgpid = ntohl(conf->bgpid);
> id.s_addr = conf->bgpid;
> peerself.conf.remote_as = conf->as;
> snprintf(peerself.conf.descr, sizeof(peerself.conf.descr),
> "LOCAL: ID %s", inet_ntoa(id));
> bzero(&peerdynamic, sizeof(peerdynamic));
> peerdynamic.state = PEER_UP;
> - peerdynamic.remote_bgpid = conf->bgpid;
> + peerdynamic.remote_bgpid = ntohl(conf->bgpid);
> peerdynamic.conf.remote_as = conf->as;
> snprintf(peerdynamic.conf.descr, sizeof(peerdynamic.conf.descr),
> "LOCAL: ID %s", inet_ntoa(id));
> Index: rde.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v
> retrieving revision 1.91
> diff -u -p -r1.91 rde.h
> --- rde.h 4 Apr 2006 12:03:26 -0000 1.91
> +++ rde.h 5 Apr 2006 11:32:08 -0000
> @@ -63,7 +63,7 @@ struct rde_peer {
> struct capabilities capa_received;
> u_int32_t prefix_cnt; /* # of prefixes */
> u_int32_t adjrib_cnt; /* # of p. in
> Adj-RIB-In */
> - u_int32_t remote_bgpid;
> + u_int32_t remote_bgpid; /* host byte order!
> */
> u_int32_t up_pcnt;
> u_int32_t up_acnt;
> u_int32_t up_nlricnt;
>
>
Did the same test run as before, originator_id looks correct now.
/Tony
1. Bring ar213-FRA online
quagga-bgpd# sh ip bgp 192.168.30.0
BGP routing table entry for 192.168.30.0/24
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
Local
172.16.0.3 from 172.16.0.3 (172.16.0.3)
Origin IGP, localpref 100, valid, internal, best
Last update: Wed Apr 5 14:20:36 2006
quagga-bgpd#
2.Bring cr212-FRA online
quagga-bgpd# sh ip bgp 192.168.30.0
BGP routing table entry for 192.168.30.0/24
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Not advertised to any peer
Local
172.16.1.21 from 10.0.0.8 (172.16.0.3)
Origin IGP, metric 100, localpref 100, valid, internal
Originator: 172.16.0.3, Cluster list: 10.0.0.8
Last update: Wed Apr 5 14:23:40 2006
Local
172.16.0.3 from 172.16.0.3 (172.16.0.3)
Origin IGP, localpref 100, valid, internal, best
Last update: Wed Apr 5 14:20:36 2006
quagga-bgpd#
3. Bring cr211-FRA online
quagga-bgpd# sh ip bgp 192.168.30.0
BGP routing table entry for 192.168.30.0/24
Paths: (3 available, best #3, table Default-IP-Routing-Table)
Not advertised to any peer
Local
172.16.1.17 from 10.0.0.7 (172.16.0.3)
Origin IGP, metric 100, localpref 100, valid, internal
Originator: 172.16.0.3, Cluster list: 10.0.0.7
Last update: Wed Apr 5 14:25:19 2006
Local
172.16.1.21 from 10.0.0.8 (172.16.0.3)
Origin IGP, metric 100, localpref 100, valid, internal
Originator: 172.16.0.3, Cluster list: 10.0.0.8
Last update: Wed Apr 5 14:23:40 2006
Local
172.16.0.3 from 172.16.0.3 (172.16.0.3)
Origin IGP, localpref 100, valid, internal, best
Last update: Wed Apr 5 14:20:36 2006
quagga-bgpd#
4. Bring cr208-HAM online
quagga-bgpd# sh ip bgp 192.168.30.0
BGP routing table entry for 192.168.30.0/24
Paths: (4 available, best #4, table Default-IP-Routing-Table)
Not advertised to any peer
Local
10.1.1.34 from 10.0.0.6 (10.0.0.7)
Origin IGP, metric 200, localpref 100, valid, internal
Originator: 10.0.0.7, Cluster list: 10.0.0.6 10.0.0.8
Last update: Wed Apr 5 14:27:59 2006
Local
172.16.1.17 from 10.0.0.7 (172.16.0.3)
Origin IGP, metric 100, localpref 100, valid, internal
Originator: 172.16.0.3, Cluster list: 10.0.0.7
Last update: Wed Apr 5 14:25:19 2006
Local
172.16.1.21 from 10.0.0.8 (172.16.0.3)
Origin IGP, metric 100, localpref 100, valid, internal
Originator: 172.16.0.3, Cluster list: 10.0.0.8
Last update: Wed Apr 5 14:23:40 2006
Local
172.16.0.3 from 172.16.0.3 (172.16.0.3)
Origin IGP, localpref 100, valid, internal, best
Last update: Wed Apr 5 14:20:36 2006
quagga-bgpd#
5. Side note test
cr211-FRA# bgpctl reload
reload request sent.
cr211-FRA#
cr212-FRA# tail
/var/log/daemon
Apr 5 14:25:54 cr212-FRA bgpd[617]: neighbor 10.1.1.29 (AS65000) withdraw
10.0.0.6/32
Apr 5 14:27:51 cr212-FRA bgpd[617]: neighbor 10.1.1.29 (AS65000) withdraw
10.0.0.6/32
Apr 5 14:27:51 cr212-FRA bgpd[617]: neighbor 10.1.1.29 (AS65000) withdraw
10.1.1.20/30
Apr 5 14:27:51 cr212-FRA bgpd[617]: neighbor 10.1.1.29 (AS65000) withdraw
10.1.1.32/30
Apr 5 14:27:51 cr212-FRA bgpd[617]: neighbor 10.1.1.29 (AS65000) withdraw
10.0.0.8/32
Apr 5 14:27:51 cr212-FRA bgpd[617]: fatal in RDE: attr_diff: equal
attributes encountered
Apr 5 14:27:51 cr212-FRA bgpd[24768]: Lost child: route decision engine
exited
Apr 5 14:27:51 cr212-FRA bgpd[29357]: fatal in SE: session_dispatch_imsg:
pipe closed: Connection refused
Apr 5 14:27:51 cr212-FRA bgpd[24768]: kernel routing table decoupled
Apr 5 14:27:51 cr212-FRA bgpd[24768]: Terminating
cr212-FRA#
ar213-FRA# tail
/var/log/daemon
Apr 5 14:21:36 ar213-FRA bgpd[21086]: neighbor 172.16.1.18: socket error:
Connection refused
Apr 5 14:23:32 ar213-FRA bgpd[21086]: neighbor 172.16.1.18: state change
Active -> OpenSent, reason: Connection opened
Apr 5 14:23:32 ar213-FRA bgpd[21086]: neighbor 172.16.1.18: state change
OpenSent -> OpenConfirm, reason: OPEN message received
Apr 5 14:23:32 ar213-FRA bgpd[21086]: neighbor 172.16.1.18: state change
OpenConfirm -> Established, reason: KEEPALIVE message received
Apr 5 14:23:32 ar213-FRA bgpd[1567]: nexthop 172.16.1.18 now valid:
directly connected
Apr 5 14:28:31 ar213-FRA bgpd[6637]: fatal in RDE: attr_diff: equal
attributes encountered
Apr 5 14:28:31 ar213-FRA bgpd[1567]: Lost child: route decision engine
exited
Apr 5 14:28:31 ar213-FRA bgpd[21086]: fatal in SE: session_dispatch_imsg:
pipe closed: Connection refused
Apr 5 14:28:31 ar213-FRA bgpd[1567]: kernel routing table decoupled
Apr 5 14:28:31 ar213-FRA bgpd[1567]: Terminating
ar213-FRA#
--
Tony Sarendal - [EMAIL PROTECTED]
IP/Unix
-= The scorpion replied,
"I couldn't help it, it's my nature" =-