Re: Bug#659075: [rt.cpan.org #61577] ->sockdomain and ->socktype undefined on newly ->accept'ed sockets
On 02/16/2012 04:58 PM, Dominic Hargreaves wrote:
> On Thu, Feb 16, 2012 at 12:18:03AM -0500, Daniel Kahn Gillmor wrote:
>> Debian folks -- is this now a patch that folks feel comfortable
>> applying in anticipation of such a fix upstream?
> Given the way the thread's gone so far, I think I'd prefer to see an
> upstream commit/release first, unless the issue is particularly urgent?
Well, it appears to be related to a couple other bugs, and upstream has
done nothing about it for over a year, which leaves me wondering when it
will get resolved upstream.
The change doesn't introduce any API modifications, and (as far as i can
tell) the only possible hiccup for debian will be dealing with the
unimplemented symbol Socket::SO_PROTOCOL on kfreebsd.
Apparently freebsd doesn't currently implement SO_PROTOCOL, though i
haven't been able to find a reason for that (i did find someone's
proposed patch, though ).
(i'm cc'ing the debian-bsd list here in hopes that they know of some
other way to retrieve the protocol of an existing socket from userspace
with that kernel)
--- src/sys/sys/socket.h.orig 2011-02-16 16:18:46.000000000 +0200
+++ src/sys/sys/socket.h 2011-11-21 05:02:21.000000000 +0200
@@ -140,6 +140,8 @@
#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */
#define SO_USETFIB 0x1014 /* use this FIB to route */
+#define SO_PROTO 0x1015
+#define SO_PROTOCOL SO_PROTO
* Structure used for manipulating linger option.
--- src/sys/kern/uipc_socket.c.orig 2011-02-16 16:18:46.000000000 +0200
+++ src/sys/kern/uipc_socket.c 2011-11-21 05:05:09.000000000 +0200
@@ -2734,6 +2734,10 @@
optval = so->so_type;
+ case SO_PROTO:
+ optval = so->so_proto->pr_protocol;
+ goto integer;
optval = so->so_qlen;