[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27696.1392392957@warthog.procyon.org.uk>
Date: Fri, 14 Feb 2014 15:49:17 +0000
From: David Howells <dhowells@...hat.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: dhowells@...hat.com, netdev@...r.kernel.org
Subject: Getting a NIC's MTU size
One further question: If I want to get the MTU size of the NIC through which
packets will go to get to a particular peer, can I do:
struct rtable *rt;
struct flowi4 fl4;
unsigned if_mtu;
rt = ip_route_output_ports(&init_net, &fl4, NULL,
peer->srx.transport.sin.sin_addr.s_addr, 0,
htons(7000), htons(7001),
IPPROTO_UDP, 0, 0);
if_mtu = rt->dst->dev->mtu;
dst_release(&rt->dst);
Or might this go wrong if rt->dst->dev changes under me? Can it change
without replacing the dst record?
David
--
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