As is already being done for the framebuffer console, suppress log messages when the device is briefly opened via echo.
Otherwise, a netconsole not activated for a CONSOLE_STD* stream, would each time result in a log message. We do not replay the dmesg, because if the output path works, the remote side should be able to input a dmesg command. This is unlike fbconsole, which has no input. Signed-off-by: Ahmad Fatoum <[email protected]> --- net/netconsole.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/netconsole.c b/net/netconsole.c index f2e9447526bf..62dd60806ebd 100644 --- a/net/netconsole.c +++ b/net/netconsole.c @@ -118,7 +118,8 @@ static int nc_open(struct console_device *cdev, unsigned activate) net_udp_bind(priv->con, priv->port); - pr_info("netconsole initialized with %pI4:%d\n", &priv->ip, priv->port); + if (activate) + pr_info("netconsole initialized with %pI4:%d\n", &priv->ip, priv->port); return 0; } -- 2.47.3
