Received: with ECARTIS (v1.0.0; list netdev); Fri, 25 Mar 2005 16:12:22 -0800 (PST) Received: from mx04.cybersurf.com (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j2Q0CFVk005108 for ; Fri, 25 Mar 2005 16:12:16 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cybersurf.com with esmtp (Exim 4.30) id 1DEyuV-0008Va-4y for netdev@oss.sgi.com; Fri, 25 Mar 2005 19:12:15 -0500 Received: from [24.103.99.32] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1DEyuR-0005oK-PB; Fri, 25 Mar 2005 19:12:12 -0500 Subject: PATCH: IPSEC acquire in presence of multiple managers From: jamal Reply-To: hadi@cyberus.ca To: Herbert Xu , "David S. Miller" Cc: Masahide NAKAMURA , Shinta Sugimoto , netdev Content-Type: multipart/mixed; boundary="=-KKtamxd5AOUq9jGcgTIc" Organization: jamalopolous Message-Id: <1111795927.1089.749.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 25 Mar 2005 19:12:07 -0500 X-Virus-Scanned: ClamAV 0.83/784/Thu Mar 24 23:57:57 2005 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 722 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1488 Lines: 59 --=-KKtamxd5AOUq9jGcgTIc Content-Type: text/plain Content-Transfer-Encoding: 7bit Herbert/Dave, Acquire should be supported by both pfkey and netlink. However, it stops to send acquire message from the kernel on first success. It is possible that one or the other manager maybe passively monitoring and needs to see those messages. Thanks to Masahide NAKAMURA , Shinta Sugimoto for both identifying the issue and validating the fix. If you want i can put this with other NLMSGALIGN one liner i mentioned earlier. cheers, jamal --=-KKtamxd5AOUq9jGcgTIc Content-Disposition: attachment; filename=acq_p Content-Type: text/plain; name=acq_p; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/net/xfrm/xfrm_state.c 2005/03/25 17:44:43 1.1 +++ b/net/xfrmxfrm_state.c 2005/03/25 18:55:33 @@ -774,16 +774,20 @@ wake_up(&km_waitq); } +/* + * We send to all registered managers regardless of failure + * We are happy with one success +*/ int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol) { - int err = -EINVAL; + int err = -EINVAL, acqret = -EINVAL; struct xfrm_mgr *km; read_lock(&xfrm_km_lock); list_for_each_entry(km, &xfrm_km_list, list) { - err = km->acquire(x, t, pol, XFRM_POLICY_OUT); - if (!err) - break; + acqret = km->acquire(x, t, pol, XFRM_POLICY_OUT); + if (!acqret) + err = acqret; } read_unlock(&xfrm_km_lock); return err; --=-KKtamxd5AOUq9jGcgTIc--