]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iptunnel: make TUNNEL_FLAGS available in uapi
authorwenxu <wenxu@ucloud.cn>
Wed, 19 Dec 2018 06:11:15 +0000 (14:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 23:58:01 +0000 (15:58 -0800)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_tunnels.h
include/uapi/linux/if_tunnel.h

index b0d022ff6ea1702037b84a038f3c81ce56540aa4..5ce926701bd02f102b5b1dca28e17d50616a5fd1 100644 (file)
@@ -144,25 +144,6 @@ 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)
-#define TUNNEL_VXLAN_OPT       __cpu_to_be16(0x1000)
-#define TUNNEL_NOCACHE         __cpu_to_be16(0x2000)
-#define TUNNEL_ERSPAN_OPT      __cpu_to_be16(0x4000)
-
-#define TUNNEL_OPTIONS_PRESENT \
-               (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
-
 struct tnl_ptk_info {
        __be16 flags;
        __be16 proto;
index 1b3d148c4560813089b13215e1ab9b961c8c54e0..7d9105533c7b93b0e92d7679292a8c6447a8d08c 100644 (file)
@@ -160,4 +160,24 @@ enum {
 };
 
 #define IFLA_VTI_MAX   (__IFLA_VTI_MAX - 1)
+
+#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)
+#define TUNNEL_VXLAN_OPT       __cpu_to_be16(0x1000)
+#define TUNNEL_NOCACHE         __cpu_to_be16(0x2000)
+#define TUNNEL_ERSPAN_OPT      __cpu_to_be16(0x4000)
+
+#define TUNNEL_OPTIONS_PRESENT \
+               (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
+
 #endif /* _UAPI_IF_TUNNEL_H_ */