Fixes bug in BGPv6 causing crash by checking missing attributes.
This commit is contained in:
parent
e366625c0e
commit
b9539e78d8
1 changed files with 10 additions and 8 deletions
|
@ -1359,9 +1359,12 @@ bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len, struct lin
|
||||||
mandatory = 1;
|
mandatory = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* If there is no (reachability) NLRI, we should exit now */
|
||||||
|
if (! mandatory)
|
||||||
|
return a;
|
||||||
|
|
||||||
/* Check if all mandatory attributes are present */
|
/* Check if all mandatory attributes are present */
|
||||||
if (mandatory)
|
|
||||||
{
|
|
||||||
for(i=0; i < ARRAY_SIZE(bgp_mandatory_attrs); i++)
|
for(i=0; i < ARRAY_SIZE(bgp_mandatory_attrs); i++)
|
||||||
{
|
{
|
||||||
code = bgp_mandatory_attrs[i];
|
code = bgp_mandatory_attrs[i];
|
||||||
|
@ -1371,7 +1374,6 @@ bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len, struct lin
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* When receiving attributes from non-AS4-aware BGP speaker,
|
/* When receiving attributes from non-AS4-aware BGP speaker,
|
||||||
* we have to reconstruct 4B AS_PATH and AGGREGATOR attributes
|
* we have to reconstruct 4B AS_PATH and AGGREGATOR attributes
|
||||||
|
|
Loading…
Reference in a new issue