Skip to content

Commit

Permalink
Katran config to specify cleanup on shutdown
Browse files Browse the repository at this point in the history
Summary: I'm adding a member `cleanupOnShutdown` that determines whether we detach the BPF programs on shutdown.

Reviewed By: lima1756

Differential Revision: D56335292

fbshipit-source-id: 1a8f6dc84c6513b871c3d0ceb27eb384834c4416
  • Loading branch information
Aman Sharma authored and facebook-github-bot committed Apr 19, 2024
1 parent 6b0664f commit a7c267b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion katran/lib/KatranLb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ KatranLb::KatranLb(
}

KatranLb::~KatranLb() {
if (!config_.testing && progsAttached_) {
if (!config_.testing && progsAttached_ && config_.cleanupOnShutdown) {
int res;
auto mainIfindex = ctlValues_[kMainIntfPos].ifindex;
auto hcIfindex = ctlValues_[kHcIntfPos].ifindex;
Expand Down
1 change: 1 addition & 0 deletions katran/lib/KatranLbStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ struct KatranConfig {
bool enableCidV3 = false;
uint32_t mainInterfaceIndex = kUnspecifiedInterfaceIndex;
uint32_t hcInterfaceIndex = kUnspecifiedInterfaceIndex;
bool cleanupOnShutdown = true;
};

/**
Expand Down

0 comments on commit a7c267b

Please sign in to comment.