Wildcard-socket simplification hits a wall

Eric S. Raymond esr at thyrsus.com
Fri Mar 31 23:30:05 UTC 2017


Kurt Roeckx <kurt at roeckx.be>:
> > One might expect this to be available via a CMSG lookup into recmvsg's
> > per-package auxiliary headers, analogously to the way we now get the
> > packet-arrival timestamp (see ntpd/ntp_packetstamp.c).  It's the only
> > place for the information to be that has the right locality.
> 
> Have you look to things like IP_PKTINFO?

Nope.  Thanks to the @!%^#~! crappy documentation, I didn't know that was an
identifier of interest until you pointed it out. Neither the CMSG(3) or ip(7)
manual pages hint that it exists.  Because heaven forfend that they should
either list CMSG capabilities or point unambiguously at someplace that
does, that would be too fscking much like being *helpful*.

*grumble*

Now that I've looked at it, it halfway solves the problem in a rather
frustrating way...maybe.  Or maybe not at all.  Yeah, it means you can
back out an "interface index" which designates a physical interface, or its
local address. But then you have the problem of intepreting that index or
address.

The only way I can presently see to do this this is by keeping an
up-to-date list of physical interfaces via getifaddrs() and matching
the local address aginst it.  Which would be fine, except that
dropping our dependency on getifaddrs() and related non-standardized
APIs was the whole point of the intended simplification.

:-(
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.



More information about the devel mailing list