Patching ng_iface to allow setting the MTU via netgraph API

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Patching ng_iface to allow setting the MTU via netgraph API

Andreas Kempe
Hello!

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

ng_iface_set_mtu.patch (2K) Download Attachment
signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patching ng_iface to allow setting the MTU via netgraph API

Eugene Grosbein-10
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.


_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Patching ng_iface to allow setting the MTU via netgraph API

Andrey V. Elsukov
In reply to this post by Andreas Kempe
On 10.10.2018 22:43, Andreas Kempe wrote:

> Hello!
>
> 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.

Hi,

take a look at this review https://reviews.freebsd.org/D17180
You can use the same way.

--
WBR, Andrey V. Elsukov
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Patching ng_iface to allow setting the MTU via netgraph API

Andreas Kempe
In reply to this post by Eugene Grosbein-10
On 2018-10-10 22:33, Eugene Grosbein wrote:
> 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.
>

I am no expert on FreeBSD internals. I was wondering about this exact
aspect and was hoping to get feedback just like this.

> 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.
>
After reading this, I went back and read the manual to ifconfig again.
My wish is based on a misconception. I thought that the point-to-point
vs. broadcast setting was general for all interfaces and could be
readily set by using ifconfig ptp. As there was already duplication on
that setting, I didn't see any real issue with setting the MTU via
netgraph as well. Realising this is not the case has made me see that my
idea isn't a great one.

At least I know how to submit a patch in the future if I get actually
well thought out ideas.

Thank you for the feedback!
// Andreas Kempe
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[hidden email]"