Fixed broadcast address and BPI handling for address abbreviation

and propagation.
This commit is contained in:
gardners 2012-04-14 06:58:36 +09:30
parent 283b29af6b
commit 7928de5b01
2 changed files with 10 additions and 1 deletions

View File

@ -245,6 +245,14 @@ int overlay_abbreviate_address(unsigned char *in,unsigned char *out,int *ofs)
for(i=0;i<SID_SIZE;i++) if (in[i]!=overlay_abbreviate_previous_address.b[i]) break;
if (i==SID_SIZE) { out[(*ofs)++]=OA_CODE_PREVIOUS; return 0; }
/* Is it a broadcast address? */
if (overlay_address_is_broadcast(in)) {
/* write broadcast code followed by 64bit BPI tail */
out[(*ofs)++]=OA_CODE_BROADCAST;
for(i=0;i<8;i++) out[(*ofs)++]=in[24+i];
return 0;
}
if (!abbrs) {
// Abbreviation table not setup, so allocate it.
// Epoch starts at zero.

View File

@ -84,7 +84,8 @@ int overlay_frame_package_fmt1(overlay_frame *p,overlay_buffer *b)
if (overlay_broadcast_drop_check(p->destination))
return WHY("This broadcast packet ID has been seen recently");
int i;
for(i=0;i<SID_SIZE;i++) p->nexthop[i]=0xff;
/* Copy the broadcast address exactly so that we preserve the BPI */
for(i=0;i<SID_SIZE;i++) p->nexthop[i]=p->destination[i];
p->nexthop_address_status=OA_RESOLVED;
} else {
if (overlay_get_nexthop((unsigned char *)p->destination,p->nexthop,&nexthoplen,&p->nexthop_interface)) {