Skip to content

Commit

Permalink
debug: fix ipv6 for ssh
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa authored and eriknordmark committed Jul 9, 2024
1 parent 4c0c966 commit 9253ceb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ RUN gpg --import RELEASE_KEY.asc || :
RUN gpg --verify openssh-${OPENSSH_VERSION}.tar.gz.asc openssh-${OPENSSH_VERSION}.tar.gz
RUN tar xvf openssh-${OPENSSH_VERSION}.tar.gz
WORKDIR /usr/src/openssh-${OPENSSH_VERSION}
COPY ssh/fix-utmpx-ipv6.patch .
RUN git apply fix-utmpx-ipv6.patch
RUN ./configure \
--prefix=/usr \
--sysconfdir=/etc/ssh \
Expand Down
33 changes: 33 additions & 0 deletions pkg/debug/ssh/fix-utmpx-ipv6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From: Christoph Ostarek <christoph@zededa.com>
Date: Tue, 2 Jul 2024 12:53:13 +0000
Subject: [PATCH] fix ipv6 utmpx

see also https://git.alpinelinux.org/aports/tree/main/openssh/fix-utmp.patch
---
loginrec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/loginrec.c b/loginrec.c
index 4f21499..9d45670 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -741,7 +741,7 @@ set_utmpx_time(struct logininfo *li, struct utmpx *utx)
void
construct_utmpx(struct logininfo *li, struct utmpx *utx)
{
-# ifdef HAVE_ADDR_V6_IN_UTMP
+# ifdef HAVE_ADDR_V6_IN_UTMPX
struct sockaddr_in6 *sa6;
# endif
memset(utx, '\0', sizeof(*utx));
@@ -787,7 +787,7 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
if (li->hostaddr.sa.sa_family == AF_INET)
utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr;
# endif
-# ifdef HAVE_ADDR_V6_IN_UTMP
+# ifdef HAVE_ADDR_V6_IN_UTMPX
/* this is just a 128-bit IPv6 address */
if (li->hostaddr.sa.sa_family == AF_INET6) {
sa6 = ((struct sockaddr_in6 *)&li->hostaddr.sa);
--
2.36.2

0 comments on commit 9253ceb

Please sign in to comment.