* [PATCH] xfrm: remove xerr_idxp from __xfrm_policy_check()
@ 2006-09-01 5:01 James Morris
2006-09-01 7:15 ` Masahide NAKAMURA
0 siblings, 1 reply; 3+ messages in thread
From: James Morris @ 2006-09-01 5:01 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Masahide NAKAMURA
It seems that during the MIPv6 respin, some code which was originally
conditionally compiled around CONFIG_XFRM_ADVANCED was accidently left in
after the config option was removed.
This patch removes an extraneous pointer (xerr_idxp) which is no longer
needed.
Please review & apply.
Signed-off-by: James Morris <jmorris@namei.org>
---
net/xfrm/xfrm_policy.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff -purN -X dontdiff net-2.6.19.o/net/xfrm/xfrm_policy.c net-2.6.19.x/net/xfrm/xfrm_policy.c
--- net-2.6.19.o/net/xfrm/xfrm_policy.c 2006-08-30 00:31:38.000000000 -0400
+++ net-2.6.19.x/net/xfrm/xfrm_policy.c 2006-09-01 00:40:25.000000000 -0400
@@ -1514,8 +1514,7 @@ static inline int secpath_has_nontranspo
{
for (; k < sp->len; k++) {
if (sp->xvec[k]->props.mode != XFRM_MODE_TRANSPORT) {
- if (idxp)
- *idxp = k;
+ *idxp = k;
return 1;
}
}
@@ -1534,7 +1533,6 @@ int __xfrm_policy_check(struct sock *sk,
struct flowi fl;
u8 fl_dir = policy_to_flow_dir(dir);
int xerr_idx = -1;
- int *xerr_idxp = &xerr_idx;
if (xfrm_decode_session(skb, &fl, family) < 0)
return 0;
@@ -1560,7 +1558,7 @@ int __xfrm_policy_check(struct sock *sk,
xfrm_policy_lookup);
if (!pol) {
- if (skb->sp && secpath_has_nontransport(skb->sp, 0, xerr_idxp)) {
+ if (skb->sp && secpath_has_nontransport(skb->sp, 0, &xerr_idx)) {
xfrm_secpath_reject(xerr_idx, skb, &fl);
return 0;
}
@@ -1619,13 +1617,14 @@ int __xfrm_policy_check(struct sock *sk,
for (i = xfrm_nr-1, k = 0; i >= 0; i--) {
k = xfrm_policy_ok(tpp[i], sp, k, family);
if (k < 0) {
- if (k < -1 && xerr_idxp)
- *xerr_idxp = -(2+k);
+ if (k < -1)
+ /* "-2 - errored_index" returned */
+ xerr_idx = -(2+k);
goto reject;
}
}
- if (secpath_has_nontransport(sp, k, xerr_idxp))
+ if (secpath_has_nontransport(sp, k, &xerr_idx))
goto reject;
xfrm_pols_put(pols, npols);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfrm: remove xerr_idxp from __xfrm_policy_check()
2006-09-01 5:01 [PATCH] xfrm: remove xerr_idxp from __xfrm_policy_check() James Morris
@ 2006-09-01 7:15 ` Masahide NAKAMURA
2006-09-01 7:33 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Masahide NAKAMURA @ 2006-09-01 7:15 UTC (permalink / raw)
To: James Morris, David S. Miller; +Cc: netdev
James Morris wrote:
> It seems that during the MIPv6 respin, some code which was originally
> conditionally compiled around CONFIG_XFRM_ADVANCED was accidently left in
> after the config option was removed.
>
> This patch removes an extraneous pointer (xerr_idxp) which is no longer
> needed.
>
> Please review & apply.
>
> Signed-off-by: James Morris <jmorris@namei.org>
It seems fine for me.
David, please apply it.
--
Masahide NAKAMURA
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfrm: remove xerr_idxp from __xfrm_policy_check()
2006-09-01 7:15 ` Masahide NAKAMURA
@ 2006-09-01 7:33 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2006-09-01 7:33 UTC (permalink / raw)
To: nakam; +Cc: jmorris, netdev
From: Masahide NAKAMURA <nakam@linux-ipv6.org>
Date: Fri, 01 Sep 2006 16:15:39 +0900
> James Morris wrote:
> > It seems that during the MIPv6 respin, some code which was originally
> > conditionally compiled around CONFIG_XFRM_ADVANCED was accidently left in
> > after the config option was removed.
> >
> > This patch removes an extraneous pointer (xerr_idxp) which is no longer
> > needed.
> >
> > Please review & apply.
> >
> > Signed-off-by: James Morris <jmorris@namei.org>
>
> It seems fine for me.
> David, please apply it.
Applied, thanks everyone.
BTW, the recent mainline bug fix to add a net_ratelimit() call in
net/socket.c created some major conflicts with Stephen Hemminger's RCU
work there, so I had to rebase the net-2.6.19 tree again.
Sorry... :-)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-01 7:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-01 5:01 [PATCH] xfrm: remove xerr_idxp from __xfrm_policy_check() James Morris
2006-09-01 7:15 ` Masahide NAKAMURA
2006-09-01 7:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).