Actually I know this clearly, just bring your attention on this issue , I think this is a mechanism issue. Though we have no good idea to fix this, but I believe firmly that you kernel experts must have some smart and beautiful solution. Thanks.
-----Original Message----- From: David Miller [mailto:da...@davemloft.net] Sent: 2019年4月24日 9:43 To: Bai, Haiqing Cc: netdev@vger.kernel.org; Elmahrad, Abdelghani Subject: Re: [PATCH] net: socket: Exit earlier from __sock_create if CONFIG_IPV6 is disabled From: Haiqing Bai <haiqing....@windriver.com> Date: Tue, 23 Apr 2019 17:00:23 +0800 > diff --git a/net/socket.c b/net/socket.c > index 8255f5bda0aa..7927c2bcad65 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -1339,6 +1339,11 @@ int __sock_create(struct net *net, int family, int > type, int protocol, > if (type < 0 || type >= SOCK_MAX) > return -EINVAL; > > +#if !(IS_ENABLED(CONFIG_IPV6)) > + if (family == AF_INET6) > + return -EAFNOSUPPORT; > +#endif There is no way I am allowing this kind of layering violation. It's just rediculous.