Commit Graph

13 Commits

Author SHA1 Message Date
Gregory Nutt
22cd0d47fa This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile.  People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header).  A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length.  Instead, we define the packet buffer size then derive the MTU.

The MTU is not common currency in networking.  On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP).  Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes.  So we should be all good and without the recurring 14 byte error in MTU's and MSS's.

Squashed commit of the following:

    Trivial update to fix some spacing issues.
    net/: Rename several macros containing _MTU to _PKTSIZE.
    net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE.  This is not the MTU which does not include the size of the link layer header.  This is the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename the file d_mtu in the network driver structure to d_pktsize.  That value saved there is not the MTU.  The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header.  The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt
d741185c91 net/icmpv6/icmpv6_radvertise.c: set the prefix length to preconfigured value 2017-11-08 07:50:36 -06:00
Sakari Kapanen
795e884aea net/icmpv6/icmpv6_radvertise.c: Add option to manually specify router prefix 2017-11-08 07:47:41 -06:00
Sakari Kapanen
d0f72617ef From b7b1826930c7da10416bceebce5d63dc8e4086ca Mon Sep 17 00:00:00 2001
From: Sakari Kapanen <sakari.kapanen@optofidelity.com>
Date: Sun, 24 Sep 2017 13:19:25 +0300
Subject: [PATCH] ICMPv6: fix router advertisement

Fixes several errors preventing icmpv6_radvertise.c from being compiled. Fixes conversions to network byte order (namely vlifetime, plifetime, mtu).

IPv6 source address is set to link-local IP address instead of the address in the netdev structure. This is in compliance to RFC 4861. RA didn't work on Linux before this change.

Finally, router prefix and prefix length are derived from the IPv6 address and netmask in the netdev structure. This seems to make more sense than using a predefined, separate prefix from the config.
2017-09-24 06:33:05 -06:00
Gregory Nutt
aeb59383cf Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code. 2017-08-08 15:26:09 -06:00
Gregory Nutt
2ada7d5892 IPv6: Remove comparisons to the address with all ones set. IPv6 does not support broadcast addresses and certainly not in that form. Replace with multicast addresses beginning with 0xff02. 2017-08-07 11:50:50 -06:00
Gregory Nutt
b4a0ac53a8 Networking: Improve naming and simplify some logic of previous commit. 2017-07-07 06:51:52 -06:00
Gregory Nutt
70c6b52132 ICMPv6: Fix an address size calculation that was bungled in a recent commit. 2017-07-06 19:37:01 -06:00
Gregory Nutt
a5f361e984 ICMPv6: Fix so that ICMPv6 can be used with 6LoWPAN. 2017-07-06 12:00:59 -06:00
Gregory Nutt
79256573e1 net: network drver now retains Ethernet MAC address in a union so that other link layer addresses may be used in a MULTILINK environment. 2017-04-22 11:10:30 -06:00
Gregory Nutt
43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
111f4a45a3 Forgot to add this file before a previous commit 2015-02-05 09:43:07 -06:00