From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr20060.outbound.protection.outlook.com ([40.107.2.60]:48976 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbeBULV4 (ORCPT ); Wed, 21 Feb 2018 06:21:56 -0500 From: Petr Machata To: Serhey Popovych Cc: netdev@vger.kernel.org Subject: Re: [PATCH iproute2-next v2] ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag References: <9c10d7d8-467a-eeef-87a4-5a8c84891d64@gmail.com> Date: Wed, 21 Feb 2018 13:21:34 +0200 In-Reply-To: <9c10d7d8-467a-eeef-87a4-5a8c84891d64@gmail.com> (Serhey Popovych's message of "Wed, 21 Feb 2018 08:45:20 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org List-ID: Serhey Popovych writes: > Petr Machata wrote: >> For IP-in-IP tunnels, one can specify the [no]allow-localremote command >> when configuring a device. Under the hood, this flips the >> IP6_TNL_F_ALLOW_LOCAL_REMOTE flag on the netdevice. However, ip6gretap >> and ip6erspan devices, where the flag is also relevant, are not IP-in-IP >> tunnels, and thus there's no way to configure the flag on these >> netdevices. Therefore introduce the command to link_gre6 as well. >> >> The original support was introduced in commit >> 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") > > This would produce following checkpatch.pl error: > > ---------------------------------------------------------------------------------- > Commit b7a2f4a74cd0 ("ip: link_gre6.c: Support > IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") > ---------------------------------------------------------------------------------- > WARNING: Possible unwrapped commit description (prefer a maximum 75 > chars per line) > #14: > 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support > IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") > > ERROR: Please use git commit description style 'commit <12+ chars of > sha1> ("")' - ie: 'commit 21440d19d957 ("ip: > link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOT' > #14: > 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support > IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") > > You probably should address it. In general change looks good to me. v3 sent. The "unwrapped commit description" warning stays on the commit reference line, but I don't see a way to shorten it without triggering the above error again. Thanks, Petr From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <netdev-owner@vger.kernel.org> Received: from mail-lf0-f46.google.com ([209.85.215.46]:37103 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbeBUGp3 (ORCPT <rfc822;netdev@vger.kernel.org>); Wed, 21 Feb 2018 01:45:29 -0500 Received: by mail-lf0-f46.google.com with SMTP id y19so832084lfd.4 for <netdev@vger.kernel.org>; Tue, 20 Feb 2018 22:45:28 -0800 (PST) Subject: Re: [PATCH iproute2-next v2] ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag To: Petr Machata <petrm@mellanox.com>, netdev@vger.kernel.org References: <ddc93ea138f04a9e02f42f0c3d131908727a3a36.1519173148.git.petrm@mellanox.com> From: Serhey Popovych <serhe.popovych@gmail.com> Message-ID: <9c10d7d8-467a-eeef-87a4-5a8c84891d64@gmail.com> Date: Wed, 21 Feb 2018 08:45:20 +0200 MIME-Version: 1.0 In-Reply-To: <ddc93ea138f04a9e02f42f0c3d131908727a3a36.1519173148.git.petrm@mellanox.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x8MMG5WNMUHzE2HZHx8DYyTmeLXNhONXc" Sender: netdev-owner@vger.kernel.org List-ID: <netdev.vger.kernel.org> This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --x8MMG5WNMUHzE2HZHx8DYyTmeLXNhONXc Content-Type: multipart/mixed; boundary="z3oZjOv2evIOg1iQNLMYDTDImbjECD9Oq"; protected-headers="v1" From: Serhey Popovych <serhe.popovych@gmail.com> To: Petr Machata <petrm@mellanox.com>, netdev@vger.kernel.org Message-ID: <9c10d7d8-467a-eeef-87a4-5a8c84891d64@gmail.com> Subject: Re: [PATCH iproute2-next v2] ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag References: <ddc93ea138f04a9e02f42f0c3d131908727a3a36.1519173148.git.petrm@mellanox.com> In-Reply-To: <ddc93ea138f04a9e02f42f0c3d131908727a3a36.1519173148.git.petrm@mellanox.com> --z3oZjOv2evIOg1iQNLMYDTDImbjECD9Oq Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Petr Machata wrote: > For IP-in-IP tunnels, one can specify the [no]allow-localremote command= > when configuring a device. Under the hood, this flips the > IP6_TNL_F_ALLOW_LOCAL_REMOTE flag on the netdevice. However, ip6gretap > and ip6erspan devices, where the flag is also relevant, are not IP-in-I= P > tunnels, and thus there's no way to configure the flag on these > netdevices. Therefore introduce the command to link_gre6 as well. >=20 > The original support was introduced in commit > 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_L= OCAL_REMOTE flag") This would produce following checkpatch.pl error: -------------------------------------------------------------------------= --------- Commit b7a2f4a74cd0 ("ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") -------------------------------------------------------------------------= --------- WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #14: 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOT' #14: 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") You probably should address it. In general change looks good to me. >=20 > Signed-off-by: Petr Machata <petrm@mellanox.com> > --- >=20 > Notes: > Changes from v1 to v2: > =20 > - Rebase to iproute2-next >=20 > ip/link_gre6.c | 11 +++++++++++ > man/man8/ip-link.8.in | 14 ++++++++++++++ > 2 files changed, 25 insertions(+) >=20 > diff --git a/ip/link_gre6.c b/ip/link_gre6.c > index 6c77038..e0746bc 100644 > --- a/ip/link_gre6.c > +++ b/ip/link_gre6.c > @@ -48,6 +48,7 @@ static void gre_print_help(struct link_util *lu, int = argc, char **argv, FILE *f) > " [ dscp inherit ]\n" > " [ dev PHYS_DEV ]\n" > " [ fwmark MARK ]\n" > + " [ [no]allow-localremote ]\n" > " [ external ]\n" > " [ noencap ]\n" > " [ encap { fou | gue | none } ]\n" > @@ -346,6 +347,10 @@ get_failed: > invarg("invalid fwmark\n", *argv); > flags &=3D ~IP6_TNL_F_USE_ORIG_FWMARK; > } > + } else if (strcmp(*argv, "allow-localremote") =3D=3D 0) { > + flags |=3D IP6_TNL_F_ALLOW_LOCAL_REMOTE; > + } else if (strcmp(*argv, "noallow-localremote") =3D=3D 0) { > + flags &=3D ~IP6_TNL_F_ALLOW_LOCAL_REMOTE; > } else if (strcmp(*argv, "encaplimit") =3D=3D 0) { > NEXT_ARG(); > if (strcmp(*argv, "none") =3D=3D 0) { > @@ -534,6 +539,12 @@ static void gre_print_opt(struct link_util *lu, FI= LE *f, struct rtattr *tb[]) > if (oflags & GRE_CSUM) > print_bool(PRINT_ANY, "ocsum", "ocsum ", true); > =20 > + if (flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) > + print_bool(PRINT_ANY, > + "ip6_tnl_f_allow_local_remote", > + "allow-localremote ", > + true); > + > if (flags & IP6_TNL_F_USE_ORIG_FWMARK) { > print_bool(PRINT_ANY, > "ip6_tnl_f_use_orig_fwmark", > diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in > index 481589e..5dee9fc 100644 > --- a/man/man8/ip-link.8.in > +++ b/man/man8/ip-link.8.in > @@ -793,6 +793,8 @@ the following additional arguments are supported: > ] [ > .BI "dscp inherit" > ] [ > +.BI "[no]allow-localremote" > +] [ > .BI dev " PHYS_DEV " > ] [ > .RB external > @@ -857,6 +859,11 @@ flag is equivalent to the combination > - specifies a fixed flowlabel. > =20 > .sp > +.BI [no]allow-localremote > +- specifies whether to allow remote endpoint to have an address config= ured on > +local host. > + > +.sp > .BI tclass " TCLASS" > - specifies the traffic class field on > tunneled packets, which can be specified as either a two-digit > @@ -927,6 +934,8 @@ the following additional arguments are supported: > ] [ > .BR erspan_hwid " \fIhwid " > ] [ > +.BI "[no]allow-localremote" > +] [ > .RB external > ] > =20 > @@ -965,6 +974,11 @@ traffic's source port and direction. > is a 6-bit value for users to configure. > =20 > .sp > +.BI [no]allow-localremote > +- specifies whether to allow remote endpoint to have an address config= ured on > +local host. > + > +.sp > .BR external > - make this tunnel externally controlled (or not, which is the default= ). > In the kernel, this is referred to as collect metadata mode. This fla= g is >=20 --z3oZjOv2evIOg1iQNLMYDTDImbjECD9Oq-- --x8MMG5WNMUHzE2HZHx8DYyTmeLXNhONXc 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) iQEcBAEBAgAGBQJajRWFAAoJEBTawMmQ61bBwrkH/1TUeAo/n5tP1gz8we2ovgLY fKiGDHuzJ70KO4Xj22HVcn/wSPsNk5Ri6fW4wv/6GP3bklayDRMnq6UM9UHShYK7 DhfrpDTSyyMcLyV8tPhjZiXyx01iV/xRenheFTtUeV30g4T124Cb+I2YxhIn3xMl ckK6ITFIETAyJHAA3q3L/6TUUSs60Jxa/EmlIGW55SWLUyEmri1ZVb0sDnYAdgBW CRwQWfok0uQy+Zj8Xgva98n86FeFGrqRE8N7ryRxhVszi4lHDfBUFOKkuBLBfC34 99x/Wd4SzU3viF1UmxXaRMiYtIYeArcje2nQ/SPTsyMz5YoEY1sk67TKRhWALH4= =cEoH -----END PGP SIGNATURE----- --x8MMG5WNMUHzE2HZHx8DYyTmeLXNhONXc-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <netdev-owner@vger.kernel.org> Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:35642 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750786AbeBUAra (ORCPT <rfc822;netdev@vger.kernel.org>); Tue, 20 Feb 2018 19:47:30 -0500 From: Petr Machata <petrm@mellanox.com> To: <netdev@vger.kernel.org> Subject: [PATCH iproute2-next v2] ip: link_gre6.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag Message-Id: <ddc93ea138f04a9e02f42f0c3d131908727a3a36.1519173148.git.petrm@mellanox.com> Date: Wed, 21 Feb 2018 01:47:23 +0100 MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org List-ID: <netdev.vger.kernel.org> For IP-in-IP tunnels, one can specify the [no]allow-localremote command when configuring a device. Under the hood, this flips the IP6_TNL_F_ALLOW_LOCAL_REMOTE flag on the netdevice. However, ip6gretap and ip6erspan devices, where the flag is also relevant, are not IP-in-IP tunnels, and thus there's no way to configure the flag on these netdevices. Therefore introduce the command to link_gre6 as well. The original support was introduced in commit 21440d19d957 ("ip: link_ip6tnl.c/ip6tunnel.c: Support IP6_TNL_F_ALLOW_LOCAL_REMOTE flag") Signed-off-by: Petr Machata <petrm@mellanox.com> --- Notes: Changes from v1 to v2: - Rebase to iproute2-next ip/link_gre6.c | 11 +++++++++++ man/man8/ip-link.8.in | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 6c77038..e0746bc 100644 --- a/ip/link_gre6.c +++ b/ip/link_gre6.c @@ -48,6 +48,7 @@ static void gre_print_help(struct link_util *lu, int argc, char **argv, FILE *f) " [ dscp inherit ]\n" " [ dev PHYS_DEV ]\n" " [ fwmark MARK ]\n" + " [ [no]allow-localremote ]\n" " [ external ]\n" " [ noencap ]\n" " [ encap { fou | gue | none } ]\n" @@ -346,6 +347,10 @@ get_failed: invarg("invalid fwmark\n", *argv); flags &= ~IP6_TNL_F_USE_ORIG_FWMARK; } + } else if (strcmp(*argv, "allow-localremote") == 0) { + flags |= IP6_TNL_F_ALLOW_LOCAL_REMOTE; + } else if (strcmp(*argv, "noallow-localremote") == 0) { + flags &= ~IP6_TNL_F_ALLOW_LOCAL_REMOTE; } else if (strcmp(*argv, "encaplimit") == 0) { NEXT_ARG(); if (strcmp(*argv, "none") == 0) { @@ -534,6 +539,12 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) if (oflags & GRE_CSUM) print_bool(PRINT_ANY, "ocsum", "ocsum ", true); + if (flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) + print_bool(PRINT_ANY, + "ip6_tnl_f_allow_local_remote", + "allow-localremote ", + true); + if (flags & IP6_TNL_F_USE_ORIG_FWMARK) { print_bool(PRINT_ANY, "ip6_tnl_f_use_orig_fwmark", diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 481589e..5dee9fc 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -793,6 +793,8 @@ the following additional arguments are supported: ] [ .BI "dscp inherit" ] [ +.BI "[no]allow-localremote" +] [ .BI dev " PHYS_DEV " ] [ .RB external @@ -857,6 +859,11 @@ flag is equivalent to the combination - specifies a fixed flowlabel. .sp +.BI [no]allow-localremote +- specifies whether to allow remote endpoint to have an address configured on +local host. + +.sp .BI tclass " TCLASS" - specifies the traffic class field on tunneled packets, which can be specified as either a two-digit @@ -927,6 +934,8 @@ the following additional arguments are supported: ] [ .BR erspan_hwid " \fIhwid " ] [ +.BI "[no]allow-localremote" +] [ .RB external ] @@ -965,6 +974,11 @@ traffic's source port and direction. is a 6-bit value for users to configure. .sp +.BI [no]allow-localremote +- specifies whether to allow remote endpoint to have an address configured on +local host. + +.sp .BR external - make this tunnel externally controlled (or not, which is the default). In the kernel, this is referred to as collect metadata mode. This flag is -- 2.4.11