tree a897ec464a600d7a678052bfd5e52378470a45fe
parent 7938109fff944e0117976a39946d99d2b0b0250d
author Patrick McHardy <[EMAIL PROTECTED]> Fri, 22 Apr 2005 10:12:32 -0700
committer David S. Miller <[EMAIL PROTECTED]> Fri, 22 Apr 2005 10:12:32 -0700

[XFRM]: Fix existence lookup in xfrm_state_find

Use 'daddr' instead of &tmpl->id.daddr, since the latter
might be zero.  Also, only perform the lookup when
tmpl->id.spi is non-zero.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 xfrm/xfrm_state.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: net/xfrm/xfrm_state.c
===================================================================
--- 1e1c24ad874db00f827fc6d9087402db6becefc9/net/xfrm/xfrm_state.c  
(mode:100644 sha1:1db59f11f37d687318ae8cbd5e2ea6e48142ca97)
+++ a897ec464a600d7a678052bfd5e52378470a45fe/net/xfrm/xfrm_state.c  
(mode:100644 sha1:d11747c2a763f27a0a37eae59352bf61891a26b8)
@@ -357,8 +357,9 @@ xfrm_state_find(xfrm_address_t *daddr, x
 
        x = best;
        if (!x && !error && !acquire_in_progress) {
-               x0 = afinfo->state_lookup(&tmpl->id.daddr, tmpl->id.spi, 
tmpl->id.proto);
-               if (x0 != NULL) {
+               if (tmpl->id.spi &&
+                   (x0 = afinfo->state_lookup(daddr, tmpl->id.spi,
+                                              tmpl->id.proto)) != NULL) {
                        xfrm_state_put(x0);
                        error = -EEXIST;
                        goto out;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to