mirror of
https://github.com/apache/nuttx.git
synced 2026-09-24 00:42:03 +08:00
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.
This commit is contained in:
committed by
Gregory Nutt
parent
3bc21a3973
commit
d0f72617ef
@@ -240,8 +240,8 @@ struct icmpv6_router_advertise_s
|
||||
uint8_t hoplimit; /* Current hop limit */
|
||||
uint8_t flags; /* See ICMPv6_RADV_FLAG_* definitions */
|
||||
uint16_t lifetime; /* Router lifetime */
|
||||
uint16_t reachable[2]; /* Reachable time */
|
||||
uint16_t retrans[2]; /* Retransmission timer */
|
||||
uint32_t reachable; /* Reachable time */
|
||||
uint32_t retrans; /* Retransmission timer */
|
||||
/* Options begin here */
|
||||
};
|
||||
|
||||
@@ -311,8 +311,8 @@ struct icmpv6_prefixinfo_s
|
||||
uint8_t optlen; /* " " ": Option length: 4 octets */
|
||||
uint8_t preflen; /* " " ": Prefix length */
|
||||
uint8_t flags; /* " " ": Flags */
|
||||
uint16_t vlifetime[2]; /* " " ": Valid lifetime */
|
||||
uint16_t plifetime[2]; /* Octet 2: Preferred lifetime */
|
||||
uint32_t vlifetime; /* " " ": Valid lifetime */
|
||||
uint32_t plifetime; /* Octet 2: Preferred lifetime */
|
||||
uint16_t reserved[2]; /* " " ": Reserved */
|
||||
uint16_t prefix[8]; /* Octets 3-4: Prefix */
|
||||
};
|
||||
@@ -330,7 +330,7 @@ struct icmpv6_mtu_s
|
||||
uint8_t opttype; /* Octet 1: Option Type: ICMPv6_OPT_MTU */
|
||||
uint8_t optlen; /* " " ": Option length: 1 octet */
|
||||
uint16_t reserved; /* " " ": Reserved */
|
||||
uint16_t mtu[2]; /* " " ": MTU */
|
||||
uint32_t mtu; /* " " ": MTU */
|
||||
};
|
||||
|
||||
/* The structure holding the ICMP statistics that are gathered if
|
||||
|
||||
Reference in New Issue
Block a user