mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-09 12:48:43 +00:00
Another LSack update. It's still NOT correct and it surely
kills gated or Cyclades OSPF implementation. :-)
This commit is contained in:
parent
67315ef64e
commit
023f5e86eb
@ -17,6 +17,8 @@ ospf_lsack_direct_tx(struct ospf_neighbor *n,struct ospf_lsa_header *h)
|
||||
sock *sk=n->ifa->ip_sk;
|
||||
u16 len;
|
||||
|
||||
DBG("Sending direct ACK to %I\n",n->rid);
|
||||
|
||||
pk=(struct ospf_lsack_packet *)sk->tbuf;
|
||||
op=(struct ospf_packet *)sk->tbuf;
|
||||
|
||||
@ -38,7 +40,7 @@ ospf_lsa_delay(struct ospf_neighbor *n,struct ospf_lsa_header *h,
|
||||
no=mb_alloc(p->pool,sizeof(struct lsah_n));
|
||||
memcpy(&no->lsa,h,sizeof(struct ospf_lsa_header));
|
||||
add_tail(&n->ackl, NODE no);
|
||||
|
||||
DBG("Adding delay ack for %I\n",n->rid);
|
||||
}
|
||||
|
||||
void
|
||||
@ -59,6 +61,8 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
|
||||
struct lsah_n *no;
|
||||
struct ospf_iface *ifa=n->ifa;
|
||||
|
||||
DBG("Sending delay ack to %I\n", n->rid);
|
||||
|
||||
if(ifa->type==OSPF_IT_BCAST)
|
||||
{
|
||||
sk=ifa->hello_sk;
|
||||
@ -79,8 +83,10 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
|
||||
no=(struct lsah_n *)HEAD(n->ackl);
|
||||
memcpy(h+i,&no->lsa, sizeof(struct ospf_lsa_header));
|
||||
i++;
|
||||
rem_node(NODE n);
|
||||
if((i*sizeof(struct ospf_lsa_header)+sizeof(struct ospf_lsack_packet)-SIPH)>
|
||||
DBG("Iter %u ID: %I, RT: %I, Type: %u\n",i, ntohl((h+i)->id),
|
||||
ntohl((h+i)->rt),(h+i)->type);
|
||||
rem_node(NODE no);
|
||||
if((i*sizeof(struct ospf_lsa_header)+sizeof(struct ospf_lsack_packet)+SIPH)>
|
||||
n->ifa->iface->mtu)
|
||||
{
|
||||
if(!EMPTY_LIST(n->ackl))
|
||||
@ -88,6 +94,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
|
||||
len=sizeof(struct ospf_lsack_packet)+i*sizeof(struct ospf_lsa_header);
|
||||
op->length=htons(len);
|
||||
ospf_pkt_finalize(n->ifa, op);
|
||||
DBG("Sending! Len=%u\n",len);
|
||||
if(ifa->type==OSPF_IT_BCAST)
|
||||
{
|
||||
if((ifa->state==OSPF_IS_DR)||(ifa->state==OSPF_IS_BACKUP))
|
||||
@ -103,9 +110,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
|
||||
{
|
||||
sk_send_to_agt(sk, len, ifa, NEIGHBOR_EXCHANGE);
|
||||
}
|
||||
|
||||
fill_ospf_pkt_hdr(n->ifa, pk, LSUPD);
|
||||
h=(struct ospf_lsa_header *)(pk+1);
|
||||
i=0;
|
||||
}
|
||||
}
|
||||
@ -114,6 +119,7 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
|
||||
len=sizeof(struct ospf_lsack_packet)+i*sizeof(struct ospf_lsa_header);
|
||||
op->length=htons(len);
|
||||
ospf_pkt_finalize(n->ifa, op);
|
||||
DBG("Sending! Len=%u\n",len);
|
||||
if(ifa->type==OSPF_IT_BCAST)
|
||||
{
|
||||
if((ifa->state==OSPF_IS_DR)||(ifa->state==OSPF_IS_BACKUP))
|
||||
|
Loading…
Reference in New Issue
Block a user