X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fvs_socket.h;h=9173bfe26f2e5f5590e055c550c74c9b1c103650;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=c9c624442593fac6ce6c075a465da7f4503b87b0;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/include/linux/vs_socket.h b/include/linux/vs_socket.h index c9c624442..9173bfe26 100644 --- a/include/linux/vs_socket.h +++ b/include/linux/vs_socket.h @@ -7,24 +7,16 @@ /* socket accounting */ #include -#include static inline int vx_sock_type(int family) { - switch (family) { - case PF_UNSPEC: - return VXA_SOCK_UNSPEC; - case PF_UNIX: - return VXA_SOCK_UNIX; - case PF_INET: - return VXA_SOCK_INET; - case PF_INET6: - return VXA_SOCK_INET6; - case PF_PACKET: - return VXA_SOCK_PACKET; - default: - return VXA_SOCK_OTHER; - } + int type = 4; + + if (family > 0 && family < 3) + type = family; + else if (family == PF_INET6) + type = 3; + return type; } #define vx_acc_sock(v,f,p,s) \