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

From: Chris Friesen <[email-masked]>
Date: Thu, 21 Feb 2013 10:19:23 -0600

On 02/21/2013 10:04 AM, Stephen Hemminger wrote:

> It is not impossible to make this dynamic, you would need to make the table an allocated
> object and use proper locking like RCU. Oh, and because it is using GPL, the symbols
> would have to be EXPORT_SYMBOL_GPL(), so any dream of proprietary stacks there would
> be skating on even thinner ice.
> The lockdep stuff makes it more complicated but not impossible.

I'm not even thinking about closed-source stacks.  In our particular 
case the use-case is highly proprietary (not to mention legacy and 
obscure) but GPL-compliant.

> The bigger issue is how would you manage statically assigned id's which
> are not visible int headers or kernel source. How would you keep AF_VENDOR_PROTOCOL1 from
> not colliding with AF_VENDOR_PROTOCOL2?

I wouldn't expect many people to have multiple dynamic protocols loaded, 
so I'm not sure this would be a big problem.

For a fully generic solution I think we'd need to do dynamic numbering 
and export the mapping somewhere like /sys/class/net or 
/proc/sys/net/core/.  This would makes things a bit non-standard for the 
userspace code, but would allow arbitrary numbers of dynamic protocols 
without collision.

Or maybe we get really crazy and do protocol namespaces. :)

Chris