From: David Laight <hidden> Date: 2012-10-18 09:13:06
I've noticed that net/core/sock.c contains an
EXPORT_SYMBOL(sock_setsockopt)
but is missing the corresponding
EXPORT_SYMBOL(sock_getsockopt)
In-kernel users of sockets probably manage without
needing to read SOL_SOCKET options.
(They do need to set SO_REUSADDR and SO_KEEPALIVE.)
David
From: Eric Dumazet <hidden> Date: 2012-10-18 09:30:15
On Thu, 2012-10-18 at 10:11 +0100, David Laight wrote:
I've noticed that net/core/sock.c contains an
EXPORT_SYMBOL(sock_setsockopt)
but is missing the corresponding
EXPORT_SYMBOL(sock_getsockopt)
In-kernel users of sockets probably manage without
needing to read SOL_SOCKET options.
(They do need to set SO_REUSADDR and SO_KEEPALIVE.)
sock_setsockopt() is exported because sunrpc needs it, and sunrpc can be
a module
sock_getsockopt() is not exported because no module needs it yet.
The day one user needs it, we'll add the EXPORT_SYMBOL()
From: David Laight <hidden> Date: 2012-10-18 12:09:11
On Thu, 2012-10-18 at 10:11 +0100, David Laight wrote:
quoted
I've noticed that net/core/sock.c contains an
EXPORT_SYMBOL(sock_setsockopt)
but is missing the corresponding
EXPORT_SYMBOL(sock_getsockopt)
In-kernel users of sockets probably manage without
needing to read SOL_SOCKET options.
(They do need to set SO_REUSADDR and SO_KEEPALIVE.)
sock_setsockopt() is exported because sunrpc needs it, and sunrpc can be
a module
sock_getsockopt() is not exported because no module needs it yet.
The day one user needs it, we'll add the EXPORT_SYMBOL()
The problem is that it might be needed by an 'out of tree' driver.
We already have the function:
static int
do_getsockopt(struct socket *sock, int level, int name, void *val, int len)
{
mm_segment_t prevfs = get_fs();
int rval;
set_fs(KERNEL_DS);
if (level == SOL_SOCKET) {
/* There is no EXPORT_SYMBOL(sock_getsockopt) in net/core/sock.c */
rval = -EINVAL; // sock_getsockopt(sock, level, name, val, &len);
} else {
rval = sock->ops->getsockopt(sock, level, name, val, &len);
}
set_fs(prevfs);
return rval;
}
We need to get options (for SCTP) fortunately they aren't
SOL_SOCKET ones.
David
From: Eric Dumazet <hidden> Date: 2012-10-18 12:28:01
On Thu, 2012-10-18 at 13:03 +0100, David Laight wrote:
quoted
On Thu, 2012-10-18 at 10:11 +0100, David Laight wrote:
quoted
I've noticed that net/core/sock.c contains an
EXPORT_SYMBOL(sock_setsockopt)
but is missing the corresponding
EXPORT_SYMBOL(sock_getsockopt)
In-kernel users of sockets probably manage without
needing to read SOL_SOCKET options.
(They do need to set SO_REUSADDR and SO_KEEPALIVE.)
sock_setsockopt() is exported because sunrpc needs it, and sunrpc can be
a module
sock_getsockopt() is not exported because no module needs it yet.
The day one user needs it, we'll add the EXPORT_SYMBOL()
The problem is that it might be needed by an 'out of tree' driver.
We already have the function:
We dont care of out of tree drivers.
Thats really simple.
Submit this driver, and add the EXPORT_SYMBOL() you need at that time.
From: David Laight <hidden> Date: 2012-10-19 09:37:49
quoted
The problem is that it might be needed by an 'out of tree' driver.
We already have the function:
We dont care of out of tree drivers.
Thats really simple.
Submit this driver, and add the EXPORT_SYMBOL() you need at that time.
Even if management would release the source, you wouldn't
want 4MB of source for an ss7 protocol stack for a card
that isn't generally available, and that needs another
similar sized driver (and libraries etc) to be useful.
The Linux interface is all done with wrapper functions
that get compiled on the target system so we can ship
a big binary 'blob'.
David