Thread (48 messages) 48 messages, 7 authors, 2009-03-03

Re: [PATCH 23/26] RDS: Add AF and PF #defines for RDS sockets

From: Rémi Denis-Courmont <hidden>
Date: 2009-02-25 11:36:52

On Wednesday 25 February 2009 09:26:48 ext David Miller, you wrote:
From: Andy Grover <redacted>
Date: Tue, 24 Feb 2009 17:30:40 -0800
quoted
@@ -191,7 +191,8 @@ struct ucred {
 #define AF_RXRPC     33      /* RxRPC sockets                */
 #define AF_ISDN              34      /* mISDN sockets                */
 #define AF_PHONET    35      /* Phonet sockets               */
-#define AF_MAX               36      /* For now.. */
+#define AF_RDS               36      /* RDS sockets                  */
+#define AF_MAX               37      /* For now.. */

 /* Protocol families, same as address families. */
 #define PF_UNSPEC    AF_UNSPEC
Pick an unused number, you don't have to increment AF_MAX
to allocate a value.
But that patch is also allocating a PF value and net/socket.c has:
        if (ops->family >= NPROTO) {
                printk(KERN_CRIT "protocol %d >= NPROTO(%d)\n", ops->family,
                       NPROTO);
                return -ENOBUFS;
        }

...while include/linux/net.h has:
#define NPROTO              AF_MAX

Also, the lock dependency checks can cope with AF_MAX, but not AF_MAX+1. I 
have gone through that myself... I can testify it's annoying when the latest 
socket family of the kernel version of the day failed to declare its lock 
classes. Then that family "works" but the one you're trying triggers obnoxious 
locking warnings that are not your own fault.
And I don't want to hear any whining about how you've
used this value of 36 internally for a long time or
anything like that.
So I guess you don't want to hear how AF_PHONET overloaded AF_ECONET before we 
published it :) But anyway, Econet had those cool properties that we did not 
use it, and that it had a private pointer in net_device (although Phonet does 
not need a private device pointer anymore) :P

-- 
Rémi Denis-Courmont
Maemo Software, Nokia Devices R&D
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help