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);
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);
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
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 {
{
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++)
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;
}
}
}
- 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;
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;
}
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)
* 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)
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);
+ }
+ }
}