mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
Add #define for minimum IPv6 MTU length
This commit is contained in:
parent
379d55044e
commit
ba3b04e7fe
@ -693,7 +693,7 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
mtu_opt = (struct mtu_option *)buffer;
|
mtu_opt = (struct mtu_option *)buffer;
|
||||||
mtu32 = lwip_htonl(mtu_opt->mtu);
|
mtu32 = lwip_htonl(mtu_opt->mtu);
|
||||||
if ((mtu32 >= 1280) && (mtu32 <= 0xffff)) {
|
if ((mtu32 >= IP6_MIN_MTU_LENGTH) && (mtu32 <= 0xffff)) {
|
||||||
#if LWIP_ND6_ALLOW_RA_UPDATES
|
#if LWIP_ND6_ALLOW_RA_UPDATES
|
||||||
if (inp->mtu) {
|
if (inp->mtu) {
|
||||||
/* don't set the mtu for IPv6 higher than the netif driver supports */
|
/* don't set the mtu for IPv6 higher than the netif driver supports */
|
||||||
@ -2312,7 +2312,7 @@ nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif)
|
|||||||
return netif_mtu6(netif);
|
return netif_mtu6(netif);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1280; /* Minimum MTU */
|
return IP6_MIN_MTU_LENGTH; /* Minimum MTU */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define IP6_MIN_MTU_LENGTH 1280
|
||||||
|
|
||||||
/** This is the packed version of ip6_addr_t,
|
/** This is the packed version of ip6_addr_t,
|
||||||
used in network headers that are itself packed */
|
used in network headers that are itself packed */
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
|
@ -881,7 +881,7 @@ lowpan6_if_init(struct netif *netif)
|
|||||||
MIB2_INIT_NETIF(netif, snmp_ifType_other, 0);
|
MIB2_INIT_NETIF(netif, snmp_ifType_other, 0);
|
||||||
|
|
||||||
/* maximum transfer unit */
|
/* maximum transfer unit */
|
||||||
netif->mtu = 1280;
|
netif->mtu = IP6_MIN_MTU_LENGTH;
|
||||||
|
|
||||||
/* broadcast capability */
|
/* broadcast capability */
|
||||||
netif->flags = NETIF_FLAG_BROADCAST /* | NETIF_FLAG_LOWPAN6 */;
|
netif->flags = NETIF_FLAG_BROADCAST /* | NETIF_FLAG_LOWPAN6 */;
|
||||||
|
@ -417,7 +417,7 @@ rfc7668_if_init(struct netif *netif)
|
|||||||
MIB2_INIT_NETIF(netif, snmp_ifType_other, 0);
|
MIB2_INIT_NETIF(netif, snmp_ifType_other, 0);
|
||||||
|
|
||||||
/* maximum transfer unit, set according to RFC7668 ch2.4 */
|
/* maximum transfer unit, set according to RFC7668 ch2.4 */
|
||||||
netif->mtu = 1280;
|
netif->mtu = IP6_MIN_MTU_LENGTH;
|
||||||
|
|
||||||
/* no flags set (no broadcast, ethernet,...)*/
|
/* no flags set (no broadcast, ethernet,...)*/
|
||||||
netif->flags = 0;
|
netif->flags = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user