[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200908050935.03272.remi.denis-courmont@nokia.com>
Date: Wed, 5 Aug 2009 09:35:03 +0300
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: ext Jan Engelhardt <jengelh@...ozas.de>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/2] net: implement a SO_PROTOCOL getsockoption
On Tuesday 04 August 2009 20:28:28 ext Jan Engelhardt wrote:
> Similar to SO_TYPE returning the socket type, SO_PROTOCOL allows to
> retrieve the protocol used with a given socket.
You can easily infer the protocol family from the address family from
getsockname().
As for the protocol, at least for raw IP sockets, you can get it from
sin_port/sin6_port, but I agree that SO_PROTOCOL is more generic.
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists