Thread (11 messages) flat view 11 messages, 3 authors, 2014-02-20

Re: Getting a NIC's MTU size

From: David Miller <davem@davemloft.net>
Date: 2014-02-17 05:21:55

From: David Howells <dhowells@redhat.com>
Date: Fri, 14 Feb 2014 15:49:17 +0000
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:
As has been suggested or at least hinted to by others, you have to use
the route dst's device pointer.

Practically speaking, this means you'll have to cache the route, just
like we do in ipv4 sockets.  And on each packet send 1) validate the
route and relookup if it's become obsolute 2) dereference the dst->dev
to get the mtu.

This is because routes can change dynamically as can the physical
device's MTU setting, you'll therefore have to evaluate everything
on every packet send.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help