Re: [PATCH net] sctp: fix ICMP processing if skb is non-linear

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello Xin Long,
On Sat, 2017-05-20 at 02:40 +0800, Xin Long wrote:
> On Fri, May 19, 2017 at 11:34 PM, Davide Caratti <dcaratti@xxxxxxxxxx> wrote:
> > @@ -515,14 +515,23 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
> >          * or the chunk type or the Initiate Tag does not match, silently
> >          * discard the packet.
> >          */
> > +       offset = skb_transport_offset(skb);
> > +       sctphdr = skb_header_pointer(skb, offset, sizeof(_sctphdr), &_sctphdr);
> > +       if (unlikely(!sctphdr))
> > +               goto out;
> > +
> > +       vtag = ntohl(sctphdr->vtag);
> >         if (vtag == 0) {
> > -               chunkhdr = (void *)sctphdr + sizeof(struct sctphdr);
> > -               if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t)
> > -                         + sizeof(__be32) ||
> > +               offset += sizeof(_sctphdr);
> 
> will be nice to delete this line, and use
> > +               /* chunk header + first 4 octects of init header */
> > +               chunkhdr = skb_header_pointer(skb, offset,
> 
> chunkhdr = skb_header_pointer(skb, offset + sizeof(_sctphdr), ;)
> wdyt?

that's right, 'offset' does not need the re-assignment: I will post the v2
soon. Thanks!

--
davide
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux