0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Serious bug in ext lsa origination found. Going for 1.0.4.

This commit is contained in:
Ondrej Filip 2000-09-03 22:18:40 +00:00
parent f02e4258b9
commit fdb1998202
7 changed files with 40 additions and 11 deletions

View File

@ -1,6 +1,6 @@
Summary: BIRD Internet Routing Daemon
Name: bird
Version: 1.0.3
Version: 1.0.4
Release: 1
Copyright: GPL
Group: Networking/Daemons

View File

@ -123,7 +123,7 @@ htonlsab(void *h, void *n, u8 type, u16 len)
hrt=h;
links=hrt->links;
nrt->VEB=hrt->VEB;
nrt->veb.byte=hrt->veb.byte;
nrt->padding=0;
nrt->links=htons(hrt->links);
nrtl=(struct ospf_lsa_rt_link *)(nrt+1);
@ -220,7 +220,7 @@ ntohlsab(void *n, void *h, u8 type, u16 len)
nrt=n;
hrt=h;
hrt->VEB=nrt->VEB;
hrt->veb.byte=nrt->veb.byte;
hrt->padding=0;
links=hrt->links=ntohs(nrt->links);
nrtl=(struct ospf_lsa_rt_link *)(nrt+1);

View File

@ -164,6 +164,7 @@ ospf_init(struct proto_config *c)
p->rte_same = ospf_rte_same;
po->rfc1583=oc->rfc1583;
po->ebit=0;
return p;
}

View File

@ -209,8 +209,20 @@ struct ospf_lsa_header {
u16 length;
};
struct vebb {
u8 b:1;
u8 e:1;
u8 v:1;
u8 padding:5;
};
union veb {
u8 byte;
struct vebb bit;
};
struct ospf_lsa_rt {
u8 VEB;
union veb veb;
#define LSA_RT_V 5
#define LSA_RT_E 6
#define LSA_RT_B 7
@ -375,7 +387,8 @@ struct proto_ospf {
list area_list;
int areano; /* Number of area I belong to */
struct fib efib; /* FIB for external routes */
int rfc1583;
int rfc1583; /* RFC1583 compatibility */
int ebit; /* Did I originate any ext lsa? */
};
struct ospf_iface_patt {

View File

@ -96,7 +96,7 @@ ospf_rt_spfa(struct ospf_area *oa)
{
case LSA_T_RT:
rt=(struct ospf_lsa_rt *)act->lsa_body;
if((rt->VEB)&(1>>LSA_RT_V)) oa->trcap=1;
if(rt->veb.bit.v) oa->trcap=1;
rr=(struct ospf_lsa_rt_link *)(rt+1);
DBG(" Number of links: %u\n",rt->links);
for(i=0;i<rt->links;i++)
@ -269,6 +269,7 @@ ospf_ext_spfa(struct proto_ospf *po) /* FIXME looking into inter-area */
struct proto *p=&po->proto;
struct ospf_lsa_ext *le;
struct ospf_lsa_ext_tos *lt;
struct ospf_lsa_rt *rt;
int mlen;
ip_addr ip,nnh;
struct iface *nnhi=NULL;
@ -347,7 +348,8 @@ ospf_ext_spfa(struct proto_ospf *po) /* FIXME looking into inter-area */
}
}
}
if((absr==NULL)||(absr->dist==LSINFINITY))
rt=(struct ospf_lsa_rt *)absr->lsa_body;
if((absr==NULL)||(absr->dist==LSINFINITY)||(rt->veb.bit.e==0))
{
DBG("ASBR is null or its dist=INF\n");
continue;

View File

@ -24,7 +24,7 @@ void *
originate_rt_lsa_body(struct ospf_area *oa, u16 *length, struct proto_ospf *p)
{
struct ospf_iface *ifa;
int j=0,k=0,v=0,e=0,b=0;
int j=0,k=0,v=0;
u16 i=0;
struct ospf_lsa_rt *rt;
struct ospf_lsa_rt_link *ln;
@ -45,8 +45,9 @@ originate_rt_lsa_body(struct ospf_area *oa, u16 *length, struct proto_ospf *p)
}
rt=mb_allocz(p->proto.pool, sizeof(struct ospf_lsa_rt)+
i*sizeof(struct ospf_lsa_rt_link));
if((p->areano>1) && (!oa->stub)) e=1;
rt->VEB=(v>>LSA_RT_V)+(e>>LSA_RT_E)+(b>>LSA_RT_B);
if((p->areano>1) && (!oa->stub)) rt->veb.bit.b=1;
if((p->ebit)&&(!oa->stub)) rt->veb.bit.e=1;
rt->veb.bit.v=v;
ln=(struct ospf_lsa_rt_link *)(rt+1);
WALK_LIST (ifa, p->iface_list)
@ -352,6 +353,9 @@ originate_ext_lsa_body(net *n, rte *e, struct proto_ospf *po, struct ea_list *at
* external LSA. LSA header of such LSA does not contain information about
* prefix lenght, so if I have to originate multiple LSAs for route with
* different prefixes I try to increment prefix id to find a "free" one.
*
* The function also set flag ebit. If it's first time, the new router lsa
* origination is necessary.
*/
void
originate_ext_lsa(net *n, rte *e, struct proto_ospf *po, struct ea_list *attrs)
@ -406,6 +410,15 @@ originate_ext_lsa(net *n, rte *e, struct proto_ospf *po, struct ea_list *attrs)
body=originate_ext_lsa_body(n, e, po, attrs);
}
mb_free(body);
if(po->ebit==0)
{
po->ebit=1;
WALK_LIST(oa, po->area_list)
{
schedule_rt_lsa(oa);
}
}
}

View File

@ -7,7 +7,7 @@
#define _BIRD_CONFIG_H_
/* BIRD version */
#define BIRD_VERSION "1.0.3"
#define BIRD_VERSION "1.0.4"
/* Include parameters determined by configure script */
#include "sysdep/autoconf.h"