Skip to content

Commit

Permalink
Fixed ACL IP type parser. (sonic-net#715)
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
  • Loading branch information
nazariig authored and lguohan committed Jan 16, 2019
1 parent 85f6322 commit fd2eb4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,11 @@ bool AclRule::validateAddMatch(string attr_name, string attr_value)
}
else if (attr_name == MATCH_IP_TYPE)
{
if (!processIpType(attr_value, value.aclfield.data.u32))
if (!processIpType(attr_value, value.aclfield.data.s32))
{
SWSS_LOG_ERROR("Invalid IP type %s", attr_value.c_str());
return false;
}

value.aclfield.mask.u32 = 0xFFFFFFFF;
}
else if (attr_name == MATCH_TCP_FLAGS)
{
Expand Down Expand Up @@ -365,7 +363,7 @@ bool AclRule::validateAddMatch(string attr_name, string attr_value)
return true;
}

bool AclRule::processIpType(string type, sai_uint32_t &ip_type)
bool AclRule::processIpType(string type, sai_int32_t &ip_type)
{
SWSS_LOG_ENTER();

Expand Down
2 changes: 1 addition & 1 deletion orchagent/aclorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class AclRule
virtual bool validateAddMatch(string attr_name, string attr_value);
virtual bool validateAddAction(string attr_name, string attr_value) = 0;
virtual bool validate() = 0;
bool processIpType(string type, sai_uint32_t &ip_type);
bool processIpType(string type, sai_int32_t &ip_type);
inline static void setRulePriorities(sai_uint32_t min, sai_uint32_t max)
{
m_minPriority = min;
Expand Down

0 comments on commit fd2eb4b

Please sign in to comment.