Re: Bug#659075: [rt.cpan.org #61577] ->sockdomain and ->socktype undefined on newly ->accept'ed sockets
- To: Dominic Hargreaves <dom@earth.li>
- Cc: 659075@bugs.debian.org, debian-bsd@lists.debian.org
- Subject: Re: Bug#659075: [rt.cpan.org #61577] ->sockdomain and ->socktype undefined on newly ->accept'ed sockets
- From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
- Date: Thu, 16 Feb 2012 18:24:57 -0500
- Message-id: <[🔎] 4F3D9049.4070506@fifthhorseman.net>
- In-reply-to: <20120216215806.GK28729@urchin.earth.li>
- References: <RT-Ticket-61577@rt.cpan.org> <87zkcsr19w.fsf@pip.fifthhorseman.net> <20120209062112.GA31669@hagar.it.helsinki.fi> <4F33FC8C.1050105@fifthhorseman.net> <rt-3.8.HEAD-17363-1328807022-1463.61577-7-0@rt.cpan.org> <rt-3.8.HEAD-10811-1329200243-764.61577-7-0@rt.cpan.org> <rt-3.8.HEAD-10811-1329232961-972.61577-7-0@rt.cpan.org> <4F3A88E4.4030109@fifthhorseman.net> <87obsznypg.fsf@pip.fifthhorseman.net> <20120216215806.GK28729@urchin.earth.li>
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 [0]).
(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)
--dkg
[0] http://pastebin.com/5spLFG3V
--- 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 */
#endif
+#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;
goto integer;
+ case SO_PROTO:
+ optval = so->so_proto->pr_protocol;
+ goto integer;
+
case SO_LISTENQLEN:
optval = so->so_qlen;
goto integer;
Reply to: