-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[openssh]: Restore behavior of ClientAliveCountMax=0 #12549
Merged
saiarcot895
merged 2 commits into
sonic-net:master
from
saiarcot895:openssh-restore-client-alive-zero
Oct 31, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/openssh/patch/0002-Revert-commit-69334996-make-sshd_config-ClientAliveC.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 2bc575c74aa811a60682e989d07675b8e7ac8a12 Mon Sep 17 00:00:00 2001 | ||
From: Saikrishna Arcot <sarcot@microsoft.com> | ||
Date: Thu, 13 Oct 2022 13:45:17 -0700 | ||
Subject: [PATCH] Revert commit 69334996: make | ||
sshd_config:ClientAliveCountMax=0 disable the connection-killing behavior | ||
|
||
SONiC (and others) use this feature to kill connections when the session | ||
is idle after some duration of time. OpenSSH 8.2 defined setting | ||
ClientAliveCountMax=0, but by doing so, broke the current use case of | ||
it. | ||
|
||
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com> | ||
--- | ||
serverloop.c | 3 +-- | ||
sshd_config.5 | 3 --- | ||
2 files changed, 1 insertion(+), 5 deletions(-) | ||
|
||
diff --git a/serverloop.c b/serverloop.c | ||
index 48d936d..1b30498 100644 | ||
--- a/serverloop.c | ||
+++ b/serverloop.c | ||
@@ -184,8 +184,7 @@ client_alive_check(struct ssh *ssh) | ||
int r, channel_id; | ||
|
||
/* timeout, check to see how many we have had */ | ||
- if (options.client_alive_count_max > 0 && | ||
- ssh_packet_inc_alive_timeouts(ssh) > | ||
+ if (ssh_packet_inc_alive_timeouts(ssh) > | ||
options.client_alive_count_max) { | ||
sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); | ||
logit("Timeout, client not responding from %s", remote_id); | ||
diff --git a/sshd_config.5 b/sshd_config.5 | ||
index a555e7e..a5815d3 100644 | ||
--- a/sshd_config.5 | ||
+++ b/sshd_config.5 | ||
@@ -545,9 +545,6 @@ is set to 15, and | ||
.Cm ClientAliveCountMax | ||
is left at the default, unresponsive SSH clients | ||
will be disconnected after approximately 45 seconds. | ||
-Setting a zero | ||
-.Cm ClientAliveCountMax | ||
-disables connection termination. | ||
.It Cm ClientAliveInterval | ||
Sets a timeout interval in seconds after which if no data has been received | ||
from the client, | ||
-- | ||
2.25.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
0001-Put-style-as-line-number-to-ssh-session-environment-.patch | ||
0002-Revert-commit-69334996-make-sshd_config-ClientAliveC.patch |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is safe to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in fact, it is necessary. Prior to this commit, the broadcom build failed due to simultaneous package installations happening. There shouldn't be any package installations happening during builds (except those that
slave.mk
itself is doing).As per
git blame
, this line got added in the PR that added armhf crosscompile support. I'm not sure why it was added, or how I missed it in the PR review, or how the build has been working so well so far, but this shouldn't be here.