From 9fc5bf734f6b25559a3227d8789efbc67156e575 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 26 Oct 2020 12:32:52 +0100 Subject: [PATCH 1/9] libnetlink: define __aligned conditionally On some systems (e.g. current Debian/stable) the inclusion of utils.h pulled in some other things that may end up defining __aligned, in a possibly different way than what we had here. Use our own definition only if there isn't one already. Fixes: d5acae244f9d ("libnetlink: add nl_print_policy() helper") Signed-off-by: Johannes Berg Signed-off-by: Stephen Hemminger --- lib/libnetlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libnetlink.c b/lib/libnetlink.c index a7b60d87..c958aa57 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -30,7 +30,9 @@ #include "libnetlink.h" #include "utils.h" +#ifndef __aligned #define __aligned(x) __attribute__((aligned(x))) +#endif #ifndef SOL_NETLINK #define SOL_NETLINK 270 From 14b189f066d900f34e789be42a7b40291aa3b944 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 3 Nov 2020 08:29:14 -0800 Subject: [PATCH 2/9] uapi: updates from 5.10-rc1 Signed-off-by: Stephen Hemminger --- include/uapi/linux/bpf.h | 115 +++++++++++++++++++++++++++++---- include/uapi/linux/if_alg.h | 1 + include/uapi/linux/netfilter.h | 3 +- 3 files changed, 104 insertions(+), 15 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 9e4366f3..eb407382 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -356,18 +356,36 @@ enum bpf_link_type { #define BPF_F_SLEEPABLE (1U << 4) /* When BPF ldimm64's insn[0].src_reg != 0 then this can have - * two extensions: + * the following extensions: * - * insn[0].src_reg: BPF_PSEUDO_MAP_FD BPF_PSEUDO_MAP_VALUE - * insn[0].imm: map fd map fd - * insn[1].imm: 0 offset into value - * insn[0].off: 0 0 - * insn[1].off: 0 0 - * ldimm64 rewrite: address of map address of map[0]+offset - * verifier type: CONST_PTR_TO_MAP PTR_TO_MAP_VALUE + * insn[0].src_reg: BPF_PSEUDO_MAP_FD + * insn[0].imm: map fd + * insn[1].imm: 0 + * insn[0].off: 0 + * insn[1].off: 0 + * ldimm64 rewrite: address of map + * verifier type: CONST_PTR_TO_MAP */ #define BPF_PSEUDO_MAP_FD 1 +/* insn[0].src_reg: BPF_PSEUDO_MAP_VALUE + * insn[0].imm: map fd + * insn[1].imm: offset into value + * insn[0].off: 0 + * insn[1].off: 0 + * ldimm64 rewrite: address of map[0]+offset + * verifier type: PTR_TO_MAP_VALUE + */ #define BPF_PSEUDO_MAP_VALUE 2 +/* insn[0].src_reg: BPF_PSEUDO_BTF_ID + * insn[0].imm: kernel btd id of VAR + * insn[1].imm: 0 + * insn[0].off: 0 + * insn[1].off: 0 + * ldimm64 rewrite: address of the kernel variable + * verifier type: PTR_TO_BTF_ID or PTR_TO_MEM, depending on whether the var + * is struct/union. + */ +#define BPF_PSEUDO_BTF_ID 3 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative * offset to another bpf function @@ -417,6 +435,9 @@ enum { /* Share perf_event among processes */ BPF_F_PRESERVE_ELEMS = (1U << 11), + +/* Create a map that is suitable to be an inner map with dynamic max entries */ + BPF_F_INNER_MAP = (1U << 12), }; /* Flags for BPF_PROG_QUERY. */ @@ -1680,7 +1701,7 @@ union bpf_attr { * **TCP_CONGESTION**, **TCP_BPF_IW**, * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, - * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**. + * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. * Return @@ -2235,7 +2256,7 @@ union bpf_attr { * Description * This helper is used in programs implementing policies at the * skb socket level. If the sk_buff *skb* is allowed to pass (i.e. - * if the verdeict eBPF program returns **SK_PASS**), redirect it + * if the verdict eBPF program returns **SK_PASS**), redirect it * to the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and * egress interfaces can be used for redirection. The @@ -3656,15 +3677,68 @@ union bpf_attr { * Return * The id is returned or 0 in case the id could not be retrieved. * - * long bpf_redirect_neigh(u32 ifindex, u64 flags) + * long bpf_redirect_neigh(u32 ifindex, struct bpf_redir_neigh *params, int plen, u64 flags) * Description * Redirect the packet to another net device of index *ifindex* * and fill in L2 addresses from neighboring subsystem. This helper * is somewhat similar to **bpf_redirect**\ (), except that it - * fills in e.g. MAC addresses based on the L3 information from - * the packet. This helper is supported for IPv4 and IPv6 protocols. + * populates L2 addresses as well, meaning, internally, the helper + * relies on the neighbor lookup for the L2 address of the nexthop. + * + * The helper will perform a FIB lookup based on the skb's + * networking header to get the address of the next hop, unless + * this is supplied by the caller in the *params* argument. The + * *plen* argument indicates the len of *params* and should be set + * to 0 if *params* is NULL. + * * The *flags* argument is reserved and must be 0. The helper is - * currently only supported for tc BPF program types. + * currently only supported for tc BPF program types, and enabled + * for IPv4 and IPv6 protocols. + * Return + * The helper returns **TC_ACT_REDIRECT** on success or + * **TC_ACT_SHOT** on error. + * + * void *bpf_per_cpu_ptr(const void *percpu_ptr, u32 cpu) + * Description + * Take a pointer to a percpu ksym, *percpu_ptr*, and return a + * pointer to the percpu kernel variable on *cpu*. A ksym is an + * extern variable decorated with '__ksym'. For ksym, there is a + * global var (either static or global) defined of the same name + * in the kernel. The ksym is percpu if the global var is percpu. + * The returned pointer points to the global percpu var on *cpu*. + * + * bpf_per_cpu_ptr() has the same semantic as per_cpu_ptr() in the + * kernel, except that bpf_per_cpu_ptr() may return NULL. This + * happens if *cpu* is larger than nr_cpu_ids. The caller of + * bpf_per_cpu_ptr() must check the returned value. + * Return + * A pointer pointing to the kernel percpu variable on *cpu*, or + * NULL, if *cpu* is invalid. + * + * void *bpf_this_cpu_ptr(const void *percpu_ptr) + * Description + * Take a pointer to a percpu ksym, *percpu_ptr*, and return a + * pointer to the percpu kernel variable on this cpu. See the + * description of 'ksym' in **bpf_per_cpu_ptr**\ (). + * + * bpf_this_cpu_ptr() has the same semantic as this_cpu_ptr() in + * the kernel. Different from **bpf_per_cpu_ptr**\ (), it would + * never return NULL. + * Return + * A pointer pointing to the kernel percpu variable on this cpu. + * + * long bpf_redirect_peer(u32 ifindex, u64 flags) + * Description + * Redirect the packet to another net device of index *ifindex*. + * This helper is somewhat similar to **bpf_redirect**\ (), except + * that the redirection happens to the *ifindex*' peer device and + * the netns switch takes place from ingress to ingress without + * going through the CPU's backlog queue. + * + * The *flags* argument is reserved and must be 0. The helper is + * currently only supported for tc BPF program types at the ingress + * hook and for veth device types. The peer device must reside in a + * different network namespace. * Return * The helper returns **TC_ACT_REDIRECT** on success or * **TC_ACT_SHOT** on error. @@ -3823,6 +3897,9 @@ union bpf_attr { FN(seq_printf_btf), \ FN(skb_cgroup_classid), \ FN(redirect_neigh), \ + FN(bpf_per_cpu_ptr), \ + FN(bpf_this_cpu_ptr), \ + FN(redirect_peer), \ /* */ /* integer value in 'imm' field of BPF_CALL instruction selects which helper @@ -4833,6 +4910,16 @@ struct bpf_fib_lookup { __u8 dmac[6]; /* ETH_ALEN */ }; +struct bpf_redir_neigh { + /* network family for lookup (AF_INET, AF_INET6) */ + __u32 nh_family; + /* network address of nexthop; skips fib lookup to find gateway */ + union { + __be32 ipv4_nh; + __u32 ipv6_nh[4]; /* in6_addr; network order */ + }; +}; + enum bpf_task_fd_type { BPF_FD_TYPE_RAW_TRACEPOINT, /* tp name */ BPF_FD_TYPE_TRACEPOINT, /* tp name */ diff --git a/include/uapi/linux/if_alg.h b/include/uapi/linux/if_alg.h index bc2bcdec..60b7c2ef 100644 --- a/include/uapi/linux/if_alg.h +++ b/include/uapi/linux/if_alg.h @@ -35,6 +35,7 @@ struct af_alg_iv { #define ALG_SET_OP 3 #define ALG_SET_AEAD_ASSOCLEN 4 #define ALG_SET_AEAD_AUTHSIZE 5 +#define ALG_SET_DRBG_ENTROPY 6 /* Operations */ #define ALG_OP_DECRYPT 0 diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h index 899be986..566d8e40 100644 --- a/include/uapi/linux/netfilter.h +++ b/include/uapi/linux/netfilter.h @@ -43,7 +43,8 @@ enum nf_inet_hooks { NF_INET_FORWARD, NF_INET_LOCAL_OUT, NF_INET_POST_ROUTING, - NF_INET_NUMHOOKS + NF_INET_NUMHOOKS, + NF_INET_INGRESS = NF_INET_NUMHOOKS, }; enum nf_dev_hooks { From cbf6481797c01f773396dd962c676e825f632e6a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 8 Nov 2020 10:34:23 -0800 Subject: [PATCH 3/9] tc/m_gate: fix spelling errors Fix spelling errors in error messages. Signed-off-by: Stephen Hemminger --- tc/m_gate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tc/m_gate.c b/tc/m_gate.c index 327df7eb..4bae86ed 100644 --- a/tc/m_gate.c +++ b/tc/m_gate.c @@ -261,7 +261,7 @@ static int parse_gate(struct action_util *a, int *argc_p, char ***argv_p, if (!NEXT_ARG_OK()) { explain_entry_format(); - fprintf(stderr, "\"sched-entry\" is imcomplete\n"); + fprintf(stderr, "\"sched-entry\" is incomplete\n"); free_entries(&gate_entries); return -1; } @@ -270,14 +270,14 @@ static int parse_gate(struct action_util *a, int *argc_p, char ***argv_p, if (get_gate_state(&gate_state, *argv)) { explain_entry_format(); - fprintf(stderr, "\"sched-entry\" is imcomplete\n"); + fprintf(stderr, "\"sched-entry\" is incomplete\n"); free_entries(&gate_entries); return -1; } if (!NEXT_ARG_OK()) { explain_entry_format(); - fprintf(stderr, "\"sched-entry\" is imcomplete\n"); + fprintf(stderr, "\"sched-entry\" is incomplete\n"); free_entries(&gate_entries); return -1; } @@ -287,7 +287,7 @@ static int parse_gate(struct action_util *a, int *argc_p, char ***argv_p, if (get_u32(&interval, *argv, 0) && get_time64(&interval_s64, *argv)) { explain_entry_format(); - fprintf(stderr, "\"sched-entry\" is imcomplete\n"); + fprintf(stderr, "\"sched-entry\" is incomplete\n"); free_entries(&gate_entries); return -1; } From c8424b73e15f1a4e8723866154bf4f7aab7dbe31 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 8 Nov 2020 10:40:30 -0800 Subject: [PATCH 4/9] man: fix spelling errors Lots of little typo errors on man pages. Found by running codespell Signed-off-by: Stephen Hemminger --- man/man8/ip-link.8.in | 8 ++++---- man/man8/ip-macsec.8 | 2 +- man/man8/ip-neighbour.8 | 6 +++--- man/man8/ss.8 | 2 +- man/man8/tc-cake.8 | 4 ++-- man/man8/tc-ct.8 | 2 +- man/man8/tc-flower.8 | 4 ++-- man/man8/tc-matchall.8 | 4 ++-- man/man8/tc-pie.8 | 4 ++-- man/man8/tc-sfb.8 | 2 +- man/man8/tc-tunnel_key.8 | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 1eb76655..1ff01744 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -444,7 +444,7 @@ the following additional arguments are supported: - either 802.1Q or 802.1ad. .BI id " VLANID " -- specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively. +- specifies the VLAN Identifier to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadecimal, respectively. .BR reorder_hdr " { " on " | " off " } " - specifies whether ethernet headers are reordered or not (default is @@ -575,7 +575,7 @@ the following additional arguments are supported: .in +8 .sp .BI id " VNI " -- specifies the VXLAN Network Identifer (or VXLAN Segment +- specifies the VXLAN Network Identifier (or VXLAN Segment Identifier) to use. .BI dev " PHYS_DEV" @@ -1240,7 +1240,7 @@ the following additional arguments are supported: .in +8 .sp .BI id " VNI " -- specifies the Virtual Network Identifer to use. +- specifies the Virtual Network Identifier to use. .sp .BI remote " IPADDR" @@ -2507,7 +2507,7 @@ specifies the device to display address-family statistics for. .PP .I "TYPE" -specifies which help of link type to dislpay. +specifies which help of link type to display. .SS .I GROUP diff --git a/man/man8/ip-macsec.8 b/man/man8/ip-macsec.8 index 8e9175c5..6739e51c 100644 --- a/man/man8/ip-macsec.8 +++ b/man/man8/ip-macsec.8 @@ -119,7 +119,7 @@ type. .SH NOTES This tool can be used to configure the 802.1AE keys of the interface. Note that 802.1AE uses GCM-AES with a initialization vector (IV) derived from the packet number. The same key must not be used -with the same IV more than once. Instead, keys must be frequently regenerated and distibuted. +with the same IV more than once. Instead, keys must be frequently regenerated and distributed. This tool is thus mostly for debugging and testing, or in combination with a user-space application that reconfigures the keys. It is wrong to just configure the keys statically and assume them to work indefinitely. The suggested and standardized way for key management is 802.1X-2010, which is implemented diff --git a/man/man8/ip-neighbour.8 b/man/man8/ip-neighbour.8 index f71f18b1..a27f9ef8 100644 --- a/man/man8/ip-neighbour.8 +++ b/man/man8/ip-neighbour.8 @@ -85,11 +85,11 @@ the interface to which this neighbour is attached. .TP .BI proxy -indicates whether we are proxying for this neigbour entry +indicates whether we are proxying for this neighbour entry .TP .BI router -indicates whether neigbour is a router +indicates whether neighbour is a router .TP .BI extern_learn @@ -244,7 +244,7 @@ lookup a neighbour entry to a destination given a device .TP .BI proxy -indicates whether we should lookup a proxy neigbour entry +indicates whether we should lookup a proxy neighbour entry .TP .BI to " ADDRESS " (default) diff --git a/man/man8/ss.8 b/man/man8/ss.8 index 839bab38..e4b9cdcb 100644 --- a/man/man8/ss.8 +++ b/man/man8/ss.8 @@ -69,7 +69,7 @@ how long time the timer will expire .P .TP .B -how many times the retransmission occured +how many times the retransmission occurred .RE .TP .B \-e, \-\-extended diff --git a/man/man8/tc-cake.8 b/man/man8/tc-cake.8 index 4112b755..cb67d15f 100644 --- a/man/man8/tc-cake.8 +++ b/man/man8/tc-cake.8 @@ -413,9 +413,9 @@ suffered by Australasian residents. Equivalent to .SH FLOW ISOLATION PARAMETERS With flow isolation enabled, CAKE places packets from different flows into different queues, each of which carries its own AQM state. Packets from each -queue are then delivered fairly, according to a DRR++ algorithm which minimises +queue are then delivered fairly, according to a DRR++ algorithm which minimizes latency for "sparse" flows. CAKE uses a set-associative hashing algorithm to -minimise flow collisions. +minimize flow collisions. These keywords specify whether fairness based on source address, destination address, individual flows, or any combination of those is desired. diff --git a/man/man8/tc-ct.8 b/man/man8/tc-ct.8 index 45d29320..709e62a9 100644 --- a/man/man8/tc-ct.8 +++ b/man/man8/tc-ct.8 @@ -66,7 +66,7 @@ Restore any previous configured nat. Remove any conntrack state and metadata (mark/label) from the packet (must only option specified). .TP .BI force -Forces conntrack direction for a previously commited connections, so that current direction will become the original direction (only valid with commit). +Forces conntrack direction for a previously committed connections, so that current direction will become the original direction (only valid with commit). .SH EXAMPLES Example showing natted firewall in conntrack zone 2, and conntrack mark usage: diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8 index b5bcfd1d..da3dd757 100644 --- a/man/man8/tc-flower.8 +++ b/man/man8/tc-flower.8 @@ -306,7 +306,7 @@ If the prefix is missing, \fBtc\fR assumes a full-length host match. .TQ .IR \fBsrc_port " { " MASKED_NUMBER " | " " MIN_VALUE-MAX_VALUE " } Match on layer 4 protocol source or destination port number, with an -optional mask. Alternatively, the mininum and maximum values can be +optional mask. Alternatively, the minimum and maximum values can be specified to match on a range of layer 4 protocol source or destination port numbers. Only available for .BR ip_proto " values " udp ", " tcp " and " sctp @@ -384,7 +384,7 @@ Matches on connection tracking info .RS .TP .I CT_STATE -Match the connection state, and can ne combination of [{+|-}flag] flags, where flag can be one of +Match the connection state, and can be combination of [{+|-}flag] flags, where flag can be one of .RS .TP trk - Tracked connection. diff --git a/man/man8/tc-matchall.8 b/man/man8/tc-matchall.8 index e3cddb1f..75c28c94 100644 --- a/man/man8/tc-matchall.8 +++ b/man/man8/tc-matchall.8 @@ -45,7 +45,7 @@ tc filter add dev eth1 parent ffff: \\ .EE .RE -The first command creats an ingress qdisc with handle +The first command creates an ingress qdisc with handle .BR ffff: on device .BR eth1 @@ -64,7 +64,7 @@ tc filter add dev eth1 parent 1: \\ .EE .RE -The first command creats an egress qdisc with handle +The first command creates an egress qdisc with handle .BR 1: that replaces the root qdisc on device .BR eth1 diff --git a/man/man8/tc-pie.8 b/man/man8/tc-pie.8 index 0db97d13..5a8c7820 100644 --- a/man/man8/tc-pie.8 +++ b/man/man8/tc-pie.8 @@ -40,7 +40,7 @@ aims to control delay. The main design goals are PIE is designed to control delay effectively. First, an average dequeue rate is estimated based on the standing queue. The rate is used to calculate the current delay. Then, on a periodic basis, the delay is used to calculate the dropping -probabilty. Finally, on arrival, a packet is dropped (or marked) based on this +probability. Finally, on arrival, a packet is dropped (or marked) based on this probability. PIE makes adjustments to the probability based on the trend of the delay i.e. @@ -52,7 +52,7 @@ growth and are determined through control theoretic approaches. alpha determines the deviation between the current and target latency changes probability. beta exerts additional adjustments depending on the latency trend. -The drop probabilty is used to mark packets in ecn mode. However, as in RED, +The drop probability is used to mark packets in ecn mode. However, as in RED, beyond 10% packets are dropped based on this probability. The bytemode is used to drop packets proportional to the packet size. diff --git a/man/man8/tc-sfb.8 b/man/man8/tc-sfb.8 index aad19e1e..e4584deb 100644 --- a/man/man8/tc-sfb.8 +++ b/man/man8/tc-sfb.8 @@ -105,7 +105,7 @@ device the qdisc is attached to. .TP max Maximum length of a buckets queue, in packets, before packets start being -dropped. Should be sightly larger than +dropped. Should be slightly larger than .B target , but should not be set to values exceeding 1.5 times that of .B target . diff --git a/man/man8/tc-tunnel_key.8 b/man/man8/tc-tunnel_key.8 index ad997240..f9863f99 100644 --- a/man/man8/tc-tunnel_key.8 +++ b/man/man8/tc-tunnel_key.8 @@ -96,13 +96,13 @@ variable length hexadecimal value. Additionally multiple options may be listed using a comma delimiter. .TP .B vxlan_opts -Vxlan metatdata options. +Vxlan metadata options. .B vxlan_opts is specified in the form GBP, as a 32bit number. Multiple options is not supported. .TP .B erspan_opts -Erspan metatdata options. +Erspan metadata options. .B erspan_opts is specified in the form VERSION:INDEX:DIR:HWID, where VERSION is represented as a 8bit number, INDEX as an 32bit number, DIR and HWID as a 8bit number. From b90c39be33eda06b26f4df71718e5d94d35f6637 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 8 Nov 2020 10:44:19 -0800 Subject: [PATCH 5/9] rdma: fix spelling error in comment Signed-off-by: Stephen Hemminger --- rdma/rdma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdma/rdma.h b/rdma/rdma.h index a6c6bdea..fd102412 100644 --- a/rdma/rdma.h +++ b/rdma/rdma.h @@ -39,7 +39,7 @@ struct filter_entry { char *key; char *value; /* - * This field menas that we can try to issue .doit calback + * This field means that we can try to issue .doit calback * on value above. This value can be converted to integer * with simple atoi(). Otherwise "is_doit" will be false. */ From 72f88bd42ad78474aa1b0aabf8492708b7573bde Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 8 Nov 2020 10:47:27 -0800 Subject: [PATCH 6/9] uapi: update kernel headers from 5.10-rc2 Signed-off-by: Stephen Hemminger --- include/uapi/linux/icmpv6.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h index 70b283ff..fcea1c50 100644 --- a/include/uapi/linux/icmpv6.h +++ b/include/uapi/linux/icmpv6.h @@ -138,6 +138,7 @@ struct icmp6hdr { #define ICMPV6_HDR_FIELD 0 #define ICMPV6_UNK_NEXTHDR 1 #define ICMPV6_UNK_OPTION 2 +#define ICMPV6_HDR_INCOMP 3 /* * constants for (set|get)sockopt From 7c7a0fe0c81cdff258c4314c629d7a52ae331dc4 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Mon, 2 Nov 2020 11:59:46 +0100 Subject: [PATCH 7/9] tc-vlan: fix help and error message strings * "vlan pop" can be followed by a CONTROL keyword. * Add missing space in error message. Signed-off-by: Guillaume Nault Signed-off-by: Stephen Hemminger --- tc/m_vlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tc/m_vlan.c b/tc/m_vlan.c index e6b21330..57722b73 100644 --- a/tc/m_vlan.c +++ b/tc/m_vlan.c @@ -30,7 +30,7 @@ static const char * const action_names[] = { static void explain(void) { fprintf(stderr, - "Usage: vlan pop\n" + "Usage: vlan pop [CONTROL]\n" " vlan push [ protocol VLANPROTO ] id VLANID [ priority VLANPRIO ] [CONTROL]\n" " vlan modify [ protocol VLANPROTO ] id VLANID [ priority VLANPRIO ] [CONTROL]\n" " vlan pop_eth [CONTROL]\n" @@ -244,7 +244,7 @@ static int print_vlan(struct action_util *au, FILE *f, struct rtattr *arg) parse_rtattr_nested(tb, TCA_VLAN_MAX, arg); if (!tb[TCA_VLAN_PARMS]) { - fprintf(stderr, "Missing vlanparameters\n"); + fprintf(stderr, "Missing vlan parameters\n"); return -1; } parm = RTA_DATA(tb[TCA_VLAN_PARMS]); From 8682f588bfed7862233a22626562696d662ca60c Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Mon, 2 Nov 2020 12:24:25 +0100 Subject: [PATCH 8/9] tc-mpls: fix manpage example and help message string Manpage: * Remove the extra "and to ip packets" part from command description to make it more understandable. * Redirect packets to eth1, instead of eth0, as told in the description. Help string: * "mpls pop" can be followed by a CONTROL keyword. * "mpls modify" can also set the MPLS_BOS field. Signed-off-by: Guillaume Nault Signed-off-by: Stephen Hemminger --- man/man8/tc-mpls.8 | 6 +++--- tc/m_mpls.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/man/man8/tc-mpls.8 b/man/man8/tc-mpls.8 index 9e563e98..7f8be221 100644 --- a/man/man8/tc-mpls.8 +++ b/man/man8/tc-mpls.8 @@ -147,15 +147,15 @@ a label 123 and sends them out eth1: .EE .RE -In this example, incoming MPLS unicast packets on eth0 are decapsulated and to -ip packets and output to eth1: +In this example, incoming MPLS unicast packets on eth0 are decapsulated +and redirected to eth1: .RS .EX #tc qdisc add dev eth0 handle ffff: ingress #tc filter add dev eth0 protocol mpls_uc parent ffff: flower \\ action mpls pop protocol ipv4 \\ - action mirred egress redirect dev eth0 + action mirred egress redirect dev eth1 .EE .RE diff --git a/tc/m_mpls.c b/tc/m_mpls.c index 2c3752ba..9fee22e3 100644 --- a/tc/m_mpls.c +++ b/tc/m_mpls.c @@ -23,12 +23,13 @@ static const char * const action_names[] = { static void explain(void) { fprintf(stderr, - "Usage: mpls pop [ protocol MPLS_PROTO ]\n" + "Usage: mpls pop [ protocol MPLS_PROTO ] [CONTROL]\n" " mpls push [ protocol MPLS_PROTO ] [ label MPLS_LABEL ] [ tc MPLS_TC ]\n" " [ ttl MPLS_TTL ] [ bos MPLS_BOS ] [CONTROL]\n" " mpls mac_push [ protocol MPLS_PROTO ] [ label MPLS_LABEL ] [ tc MPLS_TC ]\n" " [ ttl MPLS_TTL ] [ bos MPLS_BOS ] [CONTROL]\n" - " mpls modify [ label MPLS_LABEL ] [ tc MPLS_TC ] [ ttl MPLS_TTL ] [CONTROL]\n" + " mpls modify [ label MPLS_LABEL ] [ tc MPLS_TC ] [ ttl MPLS_TTL ]\n" + " [ bos MPLS_BOS ] [CONTROL]\n" " for pop, MPLS_PROTO is next header of packet - e.g. ip or mpls_uc\n" " for push and mac_push, MPLS_PROTO is one of mpls_uc or mpls_mc\n" " with default: mpls_uc\n" From 7a49ff9d7906858ec75b69e9ad05af2bfd9cab4d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 15 Nov 2020 08:58:52 -0800 Subject: [PATCH 9/9] bridge: report correct version Signed-off-by: Stephen Hemminger --- bridge/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/bridge.c b/bridge/bridge.c index 453d6897..1f1c907b 100644 --- a/bridge/bridge.c +++ b/bridge/bridge.c @@ -141,7 +141,7 @@ main(int argc, char **argv) if (matches(opt, "-help") == 0) { usage(); } else if (matches(opt, "-Version") == 0) { - printf("bridge utility, 0.0\n"); + printf("bridge utility, %s\n", version); exit(0); } else if (matches(opt, "-stats") == 0 || matches(opt, "-statistics") == 0) {