Subject: Re: [PATCH] ipv6: fix the bug when propagating Redirect Message

From: Steffen Klassert <[email-masked]>
Date: Fri, 9 Nov 2012 09:54:44 +0100

On Wed, Oct 24, 2012 at 06:54:10AM +0200, Steffen Klassert wrote:
> On Tue, Oct 23, 2012 at 11:26:25PM +0800, Duan Jiong wrote:
> > +	while (opt_len) {
> > +		int l;
> > +	
> > +		if (opt_len < sizeof(struct nd_opt_hdr)) {
> > +			return;
> > +		}
> > +		l = nd_opt->nd_opt_len << 3;
> > +		if (opt_len < l || l == 0) {
> > +			return;
> > +		}
> > +		if (nd_opt->nd_opt_type == ND_OPT_REDIRECT_HDR) {
> > +			__skb_pull(skb, ndisc_head_len + opt_offset + 8);
> > +			break;
> > +		}
> > +		opt_len -= l;
> > +		nd_opt = ((void *)nd_opt) + 1;
> > +		opt_offset += 1;
> > +	}
> 
> Instead of the above loop, you could use ndisc_parse_options().
> This does the same what you are doing here and it would make it
> a bit clearer what's going on.
> 

Duan, are you going to update your patches? We really need fixes
for the problems you have discovered.

Thanks!