mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 05:58:17 +00:00
bgpd: Improve flag error messages in bgp_attr_aspath
* bgpd/bgp_attr.c: (bgp_attr_aspath) error message could be misleading, clearly log what flag was incorrect. (Problem noted in "bgpd: fix error message in bgp_attr_aspath()" in Quagga-RE)
This commit is contained in:
parent
9ed79b53eb
commit
83a9a2213a
@ -867,7 +867,7 @@ bgp_attr_aspath (struct peer *peer, bgp_size_t length,
|
|||||||
|
|
||||||
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
|
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
|
||||||
|
|
||||||
/* Flag check. */
|
/* Flags check. */
|
||||||
if (CHECK_FLAG (flag, BGP_ATTR_FLAG_PARTIAL))
|
if (CHECK_FLAG (flag, BGP_ATTR_FLAG_PARTIAL))
|
||||||
{
|
{
|
||||||
zlog (peer->log, LOG_ERR,
|
zlog (peer->log, LOG_ERR,
|
||||||
@ -877,11 +877,20 @@ bgp_attr_aspath (struct peer *peer, bgp_size_t length,
|
|||||||
startp, total);
|
startp, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL)
|
if (!CHECK_FLAG (flag, BGP_ATTR_FLAG_TRANS))
|
||||||
|| ! CHECK_FLAG (flag, BGP_ATTR_FLAG_TRANS))
|
{
|
||||||
|
zlog (peer->log, LOG_ERR,
|
||||||
|
"AS_PATH attribute must be flagged as \"transitive\" (%u)", flag);
|
||||||
|
return bgp_attr_malformed (peer, BGP_ATTR_AS_PATH, flag,
|
||||||
|
BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
|
||||||
|
startp, total);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL))
|
||||||
{
|
{
|
||||||
zlog (peer->log, LOG_ERR,
|
zlog (peer->log, LOG_ERR,
|
||||||
"As-Path attribute flag isn't transitive %d", flag);
|
"AS_PATH attribute must not be flagged as \"optional\" (%u)", flag);
|
||||||
|
|
||||||
return bgp_attr_malformed (peer, BGP_ATTR_AS_PATH, flag,
|
return bgp_attr_malformed (peer, BGP_ATTR_AS_PATH, flag,
|
||||||
BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
|
BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
|
||||||
startp, total);
|
startp, total);
|
||||||
|
Loading…
Reference in New Issue
Block a user