Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2022 23:09:39 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 13ec6858d64a - main - tcp_log_addr: ip is only used for INET.
Message-ID:  <202204132309.23DN9dji074661@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=13ec6858d64ae47b9c24e3d30dd578114729c9fa

commit 13ec6858d64ae47b9c24e3d30dd578114729c9fa
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:21 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:21 +0000

    tcp_log_addr: ip is only used for INET.
---
 sys/netinet/tcp_subr.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 348a8bb7151e..189e2cf26fa6 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -3917,13 +3917,12 @@ tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
 {
 	char *s, *sp;
 	size_t size;
-	struct ip *ip;
+#ifdef INET
+	struct ip *ip = (struct ip *)ip4hdr;
+#endif
 #ifdef INET6
-	const struct ip6_hdr *ip6;
-
-	ip6 = (const struct ip6_hdr *)ip6hdr;
+	const struct ip6_hdr *ip6 = (const struct ip6_hdr *)ip6hdr;
 #endif /* INET6 */
-	ip = (struct ip *)ip4hdr;
 
 	/*
 	 * The log line looks like this:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204132309.23DN9dji074661>