From: Serhey Popovych <serhe.popovych@gmail•com>
To: netdev@vger•kernel.org
Subject: [PATCH iproute2-next] gre/gre6: Post merge fixes
Date: Mon, 22 Jan 2018 16:50:08 +0200 [thread overview]
Message-ID: <1516632608-17513-1-git-send-email-serhe.popovych@gmail.com> (raw)
Few minor changes after merge of 'master' into 'net-next' branch:
1) Follow 80 line length for printing erspan_index parameter
as we did in master with commit 2a8d0f6e9c3f ("gre/tunnel:
Print erspan_index using print_uint()").
2) Remove remnants of encapsulation option printing: now it
is done using tnl_print_encap() helper in commit bad76e6b1f44
("ip/tunnel: Abstract tunnel encapsulation options printing").
Fixes: 8c75f69411bc ("Merge branch 'master' into net-next")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail•com>
---
ip/link_gre.c | 3 ++-
ip/link_gre6.c | 46 ++--------------------------------------------
2 files changed, 4 insertions(+), 45 deletions(-)
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 674603b..a430ab8 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -506,7 +506,8 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_GRE_ERSPAN_INDEX]) {
__u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
- print_uint(PRINT_ANY, "erspan_index", "erspan_index %u ", erspan_idx);
+ print_uint(PRINT_ANY,
+ "erspan_index", "erspan_index %u ", erspan_idx);
}
if (tb[IFLA_GRE_ERSPAN_VER]) {
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index a0eeb5a..5f465fe 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -568,7 +568,8 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_GRE_ERSPAN_INDEX]) {
__u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
- print_uint(PRINT_ANY, "erspan_index", "erspan_index %u ", erspan_idx);
+ print_uint(PRINT_ANY,
+ "erspan_index", "erspan_index %u ", erspan_idx);
}
if (tb[IFLA_GRE_ERSPAN_VER]) {
@@ -594,49 +595,6 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
print_hex(PRINT_ANY, "erspan_hwid", "erspan_hwid 0x%x ", erspan_hwid);
}
- if (tb[IFLA_GRE_ENCAP_TYPE] &&
- rta_getattr_u16(tb[IFLA_GRE_ENCAP_TYPE]) != TUNNEL_ENCAP_NONE) {
- __u16 type = rta_getattr_u16(tb[IFLA_GRE_ENCAP_TYPE]);
- __u16 flags = rta_getattr_u16(tb[IFLA_GRE_ENCAP_FLAGS]);
- __u16 sport = rta_getattr_u16(tb[IFLA_GRE_ENCAP_SPORT]);
- __u16 dport = rta_getattr_u16(tb[IFLA_GRE_ENCAP_DPORT]);
-
- open_json_object("encap");
-
- print_string(PRINT_FP, NULL, "encap ", NULL);
- switch (type) {
- case TUNNEL_ENCAP_FOU:
- print_string(PRINT_ANY, "type", "%s ", "fou");
- break;
- case TUNNEL_ENCAP_GUE:
- print_string(PRINT_ANY, "type", "%s ", "gue");
- break;
- default:
- print_null(PRINT_ANY, "type", "unknown ", NULL);
- break;
- }
-
- if (is_json_context()) {
- print_uint(PRINT_JSON,
- "sport",
- NULL,
- sport ? ntohs(sport) : 0);
- print_uint(PRINT_JSON, "dport", NULL, ntohs(dport));
- print_bool(PRINT_JSON, "csum", NULL,
- flags & TUNNEL_ENCAP_FLAG_CSUM);
- print_bool(PRINT_JSON, "csum6", NULL,
- flags & TUNNEL_ENCAP_FLAG_CSUM6);
- print_bool(PRINT_JSON, "remcsum", NULL,
- flags & TUNNEL_ENCAP_FLAG_REMCSUM);
- close_json_object();
- } else {
- if (sport == 0)
- fputs("encap-sport auto ", f);
- else
- fprintf(f, "encap-sport %u", ntohs(sport));
- }
- }
-
tnl_print_encap(tb,
IFLA_GRE_ENCAP_TYPE,
IFLA_GRE_ENCAP_FLAGS,
--
1.7.10.4
next reply other threads:[~2018-01-22 14:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 14:50 Serhey Popovych [this message]
2018-01-22 17:31 ` [PATCH iproute2-next] gre/gre6: Post merge fixes David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516632608-17513-1-git-send-email-serhe.popovych@gmail.com \
--to=serhe.popovych@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox