netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dhowells@redhat.com
Cc: hannes@stressinduktion.org, netdev@vger.kernel.org
Subject: Re: Getting a NIC's MTU size
Date: Mon, 17 Feb 2014 00:21:53 -0500 (EST)	[thread overview]
Message-ID: <20140217.002153.1121569813590047048.davem@davemloft.net> (raw)
In-Reply-To: <27696.1392392957@warthog.procyon.org.uk>

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.

  parent reply	other threads:[~2014-02-17  5:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14 14:36 Does ICMP_FRAG_NEEDED automatically update the routing cache? David Howells
2014-02-14 14:44 ` Hannes Frederic Sowa
2014-02-14 15:00 ` David Howells
2014-02-14 15:03   ` Hannes Frederic Sowa
2014-02-14 15:42   ` David Howells
2014-02-14 15:49   ` Getting a NIC's MTU size David Howells
2014-02-14 16:52     ` Hannes Frederic Sowa
2014-02-17  5:21     ` David Miller [this message]
2014-02-20 17:30     ` David Howells
2014-02-20 18:12       ` Hannes Frederic Sowa
2014-02-20 18:45       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140217.002153.1121569813590047048.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).