[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1294051319.4165.5.camel@jlt3.sipsolutions.net>
Date: Mon, 03 Jan 2011 11:41:59 +0100
From: Johannes Berg <johannes@...solutions.net>
To: "Winkler, Tomas" <tomas.winkler@...el.com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Stephen Hemminger <shemminger@...tta.com>
Subject: RE: [PATCH 1/1 V3] bridge: fix br_multicast_ipv6_rcv for paged skbs
On Mon, 2011-01-03 at 12:17 +0200, Winkler, Tomas wrote:
> > > > > - struct mld_msg *mld = (struct mld_msg *)icmp6h;
> > > > > + struct mld_msg *mld;
> > > > > + if (!pskb_may_pull(skb2, sizeof(*mld))) {
> > > > > + err = -EINVAL;
> > > > > + goto out;
> > > > > + }
> > > > > + mld = (struct mld_msg *)icmp6h;
> > > >
> > > > This (and the second instance) is incorrect afaict -- the pointer
> > > > "icmp6h" should be reloaded after the pskb_may_pull(), no?
> > >
> > > mld_msg is bigger than icmp6h by sizeof(in6_addr) so we have to try pull
> > again a bigger chunk.
> >
> > Right, I know, the pskb_may_pull() is needed, but I believe you need to
> > re-calculate icmp6h here.
>
> You are right, it can be moved to new memory buffer.
>
> Probably something like that will do it:
>
> if (!pskb_may_pull(skb2, sizeof(*mld))) {
> err = -EINVAL;
> goto out;
> }
> mld = (struct mld_msg *)skb_transport_header(skb2)
Yeah, that'll do, although I see more callers of icmp6_hdr() here
instead even for mld stuff (which is an inline though doing just this)
johannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists