Commit a9118da6 authored by Bernard Metzler's avatar Bernard Metzler Committed by Liu Jian
Browse files

RDMA/siw: Enable siw on tunnel devices

mainline inclusion
from mainline-v5.19-rc1
commit a2d36b02
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBI67U
CVE: CVE-2024-57857

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a2d36b02c15d49cec1f5a44c5123bb7f3bdfea8e

-------------------------------------------------

Enable siw to attach to tunnel devices, there is no reason not to, siw
properly generates all packets already.

Link: https://lore.kernel.org/r/20220510143917.23735-1-bmt@zurich.ibm.com


Tested-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarBernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
parent df1d0f90
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ static int siw_dev_qualified(struct net_device *netdev)
	 * <linux/if_arp.h> for type identifiers.
	 */
	if (netdev->type == ARPHRD_ETHER || netdev->type == ARPHRD_IEEE802 ||
	    netdev->type == ARPHRD_NONE ||
	    (netdev->type == ARPHRD_LOOPBACK && loopback_enabled))
		return 1;

@@ -315,12 +316,12 @@ static struct siw_device *siw_device_create(struct net_device *netdev)

	sdev->netdev = netdev;

	if (netdev->type != ARPHRD_LOOPBACK) {
	if (netdev->type != ARPHRD_LOOPBACK && netdev->type != ARPHRD_NONE) {
		addrconf_addr_eui48((unsigned char *)&base_dev->node_guid,
				    netdev->dev_addr);
	} else {
		/*
		 * The loopback device does not have a HW address,
		 * This device does not have a HW address,
		 * but connection mangagement lib expects gid != 0
		 */
		size_t len = min_t(size_t, strlen(base_dev->name), 6);