View | Details | Raw Unified | Return to bug 1182804
Collapse All | Expand All

(-)a/fcping.c (-2 / +8 lines)
Lines 570-575 fp_ns_get_id(uint32_t op, fc_wwn_t wwn, char *response, size_t *resp_len) Link Here
570
	struct sg_io_v4 sg_io;
570
	struct sg_io_v4 sg_io;
571
	size_t actual_len;
571
	size_t actual_len;
572
	int cmd, rc = 0;
572
	int cmd, rc = 0;
573
	uint32_t preamble_words[3];
574
573
575
574
	memset((char *)&cdb, 0, sizeof(cdb));
576
	memset((char *)&cdb, 0, sizeof(cdb));
575
	memset(&ct, 0, sizeof(ct));
577
	memset(&ct, 0, sizeof(ct));
Lines 584-591 fp_ns_get_id(uint32_t op, fc_wwn_t wwn, char *response, size_t *resp_len) Link Here
584
586
585
	cdb.msgcode = FC_BSG_HST_CT;
587
	cdb.msgcode = FC_BSG_HST_CT;
586
	hton24(cdb.rqst_data.h_ct.port_id, 0xfffffc);
588
	hton24(cdb.rqst_data.h_ct.port_id, 0xfffffc);
587
	memcpy(&cdb.rqst_data.h_ct.preamble_word0, &ct.hdr,
589
588
	       3 * sizeof(uint32_t));
590
	/* copy preamble words one at a time, to make compiler happy */
591
	memcpy(&preamble_words, &ct.hdr, sizeof(preamble_words));
592
	cdb.rqst_data.h_ct.preamble_word0 = preamble_words[0];
593
	cdb.rqst_data.h_ct.preamble_word1 = preamble_words[1];
594
	cdb.rqst_data.h_ct.preamble_word2 = preamble_words[2];
589
595
590
	sg_io.guard = 'Q';
596
	sg_io.guard = 'Q';
591
	sg_io.protocol = BSG_PROTOCOL_SCSI;
597
	sg_io.protocol = BSG_PROTOCOL_SCSI;
(-)a/fipvlan.c (-4 / +15 lines)
Lines 375-380 static void rtnl_recv_newlink(struct nlmsghdr *nh) Link Here
375
	struct iff *iff, *real_dev;
375
	struct iff *iff, *real_dev;
376
	struct fcf_list_head *head;
376
	struct fcf_list_head *head;
377
	bool running;
377
	bool running;
378
	char mac_addr[ETHER_ADDR_LEN];
379
	char ifname[IFNAMSIZ];
380
378
381
379
	if (config.vn2vn)
382
	if (config.vn2vn)
380
		head = &vn2vns;
383
		head = &vn2vns;
Lines 430-441 static void rtnl_recv_newlink(struct nlmsghdr *nh) Link Here
430
		return;
433
		return;
431
	}
434
	}
432
435
433
	iff = malloc(sizeof(*iff));
436
	iff = malloc(sizeof(struct iff));
434
	if (!iff) {
437
	if (!iff) {
435
		FIP_LOG_ERRNO("malloc failed");
438
		FIP_LOG_ERRNO("malloc failed");
436
		return;
439
		return;
437
	}
440
	}
438
	memset(iff, 0, sizeof(*iff));
441
	memset(iff, 0, sizeof(struct iff));
439
	TAILQ_INIT(&iff->vlans);
442
	TAILQ_INIT(&iff->vlans);
440
443
441
	parse_ifinfo(ifla, nh);
444
	parse_ifinfo(ifla, nh);
Lines 447-454 static void rtnl_recv_newlink(struct nlmsghdr *nh) Link Here
447
		iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]);
450
		iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]);
448
	else
451
	else
449
		iff->iflink = iff->ifindex;
452
		iff->iflink = iff->ifindex;
450
	memcpy(iff->mac_addr, RTA_DATA(ifla[IFLA_ADDRESS]), ETHER_ADDR_LEN);
453
451
	strncpy(iff->ifname, RTA_DATA(ifla[IFLA_IFNAME]), IFNAMSIZ);
454
	/*
455
	 * copy MAC address and interface name using intermediate
456
	 * arrays, so gcc-11 knows we are not overflowing buffers
457
	 */
458
	memcpy(mac_addr, RTA_DATA(ifla[IFLA_ADDRESS]),
459
			ETHER_ADDR_LEN);
460
	memcpy(iff->mac_addr, mac_addr, ETHER_ADDR_LEN);
461
	memcpy(ifname, RTA_DATA(ifla[IFLA_IFNAME]), IFNAMSIZ);
462
	memcpy(iff->ifname, ifname, IFNAMSIZ);
452
	iff->ifname[IFNAMSIZ - 1] = '\0';
463
	iff->ifname[IFNAMSIZ - 1] = '\0';
453
464
454
	if (ifla[IFLA_LINKINFO]) {
465
	if (ifla[IFLA_LINKINFO]) {

Return to bug 1182804