git: 78e6c3aacc7f - main - tcp: update error counter when dropping a packet due to bad source
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Mar 2023 01:37:46 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=78e6c3aacc7fb9181a0fd77dc0bdf4b29e2f1d3f commit 78e6c3aacc7fb9181a0fd77dc0bdf4b29e2f1d3f Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2023-03-28 01:37:15 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2023-03-28 01:37:15 +0000 tcp: update error counter when dropping a packet due to bad source Use the same counter that ip_input()/ip6_input() use for bad destination address. For IPv6 this is already heavily abused ip6s_badscope, which needs to be split into several separate error counters. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D39234 --- sys/netinet/tcp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 992f8ea16e3d..6cf14f2f1f7f 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -675,7 +675,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) KASSERT(!IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst), ("%s: unspecified destination v6 address", __func__)); if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { - /* XXX stat */ + IP6STAT_INC(ip6s_badscope); /* XXX */ goto drop; } iptos = IPV6_TRAFFIC_CLASS(ip6); @@ -745,7 +745,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) KASSERT(ip->ip_dst.s_addr != INADDR_ANY, ("%s: unspecified destination v4 address", __func__)); if (__predict_false(ip->ip_src.s_addr == INADDR_ANY)) { - /* XXX stat */ + IPSTAT_INC(ips_badaddr); goto drop; } }