forked from Mirror/frr
bgpd: add protection against too large opaque data structure
BGP opaque data shouldn't be larger than zebra's buffer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
a9bf0ff268
commit
b5bb70e377
|
@ -21,6 +21,9 @@
|
|||
#ifndef FRR_ROUTE_OPAQUE_H
|
||||
#define FRR_ROUTE_OPAQUE_H
|
||||
|
||||
#include "assert.h"
|
||||
#include "zclient.h"
|
||||
|
||||
#include "bgpd/bgp_aspath.h"
|
||||
#include "bgpd/bgp_community.h"
|
||||
#include "bgpd/bgp_lcommunity.h"
|
||||
|
@ -35,4 +38,7 @@ struct bgp_zebra_opaque {
|
|||
char lcommunity[LCOMMUNITY_SIZE * 30];
|
||||
};
|
||||
|
||||
static_assert(sizeof(struct bgp_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
|
||||
"BGP opaque data shouldn't be larger than zebra's buffer");
|
||||
|
||||
#endif /* FRR_ROUTE_OPAQUE_H */
|
||||
|
|
Loading…
Reference in a new issue