naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

Blame SOURCES/0003-tc-simple-Fix-documentation.patch

e9acfd
From 3d016b2ca5862b3f47da5b28aca43bd96d5c3c49 Mon Sep 17 00:00:00 2001
e9acfd
From: Phil Sutter <psutter@redhat.com>
e9acfd
Date: Fri, 11 Aug 2017 11:13:26 +0200
e9acfd
Subject: [PATCH] tc-simple: Fix documentation
e9acfd
e9acfd
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1477523
e9acfd
Upstream Status: iproute2.git commit e2a055dd23f0e
e9acfd
e9acfd
commit e2a055dd23f0e7527a987c24687cb6b0b86f0cde
e9acfd
Author: Phil Sutter <phil@nwl.cc>
e9acfd
Date:   Thu Aug 3 17:00:51 2017 +0200
e9acfd
e9acfd
    tc-simple: Fix documentation
e9acfd
e9acfd
    - CONTROL has to come last, otherwise 'index' applies to gact and not
e9acfd
      simple itself.
e9acfd
    - Man page wasn't updated to reflect syntax changes.
e9acfd
e9acfd
    Signed-off-by: Phil Sutter <phil@nwl.cc>
e9acfd
---
e9acfd
 man/man8/tc-simple.8 | 29 ++++++++++++++++++++++++++---
e9acfd
 tc/m_simple.c        |  4 ++--
e9acfd
 2 files changed, 28 insertions(+), 5 deletions(-)
e9acfd
e9acfd
diff --git a/man/man8/tc-simple.8 b/man/man8/tc-simple.8
e9acfd
index 2206dc3..7363ab5 100644
e9acfd
--- a/man/man8/tc-simple.8
e9acfd
+++ b/man/man8/tc-simple.8
e9acfd
@@ -6,15 +6,37 @@ simple - basic example action
e9acfd
 .in +8
e9acfd
 .ti -8
e9acfd
 .BR tc " ... " "action simple"
e9acfd
-.I STRING
e9acfd
+[
e9acfd
+.BI sdata " STRING"
e9acfd
+] [
e9acfd
+.BI index " INDEX"
e9acfd
+] [
e9acfd
+.I CONTROL
e9acfd
+]
e9acfd
+
e9acfd
+.ti -8
e9acfd
+.IR CONTROL " := {"
e9acfd
+.BR reclassify " | " pipe " | " drop " | " continue " | " ok " }"
e9acfd
+
e9acfd
 .SH DESCRIPTION
e9acfd
 This is a pedagogical example rather than an actually useful action. Upon every access, it prints the given
e9acfd
 .I STRING
e9acfd
 which may be of arbitrary length.
e9acfd
 .SH OPTIONS
e9acfd
 .TP
e9acfd
-.I STRING
e9acfd
+.BI sdata " STRING"
e9acfd
 The actual string to print.
e9acfd
+.TP
e9acfd
+.BI index " INDEX"
e9acfd
+Optional action index value.
e9acfd
+.TP
e9acfd
+.I CONTROL
e9acfd
+Indicate how
e9acfd
+.B tc
e9acfd
+should proceed after executing the action. For a description of the possible
e9acfd
+.I CONTROL
e9acfd
+values, see
e9acfd
+.BR tc-actions (8).
e9acfd
 .SH EXAMPLES
e9acfd
 The following example makes the kernel yell "Incoming ICMP!" every time it sees
e9acfd
 an incoming ICMP on eth0. Steps are:
e9acfd
@@ -36,7 +58,7 @@ display stats again and observe increment by 1
e9acfd
 .EX
e9acfd
   hadi@noma1:$ tc qdisc add dev eth0 ingress
e9acfd
   hadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5 \\
e9acfd
-	 u32 match ip protocol 1 0xff flowid 1:1 action simple "Incoming ICMP"
e9acfd
+	 u32 match ip protocol 1 0xff flowid 1:1 action simple sdata "Incoming ICMP"
e9acfd
 
e9acfd
   hadi@noma1:$ sudo tc -s filter ls  dev eth0 parent ffff:
e9acfd
    filter protocol ip pref 5 u32
e9acfd
@@ -74,3 +96,4 @@ display stats again and observe increment by 1
e9acfd
 .EE
e9acfd
 .SH SEE ALSO
e9acfd
 .BR tc (8)
e9acfd
+.BR tc-actions (8)
e9acfd
diff --git a/tc/m_simple.c b/tc/m_simple.c
e9acfd
index 3a8bd91..ab63384 100644
e9acfd
--- a/tc/m_simple.c
e9acfd
+++ b/tc/m_simple.c
e9acfd
@@ -81,10 +81,10 @@
e9acfd
 #endif
e9acfd
 static void explain(void)
e9acfd
 {
e9acfd
-	fprintf(stderr, "Usage:... simple [sdata STRING] [CONTROL] [index INDEX]\n");
e9acfd
+	fprintf(stderr, "Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n");
e9acfd
 	fprintf(stderr, "\tSTRING being an arbitrary string\n"
e9acfd
-		"\tCONTROL := reclassify|pipe|drop|continue|ok\n"
e9acfd
 		"\tINDEX := optional index value used\n");
e9acfd
+		"\tCONTROL := reclassify|pipe|drop|continue|ok\n"
e9acfd
 }
e9acfd
 
e9acfd
 static void usage(void)
e9acfd
-- 
e9acfd
1.8.3.1
e9acfd