From: yuan linyu <linyu.y...@alcatel-sbell.com.cn> Signed-off-by: yuan linyu <linyu.y...@alcatel-sbell.com.cn> --- net/ipv6/ndisc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index d310dc4..414e929 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -148,17 +148,18 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, opt[0] = type; opt[1] = space>>3; + opt += 2; + space -= 2; - memset(opt + 2, 0, pad); + memset(opt, 0, pad); opt += pad; space -= pad; - memcpy(opt+2, data, data_len); - data_len += 2; + memcpy(opt, data, data_len); opt += data_len; space -= data_len; - if (space > 0) - memset(opt, 0, space); + + memset(opt, 0, space); } EXPORT_SYMBOL_GPL(__ndisc_fill_addr_option); -- 2.7.4