netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] iptunnel: Allow GRE_KEY for vti interface
@ 2013-12-05 16:19 Hangbin Liu
  2013-12-28 19:31 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Hangbin Liu @ 2013-12-05 16:19 UTC (permalink / raw)
  To: network dev; +Cc: Stephen Hemminger, Steffen Klassert, Hangbin Liu

The vti interface will use GRE_KEY to match the right policy in kernel. So we
can not return fail when the tunnel is vti.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iptunnel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 40186d3..950f984 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -240,8 +240,8 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
 		}
 	}
 
-	if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
-		if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
+	if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
+		if (!(p->i_flags & VTI_ISVTI) && (p->iph.protocol != IPPROTO_GRE)) {
 			fprintf(stderr, "Keys are not allowed with ipip and sit tunnels\n");
 			return -1;
 		}
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] iptunnel: Allow GRE_KEY for vti interface
  2013-12-05 16:19 [PATCH iproute2] iptunnel: Allow GRE_KEY for vti interface Hangbin Liu
@ 2013-12-28 19:31 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-12-28 19:31 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: network dev, Steffen Klassert

On Fri,  6 Dec 2013 00:19:01 +0800
Hangbin Liu <liuhangbin@gmail.com> wrote:

> The vti interface will use GRE_KEY to match the right policy in kernel. So we
> can not return fail when the tunnel is vti.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  ip/iptunnel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ip/iptunnel.c b/ip/iptunnel.c
> index 40186d3..950f984 100644
> --- a/ip/iptunnel.c
> +++ b/ip/iptunnel.c
> @@ -240,8 +240,8 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
>  		}
>  	}
>  
> -	if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
> -		if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
> +	if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
> +		if (!(p->i_flags & VTI_ISVTI) && (p->iph.protocol != IPPROTO_GRE)) {
>  			fprintf(stderr, "Keys are not allowed with ipip and sit tunnels\n");
>  			return -1;
>  		}

Accepted. Hope this works for everyone

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-28 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 16:19 [PATCH iproute2] iptunnel: Allow GRE_KEY for vti interface Hangbin Liu
2013-12-28 19:31 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).