summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2011-10-18 14:20:04 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2011-10-19 17:27:07 +0400
commit7ebd47095b178e91c3c3ef514e0ddd0afe1a97a9 (patch)
tree3a922d4ecbc5bf60dade43c86ad2a636707b519c /bgpd
parent89a7fd150d2408e4c6fe853a3461aa23a16d9111 (diff)
bgpd: fix more regressions in attr flag checks
Commit 05a4936b713b9882171d0f7fb20b8439df23939e fixed some of the attributes involved, but not all. This commit should do it. * bgp_attr.c * bgp_attr_originator_id() * bgp_attr_cluster_list() * bgp_mp_reach_parse() * bgp_mp_unreach_parse()
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_attr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 6b5d8191..dae895d7 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1302,7 +1302,7 @@ bgp_attr_originator_id (struct peer *peer, bgp_size_t length,
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
/* Flag checks. */
- if (flag != BGP_ATTR_FLAG_OPTIONAL)
+ if ((flag & ~BGP_ATTR_FLAG_EXTLEN) != BGP_ATTR_FLAG_OPTIONAL)
{
if (! CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL))
zlog (peer->log, LOG_ERR, "ORIGINATOR_ID attribute must be flagged as \"optional\" (%u)", flag);
@@ -1341,7 +1341,7 @@ bgp_attr_cluster_list (struct peer *peer, bgp_size_t length,
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
/* Flag checks. */
- if (flag != BGP_ATTR_FLAG_OPTIONAL)
+ if ((flag & ~BGP_ATTR_FLAG_EXTLEN) != BGP_ATTR_FLAG_OPTIONAL)
{
if (! CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL))
zlog (peer->log, LOG_ERR, "CLUSTER_LIST attribute must be flagged as \"optional\" (%u)", flag);
@@ -1389,7 +1389,7 @@ bgp_mp_reach_parse (struct peer *peer, const bgp_size_t length,
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
/* Flag checks. */
- if (flag != BGP_ATTR_FLAG_OPTIONAL)
+ if ((flag & ~BGP_ATTR_FLAG_EXTLEN) != BGP_ATTR_FLAG_OPTIONAL)
{
if (! CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL))
zlog (peer->log, LOG_ERR, "MP_REACH_NLRI attribute must be flagged as \"optional\" (%u)", flag);
@@ -1536,7 +1536,7 @@ bgp_mp_unreach_parse (struct peer *peer, const bgp_size_t length,
total = length + (CHECK_FLAG (flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3);
/* Flag checks. */
- if (flag != BGP_ATTR_FLAG_OPTIONAL)
+ if ((flag & ~BGP_ATTR_FLAG_EXTLEN) != BGP_ATTR_FLAG_OPTIONAL)
{
if (! CHECK_FLAG (flag, BGP_ATTR_FLAG_OPTIONAL))
zlog (peer->log, LOG_ERR, "MP_UNREACH_NLRI attribute must be flagged as \"optional\" (%u)", flag);