diff options
| author | Hideaki Yoshifuji <yoshfuji@linux-ipv6.org> | 2002-09-26 00:34:07 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2002-09-26 00:34:07 -0700 |
| commit | 464f9b3f5830aa3b74e6d1491193d29f1074151d (patch) | |
| tree | 440c35e02c0e068ca8d5bc3a9d7806a4ffe2c963 /include/net | |
| parent | 5568a809583c69fab1cb22d0e9dcd3c93a118167 (diff) | |
[IPv6]: Verify ND options properly.
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/ndisc.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 407268c78def..8748b657ee13 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h @@ -51,6 +51,25 @@ struct ra_msg { __u32 retrans_timer; }; +struct nd_opt_hdr { + __u8 nd_opt_type; + __u8 nd_opt_len; +} __attribute__((__packed__)); + +struct ndisc_options { + struct nd_opt_hdr *nd_opt_array[7]; + struct nd_opt_hdr *nd_opt_piend; +}; + +#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_rh nd_opt_array[ND_OPT_REDIRECT_HDR] +#define nd_opts_mtu nd_opt_array[ND_OPT_MTU] + +extern struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur, struct nd_opt_hdr *end); +extern struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, struct ndisc_options *ndopts); extern int ndisc_init(struct net_proto_family *ops); |
