Subject: Re: why is it not allowed to add a new socket protocol family as an external module?

From: Stephen Hemminger <[email-masked]>
Date: Wed, 20 Feb 2013 15:23:25 -0800

On Wed, 20 Feb 2013 10:56:13 -0600
Chris Friesen <[email-masked]> wrote:

> Hi,
> 
> I was just wondering why the kernel doesn't allow a new network protocol 
> family to be loaded as as a kernel module built outside the kernel 
> source tree.
> 
> Most of the networking code would seem to allow this, but the check for
> "if (ops->family >= NPROTO)" in sock_register() means that only protocol 
> families defined in socket.h can be registered.
> 
> Was this intentional for ideological reasons, or has nobody wanted to be 
> able to add arbitrary network protocols without patching the kernel and 
> rebuilding?
> 

If you want an answer, to the question, use a tool like cscope and
learn to read the kernel code. There are several tables of pointers sized by NPROTO.