]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Merge branch 'gcc-10' into main
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 3 Dec 2020 16:33:06 +0000 (08:33 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 3 Dec 2020 16:33:06 +0000 (08:33 -0800)
devlink/devlink.c
ip/iplink_bridge.c
misc/ifstat.c
misc/nstat.c
tc/f_u32.c
tc/p_ip6.c

index 1ff865bc5c22fead111d9c34f4bddb3151d2ed9f..ca99732efd0051fd778d4a4e05621b8d14444f49 100644 (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;
index 3e81aa059cb39b8701c2dba7e9f5a8f9c3b4a94f..d12fd0558f7db00eac40a455bd5e736b13158c75 100644 (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);
index c05183d79a13aedaf17812aad46085b8dcd257a1..d4a33429dc507b37743841e321ca2e40aac113ed 100644 (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)
index 6fdd316cce849d48e14d2f8c44e9a538ee193ef9..ecdd4ce8266db0aa3825f2bd39986bc186ff846e 100644 (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 */
index e0a322d5a11c891107b95520ce480a50b41b689a..2ed5254a40d5f18adcf2fb0d6633923d27f2b0a2 100644 (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);
index 71660c610c827b1a2c25370b1895639b5e12ed21..83a6ae8183a7fe5594a3490289a5f755dba71425 100644 (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);