* [PATCH] iptunnel: make some user care TUNNEL_FLAGS available in uapi
@ 2018-12-18 9:53 wenxu
2018-12-18 18:32 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: wenxu @ 2018-12-18 9:53 UTC (permalink / raw)
To: netdev
From: wenxu <wenxu@ucloud.cn>
ip l add dev tun type gretap external
ip r a 10.0.0.1 encap ip dst 192.168.152.171 id 1000 dev gretap
For gretap Key example when the command set the id but don't set the
TUNNEL_KEY flags. There is no key field in the send packet
In the lwtunnel situation, some TUNNEL_FLAGS should can be set by
userspace
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
include/net/ip_tunnels.h | 4 ----
include/uapi/linux/if_tunnel.h | 6 ++++++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index b0d022f..897db0a 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -144,15 +144,11 @@ struct ip_tunnel {
bool ignore_df;
};
-#define TUNNEL_CSUM __cpu_to_be16(0x01)
#define TUNNEL_ROUTING __cpu_to_be16(0x02)
-#define TUNNEL_KEY __cpu_to_be16(0x04)
-#define TUNNEL_SEQ __cpu_to_be16(0x08)
#define TUNNEL_STRICT __cpu_to_be16(0x10)
#define TUNNEL_REC __cpu_to_be16(0x20)
#define TUNNEL_VERSION __cpu_to_be16(0x40)
#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
-#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
#define TUNNEL_OAM __cpu_to_be16(0x0200)
#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index 1b3d148..06c0f14 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -160,4 +160,10 @@ enum {
};
#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
+
+#define TUNNEL_CSUM __cpu_to_be16(0x01)
+#define TUNNEL_KEY __cpu_to_be16(0x04)
+#define TUNNEL_SEQ __cpu_to_be16(0x08)
+#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
+
#endif /* _UAPI_IF_TUNNEL_H_ */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iptunnel: make some user care TUNNEL_FLAGS available in uapi
2018-12-18 9:53 [PATCH] iptunnel: make some user care TUNNEL_FLAGS available in uapi wenxu
@ 2018-12-18 18:32 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2018-12-18 18:32 UTC (permalink / raw)
To: wenxu; +Cc: netdev, Roopa Prabhu
On Tue, 18 Dec 2018 17:53:08 +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
>
> ip l add dev tun type gretap external
> ip r a 10.0.0.1 encap ip dst 192.168.152.171 id 1000 dev gretap
>
> For gretap Key example when the command set the id but don't set the
> TUNNEL_KEY flags. There is no key field in the send packet
>
> In the lwtunnel situation, some TUNNEL_FLAGS should can be set by
> userspace
>
> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
> include/net/ip_tunnels.h | 4 ----
> include/uapi/linux/if_tunnel.h | 6 ++++++
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
> index b0d022f..897db0a 100644
> --- a/include/net/ip_tunnels.h
> +++ b/include/net/ip_tunnels.h
> @@ -144,15 +144,11 @@ struct ip_tunnel {
> bool ignore_df;
> };
>
> -#define TUNNEL_CSUM __cpu_to_be16(0x01)
> #define TUNNEL_ROUTING __cpu_to_be16(0x02)
> -#define TUNNEL_KEY __cpu_to_be16(0x04)
> -#define TUNNEL_SEQ __cpu_to_be16(0x08)
> #define TUNNEL_STRICT __cpu_to_be16(0x10)
> #define TUNNEL_REC __cpu_to_be16(0x20)
> #define TUNNEL_VERSION __cpu_to_be16(0x40)
> #define TUNNEL_NO_KEY __cpu_to_be16(0x80)
> -#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
> #define TUNNEL_OAM __cpu_to_be16(0x0200)
> #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
> #define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
If these are UAPI, should they all be moved? Perhaps w/ renaming?
> diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
> index 1b3d148..06c0f14 100644
> --- a/include/uapi/linux/if_tunnel.h
> +++ b/include/uapi/linux/if_tunnel.h
> @@ -160,4 +160,10 @@ enum {
> };
>
> #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
> +
> +#define TUNNEL_CSUM __cpu_to_be16(0x01)
> +#define TUNNEL_KEY __cpu_to_be16(0x04)
> +#define TUNNEL_SEQ __cpu_to_be16(0x08)
> +#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
> +
> #endif /* _UAPI_IF_TUNNEL_H_ */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-18 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-18 9:53 [PATCH] iptunnel: make some user care TUNNEL_FLAGS available in uapi wenxu
2018-12-18 18:32 ` Jakub Kicinski
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).