Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2018 03:33:16 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        freebsd-net@freebsd.org
Cc:        kempe@lysator.liu.se
Subject:   Re: Patching ng_iface to allow setting the MTU via netgraph API
Message-ID:  <48910140-ef82-dd21-3ca3-924e80e93b3b@grosbein.net>
In-Reply-To: <33666112-c7e1-df6c-dfd5-22de0c1166fa@lysator.liu.se>
References:  <33666112-c7e1-df6c-dfd5-22de0c1166fa@lysator.liu.se>

next in thread | previous in thread | raw e-mail | index | archive | help
11.10.2018 2:43, Andreas Kempe wrote:

> I am working on a meshnet concept and am using netgraph to put it right
> on top of the MAC layer. I am using ng_iface to do some tunneling of IP
> over my protocol and I thought it would be nice to be able to set the
> MTU of the created interface using the netgraph interface.
> 
> I created a patch to do just that and thought I could share it if
> someone would find it worthwhile using for something, but I couldn't
> really figure out where to share it. I couldn't really get clarity from
> the contribution section in the handbook.
> 
> If someone could point me in the right direction, it would be
> appreciated. I'll attach the patch to this mail as well since it is a
> quite small one.
> 
> Cordially,
> Andreas Kempe

You can use our Bugzilla https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Base%20System
and use [change-request] tag in its Subject, and attach the patch.

However, this patch does not seem quite right to me. It may serve your needs
but it is incomplete in general case. You see, change in MTU should affect not only
interface itself, it should also alter routing table and "interface link" routes
that also have MTU attribute that is used for handling outgoing IP packets utilizing such routes.

And we already have general network API that does it, and you may use it with ng_iface(4)
as with every other interface: ifioctl(9) / SIOCSIFMTU. Calling it involves update
of routing table with rt_updatemtu().

Why do you want to replicate this at NETGRAPH level?
ng_iface(4) was created to be generic network interface to NOT duplicate such things.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48910140-ef82-dd21-3ca3-924e80e93b3b>