Fixes BGPv6 bug - missing endianity conversion.

Also removes code skipping SNPAs
(obsoleted by newer RFCs, should be ignored).
This commit is contained in:
Ondrej Zajicek 2009-04-23 23:15:07 +02:00
parent f307842ad8
commit 64cf11f544

View file

@ -777,19 +777,14 @@ bgp_do_rx_update(struct bgp_conn *conn,
/* Create fake NEXT_HOP attribute */ /* Create fake NEXT_HOP attribute */
if (len < 1 || (*x != 16 && *x != 32) || len < *x + 2) if (len < 1 || (*x != 16 && *x != 32) || len < *x + 2)
goto bad; goto bad;
memcpy(bgp_attach_attr_wa(&a0->eattrs, bgp_linpool, BA_NEXT_HOP, 16), x+1, 16);
len -= *x + 2;
x += *x + 1;
/* Ignore SNPA info */ byte *nh = bgp_attach_attr_wa(&a0->eattrs, bgp_linpool, BA_NEXT_HOP, 16);
i = *x++; memcpy(nh, x+1, 16);
while (i--) ipa_ntoh(*(ip_addr *)nh);
{
if (len < 1 || len < 1 + *x) /* Also ignore one reserved byte */
goto bad; len -= *x + 2;
len -= *x + 1; x += *x + 2;
x += *x + 1;
}
if (bgp_get_nexthop(p, a0)) if (bgp_get_nexthop(p, a0))
{ {