diff --git a/bridge/bridge.c b/bridge/bridge.c index f7bfe0b5..48b0e7f8 100644 --- a/bridge/bridge.c +++ b/bridge/bridge.c @@ -149,9 +149,9 @@ main(int argc, char **argv) NEXT_ARG(); if (netns_switch(argv[1])) exit(-1); + } else if (matches_color(opt, &color)) { } else if (matches(opt, "-compressvlans") == 0) { ++compress_vlans; - } else if (matches_color(opt, &color)) { } else if (matches(opt, "-force") == 0) { ++force; } else if (matches(opt, "-json") == 0) { diff --git a/bridge/fdb.c b/bridge/fdb.c index 37465e46..8912f092 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -192,10 +192,13 @@ int print_fdb(struct nlmsghdr *n, void *arg) "mac", "%s ", lladdr); } - if (!filter_index && r->ndm_ifindex) + if (!filter_index && r->ndm_ifindex) { + print_string(PRINT_FP, NULL, "dev ", NULL); + print_color_string(PRINT_ANY, COLOR_IFNAME, - "ifname", "dev %s ", + "ifname", "%s ", ll_index_to_name(r->ndm_ifindex)); + } if (tb[NDA_DST]) { int family = AF_INET; @@ -208,9 +211,11 @@ int print_fdb(struct nlmsghdr *n, void *arg) RTA_PAYLOAD(tb[NDA_DST]), RTA_DATA(tb[NDA_DST])); + print_string(PRINT_FP, NULL, "dst ", NULL); + print_color_string(PRINT_ANY, ifa_family_color(family), - "dst", "dst %s ", dst); + "dst", "%s ", dst); } if (vid) diff --git a/configure b/configure index 0a4a0fc9..7f4f3bd9 100755 --- a/configure +++ b/configure @@ -518,7 +518,7 @@ else "") break ;; *) - usage 1 ;; + shift 1 ;; esac done fi diff --git a/devlink/devlink.c b/devlink/devlink.c index b294fcd8..2f2142ed 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3700,7 +3700,7 @@ static int cmd_dev_flash_status_cb(const struct nlmsghdr *nlh, void *data) strcmp(dev_name, opts->dev_name)) return MNL_CB_ERROR; - if (genl->cmd == DEVLINK_CMD_FLASH_UPDATE_END && ctx->not_first) { + if (genl->cmd == DEVLINK_CMD_FLASH_UPDATE_END) { pr_out("\n"); free(ctx->last_msg); free(ctx->last_component); @@ -3988,7 +3988,7 @@ static void cmd_port_help(void) pr_err(" devlink port set DEV/PORT_INDEX [ type { eth | ib | auto} ]\n"); pr_err(" devlink port split DEV/PORT_INDEX count COUNT\n"); pr_err(" devlink port unsplit DEV/PORT_INDEX\n"); - pr_err(" devlink port function set DEV/PORT_INDEX [ hw_addr ADDR ] [ state STATE ]\n"); + pr_err(" devlink port function set DEV/PORT_INDEX [ hw_addr ADDR ] [ state { active | inactive } ]\n"); pr_err(" devlink port function rate { help | show | add | del | set }\n"); pr_err(" devlink port param set DEV/PORT_INDEX name PARAMETER value VALUE cmode { permanent | driverinit | runtime }\n"); pr_err(" devlink port param show [DEV/PORT_INDEX name PARAMETER]\n"); diff --git a/include/utils.h b/include/utils.h index 28eaad8e..c9849461 100644 --- a/include/utils.h +++ b/include/utils.h @@ -109,17 +109,6 @@ static inline bool is_addrtype_inet_not_multi(const inet_prefix *p) return (p->flags & ADDRTYPE_INET_MULTI) == ADDRTYPE_INET; } -#define DN_MAXADDL 20 -#ifndef AF_DECnet -#define AF_DECnet 12 -#endif - -struct dn_naddr -{ - unsigned short a_len; - unsigned char a_addr[DN_MAXADDL]; -}; - #ifndef AF_MPLS # define AF_MPLS 28 #endif diff --git a/include/version.h b/include/version.h index bbf1d1cc..d0e1a49b 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -static const char version[] = "5.13.0"; +static const char version[] = "5.14.0"; diff --git a/ip/ip.c b/ip/ip.c index e7ffeaff..b07a5c7d 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -72,7 +72,7 @@ static void usage(void) " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" " -f[amily] { inet | inet6 | mpls | bridge | link } |\n" - " -4 | -6 | -I | -D | -M | -B | -0 |\n" + " -4 | -6 | -M | -B | -0 |\n" " -l[oops] { maximum-addr-flush-attempts } | -br[ief] |\n" " -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |\n" " -rc[vbuf] [size] | -n[etns] name | -N[umeric] | -a[ll] |\n" @@ -224,8 +224,6 @@ int main(int argc, char **argv) preferred_family = AF_INET6; } else if (strcmp(opt, "-0") == 0) { preferred_family = AF_PACKET; - } else if (strcmp(opt, "-D") == 0) { - preferred_family = AF_DECnet; } else if (strcmp(opt, "-M") == 0) { preferred_family = AF_MPLS; } else if (strcmp(opt, "-B") == 0) { diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c index b01f69a5..59c9e36d 100644 --- a/ip/iplink_bond.c +++ b/ip/iplink_bond.c @@ -41,6 +41,9 @@ static const char *arp_validate_tbl[] = { "active", "backup", "all", + "filter", + "filter_active", + "filter_backup", NULL, }; @@ -152,7 +155,7 @@ static void print_explain(FILE *f) " [ ad_actor_system LLADDR ]\n" "\n" "BONDMODE := balance-rr|active-backup|balance-xor|broadcast|802.3ad|balance-tlb|balance-alb\n" - "ARP_VALIDATE := none|active|backup|all\n" + "ARP_VALIDATE := none|active|backup|all|filter|filter_active|filter_backup\n" "ARP_ALL_TARGETS := any|all\n" "PRIMARY_RESELECT := always|better|failure\n" "FAIL_OVER_MAC := none|active|follow\n" diff --git a/ip/ipneigh.c b/ip/ipneigh.c index 95bde520..b778de00 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -328,8 +328,7 @@ int print_neigh(struct nlmsghdr *n, void *arg) if (!(filter.state&r->ndm_state) && !(r->ndm_flags & NTF_PROXY) && !(r->ndm_flags & NTF_EXT_LEARNED) && - (r->ndm_state || !(filter.state&0x100)) && - (r->ndm_family != AF_DECnet)) + (r->ndm_state || !(filter.state&0x100))) return 0; if (filter.master && !(n->nlmsg_flags & NLM_F_DUMP_FILTERED)) { diff --git a/ip/iptuntap.c b/ip/iptuntap.c index 9cdb4a80..96ca1ae7 100644 --- a/ip/iptuntap.c +++ b/ip/iptuntap.c @@ -243,6 +243,9 @@ static void print_flags(long flags) if (flags & IFF_ONE_QUEUE) print_string(PRINT_ANY, NULL, " %s", "one_queue"); + if (flags & IFF_MULTI_QUEUE) + print_string(PRINT_ANY, NULL, " %s", "multi_queue"); + if (flags & IFF_VNET_HDR) print_string(PRINT_ANY, NULL, " %s", "vnet_hdr"); @@ -253,9 +256,10 @@ static void print_flags(long flags) print_string(PRINT_ANY, NULL, " %s", "filter"); flags &= ~(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE | - IFF_VNET_HDR | IFF_PERSIST | IFF_NOFILTER); + IFF_MULTI_QUEUE | IFF_VNET_HDR | IFF_PERSIST | + IFF_NOFILTER); if (flags) - print_0xhex(PRINT_ANY, NULL, "%#llx", flags); + print_0xhex(PRINT_ANY, NULL, " %#llx", flags); close_json_array(PRINT_JSON, NULL); } diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c index eaa9504f..70d00184 100644 --- a/lib/bpf_glue.c +++ b/lib/bpf_glue.c @@ -63,7 +63,7 @@ const char *get_libbpf_version(void) if (fp == NULL) goto out; - while ((s = fgets(buf, sizeof(buf), fp)) != NULL) { + while (fgets(buf, sizeof(buf), fp) != NULL) { if ((s = strstr(buf, "libbpf.so.")) != NULL) { strncpy(_libbpf_version, s+10, sizeof(_libbpf_version)-1); strtok(_libbpf_version, "\n"); diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c index d57d2635..91086aa2 100644 --- a/lib/bpf_legacy.c +++ b/lib/bpf_legacy.c @@ -1531,7 +1531,7 @@ retry: * into our buffer. Still, try to give a debuggable error * log for the user, so enlarge it and re-fail. */ - if (fd < 0 && (errno == ENOSPC || !ctx->log_size)) { + if (fd < 0 && errno == ENOSPC) { if (tries++ < 10 && !bpf_log_realloc(ctx)) goto retry; @@ -2069,7 +2069,7 @@ retry: fd = bpf_btf_load(ctx->btf_data->d_buf, ctx->btf_data->d_size, ctx->log, ctx->log_size); if (fd < 0 || ctx->verbose) { - if (fd < 0 && (errno == ENOSPC || !ctx->log_size)) { + if (fd < 0 && errno == ENOSPC) { if (tries++ < 10 && !bpf_log_realloc(ctx)) goto retry; @@ -3298,6 +3298,9 @@ bool iproute2_is_map_in_map(const char *libbpf_map_name, struct bpf_elf_map *ima *omap = ctx->maps[j]; outer_map_name = bpf_map_fetch_name(ctx, j); + if (!outer_map_name) + return false; + memcpy(omap_name, outer_map_name, strlen(outer_map_name) + 1); return true; diff --git a/lib/utils.c b/lib/utils.c index 0559923b..53d31006 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -540,7 +540,7 @@ static int __get_addr_1(inet_prefix *addr, const char *name, int family) memset(addr, 0, sizeof(*addr)); if (strcmp(name, "default") == 0) { - if ((family == AF_DECnet) || (family == AF_MPLS)) + if (family == AF_MPLS) return -1; addr->family = family; addr->bytelen = af_byte_len(addr->family); @@ -551,7 +551,7 @@ static int __get_addr_1(inet_prefix *addr, const char *name, int family) if (strcmp(name, "all") == 0 || strcmp(name, "any") == 0) { - if ((family == AF_DECnet) || (family == AF_MPLS)) + if (family == AF_MPLS) return -1; addr->family = family; addr->bytelen = 0; @@ -636,10 +636,6 @@ int af_bit_len(int af) return 128; case AF_INET: return 32; - case AF_DECnet: - return 16; - case AF_IPX: - return 80; case AF_MPLS: return 20; } @@ -729,16 +725,6 @@ int get_addr_rta(inet_prefix *dst, const struct rtattr *rta, int family) dst->bytelen = 16; memcpy(dst->data, data, 16); break; - case 2: - dst->family = AF_DECnet; - dst->bytelen = 2; - memcpy(dst->data, data, 2); - break; - case 10: - dst->family = AF_IPX; - dst->bytelen = 10; - memcpy(dst->data, data, 10); - break; default: return -1; } @@ -1029,8 +1015,6 @@ int read_family(const char *name) family = AF_INET6; else if (strcmp(name, "link") == 0) family = AF_PACKET; - else if (strcmp(name, "ipx") == 0) - family = AF_IPX; else if (strcmp(name, "mpls") == 0) family = AF_MPLS; else if (strcmp(name, "bridge") == 0) @@ -1046,8 +1030,6 @@ const char *family_name(int family) return "inet6"; if (family == AF_PACKET) return "link"; - if (family == AF_IPX) - return "ipx"; if (family == AF_MPLS) return "mpls"; if (family == AF_BRIDGE) diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index c3c4ae48..81ce9e6f 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -22,7 +22,7 @@ bridge \- show / manipulate bridge addresses and devices \fB\-s\fR[\fItatistics\fR] | \fB\-n\fR[\fIetns\fR] name | \fB\-b\fR[\fIatch\fR] filename | -\fB\-c\fR[\folor\fR] | +\fB\-c\fR[\fIolor\fR] | \fB\-p\fR[\fIretty\fR] | \fB\-j\fR[\fIson\fR] | \fB\-o\fR[\fIneline\fr] } diff --git a/man/man8/devlink-port.8 b/man/man8/devlink-port.8 index 053db7a1..147c8e27 100644 --- a/man/man8/devlink-port.8 +++ b/man/man8/devlink-port.8 @@ -67,12 +67,12 @@ devlink-port \- devlink port configuration .ti -8 .BR "devlink port function set " .IR DEV/PORT_INDEX -.RI "{ " +.RI "[ " .BR "hw_addr " -.RI "ADDR }" -.RI "{ " -.BR "state" -.RI "STATE }" +.RI "ADDR ]" +.RI "[ " +.BR state " { " active " | " inactive " }" +.RI "]" .ti -8 .BR "devlink port function rate " @@ -160,7 +160,7 @@ Is an alias for .PP .B "DEV/PORT_INDEX" - specifies the devlink port index to use for the requested new port. -This is optional. When ommited, driver allocates unique port index. +This is optional. When omitted, driver allocates unique port index. .TP .BR flavour " { " pcipf " | " pcisf " } " diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 2c278d53..41efc6d4 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -2391,7 +2391,7 @@ may be either .B 0 to disable multicast routers on this port, .B 1 -to let the system detect the presence of of routers (this is the default), +to let the system detect the presence of routers (this is the default), .B 2 to permanently enable multicast traffic forwarding on this port or .B 3 @@ -2523,7 +2523,7 @@ specifies the master device which enslaves devices to show. .TP .BI vrf " NAME " .I NAME -speficies the VRF which enslaves devices to show. +specifies the VRF which enslaves devices to show. .TP .BI type " TYPE " diff --git a/man/man8/ip.8 b/man/man8/ip.8 index c3598a02..2a4848b7 100644 --- a/man/man8/ip.8 +++ b/man/man8/ip.8 @@ -37,8 +37,6 @@ ip \- show / manipulate routing, network devices, interfaces and tunnels .BR inet " | " inet6 " | " link " } | " \fB-4\fR | \fB-6\fR | -\fB-I\fR | -\fB-D\fR | \fB-B\fR | \fB-0\fR | \fB-l\fR[\fIoops\fR] { \fBmaximum-addr-flush-attempts\fR } | diff --git a/man/man8/tc-u32.8 b/man/man8/tc-u32.8 index a23a1846..fec9af7f 100644 --- a/man/man8/tc-u32.8 +++ b/man/man8/tc-u32.8 @@ -286,7 +286,7 @@ though inverses this behaviour: the offset is applied always, and will fall back to zero. .TP .BI hashkey " HASHKEY" -Spefify what packet data to use to calculate a hash key for bucket lookup. The +Specify what packet data to use to calculate a hash key for bucket lookup. The kernel adjusts the value according to the hash table's size. For this to work, the option .B link diff --git a/misc/ss.c b/misc/ss.c index 894ad405..b39f63fe 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3404,13 +3404,13 @@ static int tcpdiag_send(int fd, int protocol, struct filter *f) struct iovec iov[3]; int iovlen = 1; - if (protocol == IPPROTO_UDP || protocol == IPPROTO_MPTCP) - return -1; - if (protocol == IPPROTO_TCP) req.nlh.nlmsg_type = TCPDIAG_GETSOCK; - else + else if (protocol == IPPROTO_DCCP) req.nlh.nlmsg_type = DCCPDIAG_GETSOCK; + else + return -1; + if (show_mem) { req.r.idiag_ext |= (1<<(INET_DIAG_MEMINFO-1)); req.r.idiag_ext |= (1<<(INET_DIAG_SKMEMINFO-1)); diff --git a/tc/f_u32.c b/tc/f_u32.c index 2ed5254a..a5747f67 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -978,6 +978,13 @@ show_k: goto show_k; } +static __u32 u32_hash_fold(struct tc_u32_key *key) +{ + __u8 fshift = key->mask ? ffs(ntohl(key->mask)) - 1 : 0; + + return ntohl(key->val & key->mask) >> fshift; +} + static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n) { @@ -1110,9 +1117,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, } NEXT_ARG(); } - hash = sel2.keys[0].val & sel2.keys[0].mask; - hash ^= hash >> 16; - hash ^= hash >> 8; + hash = u32_hash_fold(&sel2.keys[0]); htid = ((hash % divisor) << 12) | (htid & 0xFFF00000); sample_ok = 1; continue; diff --git a/tc/q_netem.c b/tc/q_netem.c index d93e1c73..2e5a46ab 100644 --- a/tc/q_netem.c +++ b/tc/q_netem.c @@ -267,7 +267,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, NEXT_ARG(); ++present[TCA_NETEM_CORR]; if (get_percent(&cor.loss_corr, *argv)) { - explain1("loss correllation"); + explain1("loss correlation"); return -1; } }