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 <gnault@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Guillaume Nault 2020-11-02 12:24:25 +01:00 committed by Stephen Hemminger
parent 7c7a0fe0c8
commit 8682f588bf
2 changed files with 6 additions and 5 deletions

View File

@ -147,15 +147,15 @@ a label 123 and sends them out eth1:
.EE .EE
.RE .RE
In this example, incoming MPLS unicast packets on eth0 are decapsulated and to In this example, incoming MPLS unicast packets on eth0 are decapsulated
ip packets and output to eth1: and redirected to eth1:
.RS .RS
.EX .EX
#tc qdisc add dev eth0 handle ffff: ingress #tc qdisc add dev eth0 handle ffff: ingress
#tc filter add dev eth0 protocol mpls_uc parent ffff: flower \\ #tc filter add dev eth0 protocol mpls_uc parent ffff: flower \\
action mpls pop protocol ipv4 \\ action mpls pop protocol ipv4 \\
action mirred egress redirect dev eth0 action mirred egress redirect dev eth1
.EE .EE
.RE .RE

View File

@ -23,12 +23,13 @@ static const char * const action_names[] = {
static void explain(void) static void explain(void)
{ {
fprintf(stderr, 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" " mpls push [ protocol MPLS_PROTO ] [ label MPLS_LABEL ] [ tc MPLS_TC ]\n"
" [ ttl MPLS_TTL ] [ bos MPLS_BOS ] [CONTROL]\n" " [ ttl MPLS_TTL ] [ bos MPLS_BOS ] [CONTROL]\n"
" mpls mac_push [ protocol MPLS_PROTO ] [ label MPLS_LABEL ] [ tc MPLS_TC ]\n" " mpls mac_push [ protocol MPLS_PROTO ] [ label MPLS_LABEL ] [ tc MPLS_TC ]\n"
" [ ttl MPLS_TTL ] [ bos MPLS_BOS ] [CONTROL]\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 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" " for push and mac_push, MPLS_PROTO is one of mpls_uc or mpls_mc\n"
" with default: mpls_uc\n" " with default: mpls_uc\n"