sock_getsockopt() not exported

7 messages, 3 authors, 2012-10-19 · open the first message on its own page

sock_getsockopt() not exported

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

Re: sock_getsockopt() not exported

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()

RE: sock_getsockopt() not exported

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

RE: sock_getsockopt() not exported

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.

Re: sock_getsockopt() not exported

From: David Miller <davem@davemloft.net>
Date: 2012-10-18 19:04:10

From: "David Laight" <redacted>
Date: Thu, 18 Oct 2012 13:03:55 +0100
The problem is that it might be needed by an 'out of tree' driver.
We don't care.

RE: sock_getsockopt() not exported

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

Re: sock_getsockopt() not exported

From: David Miller <davem@davemloft.net>
Date: 2012-10-19 17:13:00

From: "David Laight" <redacted>
Date: Fri, 19 Oct 2012 10:26:52 +0100
The Linux interface is all done with wrapper functions
that get compiled on the target system so we can ship
a big binary 'blob'.
Your maintainence problem, not our's.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help