[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180526093912.E8D563A42D4@snark.thyrsus.com>
Date: Sat, 26 May 2018 05:39:12 -0400 (EDT)
From: esr@...rsus.com (Eric S. Raymond)
To: netdev@...r.kernel.org
Subject: Is it possible to get device information via CMSG?
I'm trying to untangle some nasty code in the Mills implementation of
NTP. I could simplify it a lot if there were a way to query a packet
to find out the name of the network interface it arrived on. (At the
moment the code has to iterate over all interfaces checking for
traffic on each one just so it doesn't lose that information.)
This seems like the kind of thing the CMSG macros are intended to
support, but I can't find anywhere a specification of what cmsg_level
and cmsg_type values are valid and what their semantics are.
So I have two questions:
1. Is there a cmsg_level/cmsg_type combination that will return the
name of the device the packet arrived through?
2. Is the set of possible cmsg_level and cmsg_type values documented
anywhere? If not, how would one go about assemnbling such information?
(I would be willing to write a man page about this.)
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
You [should] not examine legislation in the light of the benefits it will
convey if properly administered, but in the light of the wrongs it
would do and the harm it would cause if improperly administered
-- Lyndon Johnson, former President of the U.S.
Powered by blists - more mailing lists