[Babel-users] [PATCH 2/2] interface.c: interface_set_status() minor refactoring

Juliusz Chroboczek jch at irif.fr
Thu Jul 25 20:07:10 BST 2019


> * clarify code flow, only checking for future state once
> * clarify error messages when MTU is guessed by including the MTU value
> * remove useless comment about the need to run an IP check that already
>    is run
> * allocate exactly as much space as required. Not more for good luck

Agreed mostly, please rebase and make the following two changes.

> -            fprintf(stderr, "Suspiciously low MTU %d on interface %s (%u).\n",
> +            fprintf(stderr, "Suspiciously low MTU %d on interface %s (%u), using 128 and require lower-level fragmentation.\n",

Please remove the mention of lower-layer fragmentation -- it's not
correct.  We're running over IPv6, so any interface should be able to
support an MTU of 1280 -- anything less than that, and we've simply failed
to determine the MTU.

(I think we should switch the threshold to something larger, by the way,
such as 518, so that we ensure that we can fit two full-size TLVs in
a packet.  At any rate, that's an "impossible" case, so it doesn't matter
much.)

> -        /* 40 for IPv6 header, 8 for UDP header, 12 for good luck. */
> -        ifp->buf.size = mtu - sizeof(packet_header) - 60;
> +        /* 40 for IPv6 header, 8 for UDP header */
> +        ifp->buf.size = mtu - sizeof(packet_header) - ( 40 + 8 );

Not sure.  The MTU we compute here is the size of packets we send, so it
is safe to make it slightly smaller.  If we overshoot, on the other hand,
we're going to cause fragmentation with all that it entails.

Please remove this bit so I can apply the rest.

Thanks,

-- Juliusz



More information about the Babel-users mailing list