On Tue, 16 Aug 2005, Herbert Xu wrote:

> On Thu, Aug 04, 2005 at 05:48:17PM -0700, Arthur Kepner wrote:
> >
> > @@ -366,6 +376,9 @@ static struct ipq *ip_frag_create(unsign
> > .....
> > +   qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL;
> > +   if (qp->peer) 
> > +           qp->rid = atomic_read(&qp->peer->rid);
> 
> This fix is not needed.  The rid was set below in ip_frag_too_far which
> is called from ip_frag_queue.

I think this and your next comment are related, so please see 
my response below.

> 
> > +static inline int ip_frag_too_far(struct ipq *qp)
> > .....
> > +   start = ++qp->rid;
> > +   end   = atomic_inc_return(&peer->rid);
> 
> I'm not sure I understand the benefit of this change either.

Your patch 
http://marc.theaimsgroup.com/?l=linux-netdev&m=112281936522415&w=2 
had:

+static inline int ip_frag_too_far(struct ipq *qp)
+ ....
+       unsigned int max = sysctl_ipfrag_max_dist;
+ ....
+       start = qp->rid;
+       end = atomic_inc_return(&peer->rid);
+       qp->rid = end;
+       return qp->fragments && (unsigned int)(end - start) >= max;

So, your patch would accept up to sysctl_ipfrag_max_dist "disorder" 
between calls to ip_frag_too_far() (for a particluar fragment queue). 
(I'm using "disorder" loosely, but I think it's clear enough what is 
meant?) With my change it would accept up to sysctl_ipfrag_max_dist 
"disorder" over the lifetime of a fragment queue. 

The latter is the behavior that I intended. But your original may be 
better, especially if there are many fragment queues with a common 
source. 

> ......
> > +static int ip_frag_reinit(struct ipq *qp)
> 
> > +   if (sysctl_ipfrag_max_dist) {
> > +           if (qp->peer == NULL) {
> > +                   qp->peer = inet_getpeer(qp->saddr, 1);
> > +           }
> > +           if (qp->peer) {
> > +                   qp->rid = atomic_read(&qp->peer->rid);
> > +           }
> > +   }
> 
> This is unnecessary since we're taking over an existing qp
> whose parameters are exactly the same as the new fragment.
> 

This is similar to the first comment (about ip_frag_create()).
And the difference is to do with how I changed the way qp->rid 
is updated in ip_frag_too_far().

-- 
Arthur

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to