History

gtp: Allow to create GTP device without FDs

Currently, when the user wants to create GTP device, he has to provide file handles to the sockets created in userspace (IFLA_GTP_FD0, IFLA_GTP_FD1). This behaviour is not ideal, considering the option of adding support for GTP device creation through ip link. Ip link application is not a good place to create such sockets. This patch allows to create GTP device without providing IFLA_GTP_FD0 and IFLA_GTP_FD1 arguments. If the user sets IFLA_GTP_CREATE_SOCKETS attribute, then GTP module takes care of creating UDP sockets by itself. Sockets are created with the commonly known UDP ports used for GTP protocol (GTP0_PORT and GTP1U_PORT). In this case we don't have to provide encap_destroy because no extra deinitialization is needed, everything is covered by udp_tunnel_sock_release. Note: GTP instance created with only this change applied, does not handle GTP Echo Requests. This is implemented in the following patch.

Wojciech Drewek committed 4 years ago

Commit b20dc3c1 parent 59d59232 files · +85 −17Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/if_link.h+1−0
@@ -887,6 +887,7 @@ enum { · 886 unmodified lines
887887 IFLA_GTP_FD1,
888888 IFLA_GTP_PDP_HASHSIZE,
889889 IFLA_GTP_ROLE,
890+ IFLA_GTP_CREATE_SOCKETS,
890891 __IFLA_GTP_MAX,
891892 };
892893 #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)