NetBSD Problem Report #57959

From www@netbsd.org  Fri Feb 23 23:10:05 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A1ACA1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 23 Feb 2024 23:10:05 +0000 (UTC)
Message-Id: <20240223231004.42B651A923A@mollari.NetBSD.org>
Date: Fri, 23 Feb 2024 23:10:04 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: icmp6_reflect prints confusing error message to console without attribution
X-Send-Pr-Version: www-1.0

>Number:         57959
>Category:       kern
>Synopsis:       arp_llinfo_output prints confusing error message to console without attribution
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 23:15:00 +0000 2024
>Closed-Date:    Mon Mar 11 22:23:28 +0000 2024
>Last-Modified:  Mon Mar 11 22:23:28 +0000 2024
>Originator:     Taylor R Campbell
>Release:        10.0_RC3
>Organization:
The NdpBSD Foundation
>Environment:
NetBSD nanocons.local 10.0_RC3 NetBSD 10.0_RC3 (GENERIC64) #15: Wed Jan 17 05:31:14 UTC 2024  root@manticore.local:/usr/obj/10/evbarm64/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
I got this message on the console:

[ 2569129.504153] source can't be determined: dst=10.0.0.3

It is completely obscure what is going on here.  Grepping through the source code I find this message:

https://nxr.netbsd.org/xref/src/sys/netinet6/icmp6.c?r=1.255#2175

   2175 			char ip6buf[INET6_ADDRSTRLEN];
   2176 			nd6log(LOG_DEBUG,
   2177 			    "source can't be determined: "
   2178 			    "dst=%s, error=%d\n",
   2179 			    IN6_PRINT(ip6buf, &sin6.sin6_addr), e);
   2180 			goto bad;

I don't know if this is what caused it (and it seems unlikely because this prints IPv6 addresses, not IPv4 addresses), but if this nd6log call causes an unattributed message to appear on the console, it should be fixed so it at least says `nd6' or something somewhere in the message.
>How-To-Repeat:
no clue
>Fix:
Yes, please!

>Release-Note:

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/57959: icmp6_reflect prints confusing error message to console without attribution
Date: Sat, 24 Feb 2024 08:14:24 -0000 (UTC)

 campbell+netbsd@mumble.net writes:

 >It is completely obscure what is going on here.  Grepping through the source code I find this message:

 >https://nxr.netbsd.org/xref/src/sys/netinet6/icmp6.c?r=1.255#2175

 >   2175 			char ip6buf[INET6_ADDRSTRLEN];
 >   2176 			nd6log(LOG_DEBUG,
 >   2177 			    "source can't be determined: "
 >   2178 			    "dst=%s, error=%d\n",
 >   2179 			    IN6_PRINT(ip6buf, &sin6.sin6_addr), e);
 >   2180 			goto bad;


 It's arp, not nd6.

 static void 
 arp_llinfo_output(struct ifnet *ifp, __unused const union l3addr *daddr,
     const union l3addr *taddr, const uint8_t *tlladdr,
     const union l3addr *hsrc)
 {
 	...
                 if (sip.s_addr == INADDR_ANY) {
                         char ipbuf[INET_ADDRSTRLEN];

                         log(LOG_DEBUG, "source can't be "
                             "determined: dst=%s\n",
                             IN_PRINT(ipbuf, &tip));
                         return;
                 }
 	...
 }

 Maybe:

 --- if_arp.c    15 Nov 2022 10:47:39 -0000      1.311
 +++ if_arp.c    24 Feb 2024 08:13:54 -0000
 @@ -1355,8 +1355,8 @@ arp_llinfo_output(struct ifnet *ifp, __u
                 if (sip.s_addr == INADDR_ANY) {
                         char ipbuf[INET_ADDRSTRLEN];

 -                       log(LOG_DEBUG, "source can't be "
 -                           "determined: dst=%s\n",
 +                       log(LOG_DEBUG, "%s: source can't be "
 +                           "determined: dst=%s\n", __func__,
                             IN_PRINT(ipbuf, &tip));
                         return;
                 }

 to align with the other debug log messages.

From: "Michael van Elst" <mlelstv@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57959 CVS commit: src/sys/netinet
Date: Sat, 24 Feb 2024 21:39:06 +0000

 Module Name:	src
 Committed By:	mlelstv
 Date:		Sat Feb 24 21:39:05 UTC 2024

 Modified Files:
 	src/sys/netinet: if_arp.c

 Log Message:
 Attribute debug message.
 Fixes PR 57959


 To generate a diff of this commit:
 cvs rdiff -u -r1.311 -r1.312 src/sys/netinet/if_arp.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 01 Mar 2024 14:09:38 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-10, pullup-9, pullup-8


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Fri, 01 Mar 2024 15:17:08 +0000
State-Changed-Why:
pullup-10 #618

patch doesn't apply cleanly on netbsd-9, not worth it to me to pursue
further, maybe someone else wants to


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57959 CVS commit: [netbsd-10] src/sys/netinet
Date: Sun, 10 Mar 2024 19:07:42 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Mar 10 19:07:42 UTC 2024

 Modified Files:
 	src/sys/netinet [netbsd-10]: if_arp.c

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #618):

 	sys/netinet/if_arp.c: revision 1.312

 Attribute debug message.
 Fixes PR 57959


 To generate a diff of this commit:
 cvs rdiff -u -r1.311 -r1.311.2.1 src/sys/netinet/if_arp.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 11 Mar 2024 22:23:28 +0000
State-Changed-Why:
fixed and pulled up to 10, not worth trouble for <10


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.