代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/fcoe-utils 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1e6837c8ce063399eeb9580104da33f807e15443 Mon Sep 17 00:00:00 2001
From: Chris Leech <[email protected]>
Date: Tue, 23 Mar 2021 11:16:06 -0700
Subject: [PATCH] Revert "Make gcc compiler happy about ifname string
truncation."
This change dropped the "." from between the physical interface name and
the vlan number, making fipvlan created vlan names incompatible with
fcoeadm commands that ended up calling get_pci_dev_from_netdev in
lib/sysfs_hba.c (fcoeadm -i). That requirement should be fixed, but for
now lets deal with the fipvlan naming regression.
safe_makevlan_name isn't doing anything that can't be handled by
checking the return from snprintf
This reverts commit eee875e6526786031ec916274deec92148677c38.
Signed-off-by: Chris Leech <[email protected]>
---
fipvlan.c | 34 +---------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
index c8a07339314..fe8d7955cc5 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -595,36 +595,6 @@ static int rtnl_listener_handler(struct nlmsghdr *nh, UNUSED void *arg)
return -1;
}
-static int
-safe_makevlan_name(char *vlan_name, size_t vsz,
- char *ifname, int vlan_num, char *suffix)
-{
- size_t ifsz = strlen(ifname);
- size_t susz = strlen(suffix); /* should never be NULL */
- int nusz;
- char numbuf[16];
- char *cp = vlan_name;
-
- nusz = snprintf(numbuf, sizeof(numbuf), "%d", vlan_num);
-
- if ((ifsz + susz + nusz + 2) > vsz) {
- FIP_LOG_ERR(EINVAL,
- "Cannot make VLAN name from ifname=\"%s\", vlan %d, and suffix=\"%s\"\n",
- ifname, vlan_num, suffix);
- return -EINVAL;
- }
- memcpy(cp, ifname, ifsz);
- cp += ifsz;
- memcpy(cp, numbuf, nusz);
- cp += nusz;
- if (susz > 0) {
- memcpy(cp, suffix, susz);
- cp += susz;
- }
- *cp = '\0';
- return 0;
-}
-
static int
create_and_start_vlan(struct fcf *fcf, bool vn2vn)
{
@@ -654,10 +624,8 @@ create_and_start_vlan(struct fcf *fcf, bool vn2vn)
real_dev->ifname, fcf->vlan, vlan->ifname);
rc = 0;
} else {
- rc = safe_makevlan_name(vlan_name, sizeof(vlan_name),
+ snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
real_dev->ifname, fcf->vlan, config.suffix);
- if (rc < 0)
- return rc;
rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
if (rc < 0)
printf("Failed to create VLAN device %s\n\t%s\n",
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。