Skip to content

Commit

Permalink
Allow IPv4 link-local nexthops (sonic-net#1903)
Browse files Browse the repository at this point in the history
*Orchagent (NeighOrch) currently ignores IPv4 link-local neighbours. Any route pointing to such a nexthop is not added to the ASIC DB. Such routes are expected and should be supported.
Signed-off-by: Utpal Kant Pintoo [email protected]
  • Loading branch information
utpalkantpintoo authored Feb 28, 2022
1 parent 7d2942f commit 18c73a1
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,19 +685,6 @@ void NeighOrch::doTask(Consumer &consumer)

IpAddress ip_address(key.substr(found+1));

/* Verify Ipv4 LinkLocal and skip neighbor entry added for RFC5549 */
if ((ip_address.getAddrScope() == IpAddress::LINK_SCOPE) && (ip_address.isV4()))
{
/* Check if this prefix is not a configured ip, if so allow */
IpPrefix ipll_prefix(ip_address.getV4Addr(), 16);
if (!m_intfsOrch->isPrefixSubnet (ipll_prefix, alias))
{
SWSS_LOG_NOTICE("Skip IPv4LL neighbor %s, Intf:%s op: %s ", ip_address.to_string().c_str(), alias.c_str(), op.c_str());
it = consumer.m_toSync.erase(it);
continue;
}
}

NeighborEntry neighbor_entry = { ip_address, alias };

if (op == SET_COMMAND)
Expand Down Expand Up @@ -807,6 +794,18 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress
memcpy(neighbor_attr.value.mac, macAddress.getMac(), 6);
neighbor_attrs.push_back(neighbor_attr);

if ((ip_address.getAddrScope() == IpAddress::LINK_SCOPE) && (ip_address.isV4()))
{
/* Check if this prefix is a configured ip, if not allow */
IpPrefix ipll_prefix(ip_address.getV4Addr(), 16);
if (!m_intfsOrch->isPrefixSubnet (ipll_prefix, alias))
{
neighbor_attr.id = SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE;
neighbor_attr.value.booldata = 1;
neighbor_attrs.push_back(neighbor_attr);
}
}

MuxOrch* mux_orch = gDirectory.get<MuxOrch*>();
bool hw_config = isHwConfigured(neighborEntry);

Expand Down

0 comments on commit 18c73a1

Please sign in to comment.