Skip to content

Commit

Permalink
ip-address migration with missing rule for previous address.
Browse files Browse the repository at this point in the history
Summary:
During ip address migration on SSW, we hit a condition where the rule was missing in the kernel table for the previous address. When we try to replace it with new address, we remove the previous rule and address and add the new one. As the previous rule was not existing it was causing wedge_agent crash.

Fix here is to ignore the rule removal if it does not exist.

Reviewed By: msomasundaran

Differential Revision:
D62905031

Privacy Context Container: L1125642

fbshipit-source-id: ef801507b494105c81a57b1244e57733a754f0d8
  • Loading branch information
Jitendra Verma authored and facebook-github-bot committed Sep 18, 2024
1 parent 926d293 commit 88152db
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions fboss/agent/TunManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,27 @@ void TunManager::addRemoveSourceRouteRule(
} else {
error = rtnl_rule_delete(sock_, rule, 0);
}
nlCheckError(
error,
"Failed to ",
add ? "add" : "remove",
" rule for address ",
addr,
" to lookup table ",
getTableId(ifID),
" for interface ",
ifID);
XLOG(DBG2) << (add ? "Added" : "Removed") << " rule for address " << addr
<< " to lookup table " << getTableId(ifID) << " for interface "
<< ifID;
// There are scenarios where the rule has already been deleted and we try to
// delete it again. In that case, we can ignore the error.
if (!add && (error == -NLE_OBJ_NOTFOUND)) {
XLOG(WARNING) << "Rule not existing for address " << addr
<< " to lookup table " << getTableId(ifID)
<< " for interface " << ifID;
} else {
nlCheckError(
error,
"Failed to ",
add ? "add" : "remove",
" rule for address ",
addr,
" to lookup table ",
getTableId(ifID),
" for interface ",
ifID);
XLOG(DBG2) << (add ? "Added" : "Removed") << " rule for address " << addr
<< " to lookup table " << getTableId(ifID) << " for interface "
<< ifID;
}
}

void TunManager::addRemoveTunAddress(
Expand Down

0 comments on commit 88152db

Please sign in to comment.