Bugzilla – Attachment 847477 Details for
Bug 1182804
GCC 11: fcoe-utils package fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
possible fix for compiler issues
bug-1182804-possible-fix.diff (text/plain), 2.35 KB, created by
Lee Duncan
on 2021-03-19 20:44:38 UTC
(
hide
)
Description:
possible fix for compiler issues
Filename:
MIME Type:
Creator:
Lee Duncan
Created:
2021-03-19 20:44:38 UTC
Size:
2.35 KB
patch
obsolete
>diff --git a/fcping.c b/fcping.c >index bf2bc0f0c785..7a19007e3e19 100644 >--- a/fcping.c >+++ b/fcping.c >@@ -570,6 +570,8 @@ fp_ns_get_id(uint32_t op, fc_wwn_t wwn, char *response, size_t *resp_len) > struct sg_io_v4 sg_io; > size_t actual_len; > int cmd, rc = 0; >+ uint32_t preamble_words[3]; >+ > > memset((char *)&cdb, 0, sizeof(cdb)); > memset(&ct, 0, sizeof(ct)); >@@ -584,8 +586,12 @@ fp_ns_get_id(uint32_t op, fc_wwn_t wwn, char *response, size_t *resp_len) > > cdb.msgcode = FC_BSG_HST_CT; > hton24(cdb.rqst_data.h_ct.port_id, 0xfffffc); >- memcpy(&cdb.rqst_data.h_ct.preamble_word0, &ct.hdr, >- 3 * sizeof(uint32_t)); >+ >+ /* copy preamble words one at a time, to make compiler happy */ >+ memcpy(&preamble_words, &ct.hdr, sizeof(preamble_words)); >+ cdb.rqst_data.h_ct.preamble_word0 = preamble_words[0]; >+ cdb.rqst_data.h_ct.preamble_word1 = preamble_words[1]; >+ cdb.rqst_data.h_ct.preamble_word2 = preamble_words[2]; > > sg_io.guard = 'Q'; > sg_io.protocol = BSG_PROTOCOL_SCSI; >diff --git a/fipvlan.c b/fipvlan.c >index c8a073393141..3a2fd54910e9 100644 >--- a/fipvlan.c >+++ b/fipvlan.c >@@ -375,6 +375,9 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh) > struct iff *iff, *real_dev; > struct fcf_list_head *head; > bool running; >+ char mac_addr[ETHER_ADDR_LEN]; >+ char ifname[IFNAMSIZ]; >+ > > if (config.vn2vn) > head = &vn2vns; >@@ -430,12 +433,12 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh) > return; > } > >- iff = malloc(sizeof(*iff)); >+ iff = malloc(sizeof(struct iff)); > if (!iff) { > FIP_LOG_ERRNO("malloc failed"); > return; > } >- memset(iff, 0, sizeof(*iff)); >+ memset(iff, 0, sizeof(struct iff)); > TAILQ_INIT(&iff->vlans); > > parse_ifinfo(ifla, nh); >@@ -447,8 +450,16 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh) > iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]); > else > iff->iflink = iff->ifindex; >- memcpy(iff->mac_addr, RTA_DATA(ifla[IFLA_ADDRESS]), ETHER_ADDR_LEN); >- strncpy(iff->ifname, RTA_DATA(ifla[IFLA_IFNAME]), IFNAMSIZ); >+ >+ /* >+ * copy MAC address and interface name using intermediate >+ * arrays, so gcc-11 knows we are not overflowing buffers >+ */ >+ memcpy(mac_addr, RTA_DATA(ifla[IFLA_ADDRESS]), >+ ETHER_ADDR_LEN); >+ memcpy(iff->mac_addr, mac_addr, ETHER_ADDR_LEN); >+ memcpy(ifname, RTA_DATA(ifla[IFLA_IFNAME]), IFNAMSIZ); >+ memcpy(iff->ifname, ifname, IFNAMSIZ); > iff->ifname[IFNAMSIZ - 1] = '\0'; > > if (ifla[IFLA_LINKINFO]) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 1182804
:
847477
|
847561