From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F0DF42D75C for ; Mon, 10 Aug 2026 16:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786380476; cv=none; b=SMq+Pm3tl9tzHTua1RqRPdFxJ2PwsbLJ5kYuvtbqUlP5XbGfFGtQDLv3K+R2YXkq3RCMnfuAVtpZrJLOEjlEmG9dw/F2GhXxsq3qqBIEya7/faOjxfEH8873QDPJnwWGTKHI3+2eAuwQmoVFivEDs73vl7THVLhaUk1/YmkDSiM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786380476; c=relaxed/simple; bh=Nf8019ikvXpuawmVRnTiH/eAUfA2qq1dCBgswbuW8v0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XWEfkRc3nx9A1vv7n4n1S0N2UohFKqsAx/CfEJS1+E9MG/tDRBuMo7Zl7I+ewvLQvsflpLA4FTOdp2ecQu7e4P1mkWwDJ+7kI3XjLl1zoNpEYrVq7JikIsn812MstY6xBQ8Tc642I2vaD+FbpVds//eXNMsuJogda4mRQbhJAZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pqus/4u2; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pqus/4u2" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4996c452e95so740285e9.0 for ; Mon, 10 Aug 2026 09:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786380472; x=1786985272; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Dwa/MBE6L/+MukVwCaR5+lFDiikCNLSp9oEd4ORAtSk=; b=pqus/4u2Bhb+RNQdsN07NmCAea9L+1OrkbclnCd2o/VNDSdemzSJd4hF76JngKfiyc cA+MnURyl8NETEdnjcjTKZAEy9X4pw5KiOznYpehr0K3UulG4QGnNrvrrxNJ0UkRKTo3 HnCA6e9J+ZV9EKvMygT23gVmIiC1NHixNvPzgRYt5tyQDsJNk7SXQSfrnIK8x5nlbxk6 R5uwIljG1N3c9y/BB5UNXa+ctRwxnCn6n2JmnK5dMS7mSyrWast8ZybhMQQdC+N1C4JI qFI4eb3NNx72hsrL3ZNVHHiNZamW0IMlDByJOy/ooNaK8N9ALof0RiR3MVeP9+DgNZTf AWkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786380472; x=1786985272; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Dwa/MBE6L/+MukVwCaR5+lFDiikCNLSp9oEd4ORAtSk=; b=a6ZP3UpRMUkLH6BCLwJFqCVeQbQKSBfr/z2Roos0yZ1Bss9l6UvLm3vz82akSacETl 7esqyO2SSGNqnbIvHCsqOG6D1e05EPnydi6y8gM+yWBIUqKQzJEuSNitj4LWKkYFRjqi OX+eyE2kKLwnhzStXQ7I9J894oiw+FqLvTes+r3ijTs5P80iN0H2lV/lufLHY9JcUiwi JB8R+VnDV34QPg/VSAbtUCt43SxMSEEh8xIeofSe+WGiKixAbie19kalsKcwsJQlkt+y 64iX5Jp2j0kr8E6/voW68sonbOKVqsIC++42w5VO3pI/bdzbDdP4AtxhQ2sin6xK5jBj QE7g== X-Forwarded-Encrypted: i=1; AHgh+RocdyImOfDTgCcpD1jsvYkRiAbqOMVSe+kqwH+Fq7SOYhNslMeoQYazVoj3GAcpfy/taDxRHzg6lc6O/ME=@vger.kernel.org X-Gm-Message-State: AOJu0YxoCiucicK4OPoqP8l86OwtBLDYUnOxbB9E60t5n6uKAlnBpHPF DDc0M4YZjeWfHLY7n9bAji2t7gq/tHPR5smsRkfyHgpjTOSAnsiOGsZX X-Gm-Gg: AR+sD10YBjGGG0UkusibrE7iTXcW0hm7osCQEBnl/eGBh7ZC9bJILBg7Qe389s/4cGW 36KknEoXnw0qq6cnzdctFDTRWfA03aFGUFbStyIwz7Xs8w5cNH+3lHMQm0tR7gbK9gJBhzim0s6 MDYcfboEA0XS5F8OBlOmITZavHwxw4f55wLnIx303nRibvt0tsR0I+l7MljO6QkEtkWR6RTybZV D/FJ5shD37Zn6XzePaCsRlugIdyV8HJc8XR7HWpNxVJ6zcwJ3jImQICevMiUoQxkAMF6d5/KrJW RpINofmmdL/PA5OZ0JOJ6VafD2maYWCQDnjvIFf0Cn6Bq/xtP8yz3PxeHdfHJ5J/aBiRM74Shc2 ljcZ6kNf3N2JnjRPucguZ3193QqEO+teE2ApH971i4ntGNU7H2PA3OwpzTXVHoDjaOz3ieWKmBU kvv2cslr+GOxOJFfs5lPXf5XiP9BtvnvotXfEjH1OuNgN4CN0ygBB/Tw== X-Received: by 2002:a05:6000:220d:b0:47e:96f2:52a8 with SMTP id ffacd0b85a97d-47fec4e31b9mr31500906f8f.1.1786380472224; Mon, 10 Aug 2026 09:47:52 -0700 (PDT) Received: from localhost ([2620:10d:c092:500::7:692b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021e8cd0sm35460643f8f.17.2026.08.10.09.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Aug 2026 09:47:51 -0700 (PDT) From: Gustavo Luiz Duarte Date: Mon, 10 Aug 2026 17:47:29 +0100 Subject: [PATCH net-next v2 5/6] netconsole: show empty string for an unset IP address Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260810-netcons_ipv6-v2-5-3d4fc987a90f@gmail.com> References: <20260810-netcons_ipv6-v2-0-3d4fc987a90f@gmail.com> In-Reply-To: <20260810-netcons_ipv6-v2-0-3d4fc987a90f@gmail.com> To: Breno Leitao , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Gustavo Luiz Duarte X-Mailer: b4 0.15.2 An unset address (local_ip/remote_ip), now denoted by AF_UNSPEC, currently shows "0.0.0.0" in configfs. Print an empty string instead, which is more clear. In netconsole_print_banner() we can be even more explicit about it, as we don't have the risk of userspace trying to parse it. Signed-off-by: Gustavo Luiz Duarte --- drivers/net/netconsole.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 054c39066043..0418031b6bc9 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -705,14 +705,18 @@ static void netconsole_print_banner(struct netconsole_target *nt) struct netpoll *np = &nt->np; np_info(np, "local port %d\n", nt->local_port); - if (nt->local_ip.family == AF_INET6) + if (nt->local_ip.family == AF_UNSPEC) + np_info(np, "local IP unset\n"); + else if (nt->local_ip.family == AF_INET6) np_info(np, "local IPv6 address %pI6c\n", &nt->local_ip.in6); else np_info(np, "local IPv4 address %pI4\n", &nt->local_ip.ip); np_info(np, "interface name '%s'\n", np->dev_name); np_info(np, "local ethernet address '%pM'\n", np->dev_mac); np_info(np, "remote port %d\n", nt->remote_port); - if (nt->remote_ip.family == AF_INET6) + if (nt->remote_ip.family == AF_UNSPEC) + np_info(np, "remote IP unset\n"); + else if (nt->remote_ip.family == AF_INET6) np_info(np, "remote IPv6 address %pI6c\n", &nt->remote_ip.in6); else np_info(np, "remote IPv4 address %pI4\n", &nt->remote_ip.ip); @@ -850,6 +854,8 @@ static ssize_t local_ip_show(struct config_item *item, char *buf) { struct netconsole_target *nt = to_target(item); + if (nt->local_ip.family == AF_UNSPEC) + return sysfs_emit(buf, "\n"); if (nt->local_ip.family == AF_INET6) return sysfs_emit(buf, "%pI6c\n", &nt->local_ip.in6); else @@ -860,6 +866,8 @@ static ssize_t remote_ip_show(struct config_item *item, char *buf) { struct netconsole_target *nt = to_target(item); + if (nt->remote_ip.family == AF_UNSPEC) + return sysfs_emit(buf, "\n"); if (nt->remote_ip.family == AF_INET6) return sysfs_emit(buf, "%pI6c\n", &nt->remote_ip.in6); else -- 2.55.0