[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMefCkC8CSVLSgy9J4TxiXCAQ-ueLTgk1pT2QJ6hACyNZf_kTA@mail.gmail.com>
Date: Tue, 21 Jul 2015 13:09:10 -0400
From: Guru Prasad <gurupras@...falo.edu>
To: netdev@...r.kernel.org
Subject: Identifying underlying interface from struct sock
Hi,
First, I apologize for posting on the netdev forum. Majordomo did not
list any other network related mailing list.
Is there a way to identify the underlying network interface from an
instance of struct sock? I realize that the socket is abstract and
shouldn't/doesn't necessarily depend on the underlying interface, but
say, with TCP, where the connection is endpoint oriented, shouldn't
this mean that the socket maintains a reference to the interface to
which it is associated?
I tried
dev = dev_get_by_index(sock_net(sk), skb->skb_iif);
and
dev = skb->dev;
but in both cases, dev was NULL.
I'm trying to reference the underlying interface to determine whether
the conditions present in that interface are acceptable for
transmission.
--
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