Commit 91a0438b authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6] NDISC: Save space for ndisc_options{}.

Pointed out by Krishna Kumar <kumarkr@us.ibm.com>.

Also, size of structure is now adjusted automatically.
Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
parent 5aeb0dad
......@@ -15,11 +15,15 @@
* ndisc options
*/
#define ND_OPT_SOURCE_LL_ADDR 1
#define ND_OPT_TARGET_LL_ADDR 2
#define ND_OPT_PREFIX_INFO 3
#define ND_OPT_REDIRECT_HDR 4
#define ND_OPT_MTU 5
enum {
__ND_OPT_PREFIX_INFO_END = 0,
ND_OPT_SOURCE_LL_ADDR = 1, /* RFC2461 */
ND_OPT_TARGET_LL_ADDR = 2, /* RFC2461 */
ND_OPT_PREFIX_INFO = 3, /* RFC2461 */
ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */
ND_OPT_MTU = 5, /* RFC2461 */
__ND_OPT_MAX
};
#define MAX_RTR_SOLICITATION_DELAY HZ
......
......@@ -156,14 +156,13 @@ struct neigh_table nd_tbl = {
/* ND options */
struct ndisc_options {
struct nd_opt_hdr *nd_opt_array[7];
struct nd_opt_hdr *nd_opt_piend;
struct nd_opt_hdr *nd_opt_array[__ND_OPT_MAX];
};
#define nd_opts_src_lladdr nd_opt_array[ND_OPT_SOURCE_LL_ADDR]
#define nd_opts_tgt_lladdr nd_opt_array[ND_OPT_TARGET_LL_ADDR]
#define nd_opts_pi nd_opt_array[ND_OPT_PREFIX_INFO]
#define nd_opts_pi_end nd_opt_piend
#define nd_opts_pi_end nd_opt_array[__ND_OPT_PREFIX_INFO_END]
#define nd_opts_rh nd_opt_array[ND_OPT_REDIRECT_HDR]
#define nd_opts_mtu nd_opt_array[ND_OPT_MTU]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment