From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: Re: [PATCH iproute2 v2 2/3] link_iptnl: Print tunnel mode Date: Tue, 2 Jan 2018 23:29:28 +0200 Message-ID: <865c9c45-503d-9de2-aff4-ae2e5e5a8654@gmail.com> References: <20180102115413.37666ab5@xeon-e3> <1514926965-22061-1-git-send-email-serhe.popovych@gmail.com> <20180102131354.0e417fd4@xeon-e3> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MifmEUrNer1PuEtqiCz0m42g4smlwQ6Uz" Cc: netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mail-lf0-f67.google.com ([209.85.215.67]:34358 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745AbeABV3j (ORCPT ); Tue, 2 Jan 2018 16:29:39 -0500 Received: by mail-lf0-f67.google.com with SMTP id h140so6168653lfg.1 for ; Tue, 02 Jan 2018 13:29:38 -0800 (PST) In-Reply-To: <20180102131354.0e417fd4@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MifmEUrNer1PuEtqiCz0m42g4smlwQ6Uz Content-Type: multipart/mixed; boundary="hFO0Ni1m1y2DRA1ERxl9ITgM7qftLKLk1"; protected-headers="v1" From: Serhey Popovych To: Stephen Hemminger Cc: netdev@vger.kernel.org Message-ID: <865c9c45-503d-9de2-aff4-ae2e5e5a8654@gmail.com> Subject: Re: [PATCH iproute2 v2 2/3] link_iptnl: Print tunnel mode References: <20180102115413.37666ab5@xeon-e3> <1514926965-22061-1-git-send-email-serhe.popovych@gmail.com> <20180102131354.0e417fd4@xeon-e3> In-Reply-To: <20180102131354.0e417fd4@xeon-e3> --hFO0Ni1m1y2DRA1ERxl9ITgM7qftLKLk1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stephen Hemminger wrote: > On Tue, 2 Jan 2018 23:02:45 +0200 > Serhey Popovych wrote: >=20 >> Tunnel mode does not appear in parameters print for iptnl >> supported tunnels like ipip and sit, while printed for >> ip6tnl. >> >> Print tunnel mode as "proto" field name for JSON and >> without any name when printing to cli to follow ip6tnl >> behaviour. >> >> For non JSON output we have: >> >> $ ip -d link show dev sit1 >> >> Before: >> ------- >> 17: sit1@NONE: mtu 1480 qdisc noop state DOWN ... >> link/sit X.X.X.X brd 0.0.0.0 promiscuity 0 >> sit remote any local X.X.X.X ... >> ~~~ >> >> After: >> ------ >> 17: sit1@NONE: mtu 1480 qdisc noop state DOWN ... >> link/sit X.X.X.X brd 0.0.0.0 promiscuity 0 >> sit any remote any local X.X.X.X ... >> ^^^ >> >> Signed-off-by: Serhey Popovych >> --- >> v2: Addressed comments: "proto ipip" vs "proto ip4ip4" for >> IPPROTO_IPIP tunnel type. Add example to message. >> >> ip/link_iptnl.c | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c >> index d4d935b..b6ef95d 100644 >> --- a/ip/link_iptnl.c >> +++ b/ip/link_iptnl.c >> @@ -372,6 +372,23 @@ static void iptunnel_print_opt(struct link_util *= lu, FILE *f, struct rtattr *tb[ >> if (tb[IFLA_IPTUN_COLLECT_METADATA]) >> print_bool(PRINT_ANY, "external", "external ", true); >> =20 >> + if (tb[IFLA_IPTUN_PROTO]) { >> + switch (rta_getattr_u8(tb[IFLA_IPTUN_PROTO])) { >> + case IPPROTO_IPIP: >> + print_string(PRINT_ANY, "proto", "%s ", "ipip"); >> + break; >> + case IPPROTO_IPV6: >> + print_string(PRINT_ANY, "proto", "%s ", "ip6ip"); >> + break; >> + case IPPROTO_MPLS: >> + print_string(PRINT_ANY, "proto", "%s ", "mplsip"); >> + break; >> + case 0: >> + print_string(PRINT_ANY, "proto", "%s ", "any"); >> + break; >> + } >> + } >> + >> if (tb[IFLA_IPTUN_REMOTE]) { >> unsigned int addr =3D rta_getattr_u32(tb[IFLA_IPTUN_REMOTE]); >=20 > Thanks for fixing the ip4 value. >=20 > When you fix one thing, you need to resend whole patch series. Submitted v2 series. Thank you for the tip! >=20 >=20 --hFO0Ni1m1y2DRA1ERxl9ITgM7qftLKLk1-- --MifmEUrNer1PuEtqiCz0m42g4smlwQ6Uz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJaS/nGAAoJEBTawMmQ61bB32IH/j42EwYZXhbmiPFsRIFEb5TL eVdV+yShEwtBG8F2JyXwoUgwLghu2GIaD74akceJAxCxCY5Kgw1vBaDMAFhZs80/ 0C1X51Vn2WQ6eUtkYGPywhA23DpB9SSgO0BzBcXPtE2q5viDB4AyTPtVyEVOS6Fg UEmKytDKO/HK1+ExTSYFAUGmtp0+LYKdmikl+xpRS/qGPEJ01x5dzO15MTOTa9Oc lpHHSMHbeOeQwzxKngAMRgxAhSZHjt74bnqvjmq8C9veiyTgBzpT5LbKunZeK8wL Do4bQbYeRZn71nb/gG55tNDSATPgko8mXzxykAG7RBbxE/1k5B/JHnKIZr8r0Wg= =omVJ -----END PGP SIGNATURE----- --MifmEUrNer1PuEtqiCz0m42g4smlwQ6Uz--