Merge branch 'gcc-10' into main

This commit is contained in:
Stephen Hemminger 2020-12-03 08:33:06 -08:00
commit 2e80ae89ca
6 changed files with 6 additions and 7 deletions

View File

@ -2744,7 +2744,7 @@ static int cmd_dev_param_set(struct dl *dl)
struct param_ctx ctx = {};
struct nlmsghdr *nlh;
bool conv_exists;
uint32_t val_u32;
uint32_t val_u32 = 0;
uint16_t val_u16;
uint8_t val_u8;
bool val_bool;

View File

@ -74,7 +74,7 @@ static void explain(void)
void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len)
{
char eaddr[32];
char eaddr[18];
ether_ntoa_r((const struct ether_addr *)id->addr, eaddr);
snprintf(buf, len, "%.2x%.2x.%s", id->prio[0], id->prio[1], eaddr);

View File

@ -251,7 +251,7 @@ static void load_raw_table(FILE *fp)
buf[strlen(buf)-1] = 0;
if (info_source[0] && strcmp(info_source, buf+1))
source_mismatch = 1;
strncpy(info_source, buf+1, sizeof(info_source)-1);
strlcpy(info_source, buf+1, sizeof(info_source));
continue;
}
if ((n = malloc(sizeof(*n))) == NULL)

View File

@ -136,8 +136,7 @@ static void load_good_table(FILE *fp)
buf[strlen(buf)-1] = 0;
if (info_source[0] && strcmp(info_source, buf+1))
source_mismatch = 1;
info_source[0] = 0;
strncat(info_source, buf+1, sizeof(info_source)-1);
strlcpy(info_source, buf + 1, sizeof(info_source));
continue;
}
/* idbuf is as big as buf, so this is safe */

View File

@ -1110,7 +1110,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
}
NEXT_ARG();
}
hash = sel2.sel.keys[0].val & sel2.sel.keys[0].mask;
hash = sel2.keys[0].val & sel2.keys[0].mask;
hash ^= hash >> 16;
hash ^= hash >> 8;
htid = ((hash % divisor) << 12) | (htid & 0xFFF00000);

View File

@ -82,7 +82,7 @@ parse_ip6(int *argc_p, char ***argv_p,
/* Shift the field by 4 bits on success. */
if (!res) {
int nkeys = sel->sel.nkeys;
struct tc_pedit_key *key = &sel->sel.keys[nkeys - 1];
struct tc_pedit_key *key = &sel->keys[nkeys - 1];
key->mask = htonl(ntohl(key->mask) << 4 | 0xf);
key->val = htonl(ntohl(key->val) << 4);