On Mon, Jul 04, 2016 at 01:03:22PM +0200, Martin Pieuchot wrote:
> + if (ip6_hbhchcheck(m, &off, &nxt, &ours)) {
> + if_put(ifp);
> + return; /* m have already been freed */
> }
As ip6_hbhchcheck() does ip6 = mtod(m, struct ip6_hdr *) after
ip6_hopopts_input() you have to add this here, too.
/* adjust pointer */
ip6 = mtod(m, struct ip6_hdr *);
> +int
> +ip6_hbhchcheck(struct mbuf *m, int *offp, int *nxtp, int *oursp)
> +{
> + struct ip6_hdr *ip6;
> + u_int32_t plen, rtalert = ~0;
> + int ours, off, nxt;
ours may be used uninitialized.
> + *offp = off;
> + *nxtp = nxt;
> + *oursp = ours;
I would prefer to use the passed values as *off, *nxt, *ours directly
than to use another set of local variables. This also fixes
initialization problem.
bluhm