Skip to content

Commit

Permalink
(Easy) Check for absence of link address, if not present set
Browse files Browse the repository at this point in the history
Summary:
In TG fib_nss was crashing when there was a neighbor up event with
'unreachable' state and empty MAC address.

Reviewed By: xiangxu1121

Differential Revision: D18410746

fbshipit-source-id: ddce06c4dba8d6fcff8af709ddafa447ab411f11
  • Loading branch information
Mahesh Maddikayala authored and facebook-github-bot committed Nov 11, 2019
1 parent 7d26b5f commit e1f3592
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions openr/platform/PlatformPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <openr/common/NetworkUtil.h>
#include <openr/if/gen-cpp2/Network_types.h>

using apache::thrift::CompactSerializer;
using apache::thrift::FRAGILE;

namespace openr {
Expand Down Expand Up @@ -105,10 +106,13 @@ PlatformPublisher::addrEventFunc(
const std::string& ifName,
const openr::fbnl::IfAddress& addrEntry) noexcept {
VLOG(4) << "Handling Address Event in NetlinkSystemHandler...";
thrift::IpPrefix prefix{};
publishAddrEvent(thrift::AddrEntry(
FRAGILE,
ifName,
toIpPrefix(addrEntry.getPrefix().value()),
addrEntry.getPrefix().hasValue()
? toIpPrefix(addrEntry.getPrefix().value())
: prefix,
addrEntry.isValid()));
}

Expand All @@ -121,7 +125,9 @@ PlatformPublisher::neighborEventFunc(
FRAGILE,
ifName,
toBinaryAddress(neighborEntry.getDestination()),
neighborEntry.getLinkAddress().value().toString(),
neighborEntry.getLinkAddress().hasValue()
? neighborEntry.getLinkAddress().value().toString()
: "",
neighborEntry.isReachable()));
}

Expand Down

0 comments on commit e1f3592

Please sign in to comment.