Commit 8904eeb9 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'netconsole-allow-selection-of-egress-interface-via-mac-address'



Uday Shankar says:

====================
netconsole: allow selection of egress interface via MAC address

This series adds support for selecting a netconsole egress interface by
specifying the MAC address (in place of the interface name) in the
boot/module parameter.

Signed-off-by: default avatarUday Shankar <ushankar@purestorage.com>
====================

Link: https://patch.msgid.link/20250312-netconsole-v6-0-3437933e79b8@purestorage.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 34e5eded f8a10bed
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ following format::
	r             if present, prepend kernel version (release) to the message
	src-port      source for UDP packets (defaults to 6665)
	src-ip        source IP to use (interface address)
	dev           network interface (eth0)
	dev           network interface name (eth0) or MAC address
	tgt-port      port for logging agent (6666)
	tgt-ip        IP address for logging agent
	tgt-macaddr   ethernet MAC address for logging agent (broadcast)
@@ -64,6 +64,10 @@ or using IPv6::

 insmod netconsole netconsole=@/,@fd00:1:2:3::1/

or using a MAC address to select the egress interface::

   linux netconsole=4444@10.0.0.1/22:33:44:55:66:77,9353@10.0.0.2/12:34:56:78:9a:bc

It also supports logging to multiple remote agents by specifying
parameters for the multiple agents separated by semicolons and the
complete string enclosed in "quotes", thusly::
+1 −1
Original line number Diff line number Diff line
@@ -739,7 +739,7 @@ static ssize_t remote_mac_store(struct config_item *item, const char *buf,

	if (!mac_pton(buf, remote_mac))
		goto out_unlock;
	if (buf[3 * ETH_ALEN - 1] && buf[3 * ETH_ALEN - 1] != '\n')
	if (buf[MAC_ADDR_STR_LEN] && buf[MAC_ADDR_STR_LEN] != '\n')
		goto out_unlock;
	memcpy(nt->np.remote_mac, remote_mac, ETH_ALEN);

+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ static int brcm_nvram_read_post_process_macaddr(void *context, const char *id, i
{
	u8 mac[ETH_ALEN];

	if (bytes != 3 * ETH_ALEN - 1)
	if (bytes != MAC_ADDR_STR_LEN)
		return -EINVAL;

	if (!mac_pton(buf, mac))
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static int u_boot_env_read_post_process_ethaddr(void *context, const char *id, i
{
	u8 mac[ETH_ALEN];

	if (bytes != 3 * ETH_ALEN - 1)
	if (bytes != MAC_ADDR_STR_LEN)
		return -EINVAL;

	if (!mac_pton(buf, mac))
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@
#include <linux/skbuff.h>
#include <uapi/linux/if_ether.h>

/* XX:XX:XX:XX:XX:XX */
#define MAC_ADDR_STR_LEN (3 * ETH_ALEN - 1)

static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
{
	return (struct ethhdr *)skb_mac_header(skb);
Loading