several bgp/attrs.c questions
Alexander V. Chernikov
melifaro at yandex-team.ru
Thu Sep 1 16:05:38 CEST 2011
Hello list!
I've got several questions after some attribute code digging:
1) We're calling custom formatting function bgp_get_attr() with wrong
lentgh (attribute name is not taken into account).
This probably never will cause buffer overflow, but still: if we're
passing buffer length it should be real length.
Possible simple fix is in bgp_get_attr.diff
2) We know that either no extended attributes (route withdraw) or a pack
(ORIGIN, AS_PATH, NEXTHOP) of mandatory attributes
(and possibly some other) are passed within BGP UPDATE message. However
we're allocating ea_list
with single extended attribute on every BGP attribute we parse in
bgp_decode_attr(). Maybe we can pre-allocate more than one
attribute in ea_list ? Example implementation can be found in attached
bgp_attr_ea.diff
--
Alexander V. Chernikov
Yandex NOC
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bgp_get_attr.diff
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20110901/20ce503e/attachment.diff>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bgp_attr_ea.diff
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20110901/20ce503e/attachment-0001.diff>
More information about the Bird-users
mailing list