On Thu, 2005-28-04 at 09:39 +1000, Herbert Xu wrote:
> On Wed, Apr 27, 2005 at 08:27:06AM -0400, Jamal Hadi Salim wrote:
> >
> > --- /usr/src/26117-mod/net/xfrm/xfrm_policy.c 2005/04/27 11:32:13
> > 1.1
> > +++ /usr/src/26117-mod/net/xfrm/xfrm_policy.c 2005/04/27 12:25:24
> > @@ -345,7 +345,9 @@
> >
> > write_lock_bh(&xfrm_policy_lock);
> > for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL;) {
> > - if (!delpol && memcmp(&policy->selector, &pol->selector,
> > sizeof(pol->selector)) == 0) {
> > + if (!delpol &&
> > + ((!excl && policy->index && (policy->index == pol->index)) ||
> > + (memcmp(&policy->selector, &pol->selector,
> > sizeof(pol->selector)) == 0))) {
>
> I have no problems with the idea itself. However, I have a couple of
> minor issues with this patch :)
>
> First of all please align the continued lines to the if expression, e.g.,
> if (!delpol &&
> (policy->index && (policy->index == pol->index)) ||
>
np. sorry, i was rushing out - testing as we speak.
> Also the excl check doesn't make sense. You should let the
> following excl check take place after you've found out that
> the indices is identical.
>
the policy->index is only relevant for the update not the add;
the update could also be done by selector. So i didnt follow.
cheers,
jamal
|