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:28:01 +0400
commitbbb04bf3bb03be27fbf17b6b3ee903b168201cf0 (patch)
tree8db00c5a6db16254146e064bfb350f536cc90e02 /bgpd
parentabc384f85b622471ef5ba6c86acc540856da05cf (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 a60bb8e5..d7eeec1f 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1360,7 +1360,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);
@@ -1399,7 +1399,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);
@@ -1448,7 +1448,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);
@@ -1596,7 +1596,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);