From: Andreas Schwab <schwab@suse.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@oss.sgi.com
Subject: Re: [XFRM] Probe selected algorithm only
Date: Fri, 04 Feb 2005 22:29:49 +0100 [thread overview]
Message-ID: <m3fz0cj9o2.fsf@igel.m5r.de> (raw)
In-Reply-To: <20050121101938.GA1133@gondor.apana.org.au> (Herbert Xu's message of "Fri, 21 Jan 2005 21:19:38 +1100")
Herbert Xu <herbert@gondor.apana.org.au> writes:
> ===== net/xfrm/xfrm_algo.c 1.15 vs edited =====
> --- 1.15/net/xfrm/xfrm_algo.c 2004-12-28 13:33:32 +11:00
> +++ edited/net/xfrm/xfrm_algo.c 2005-01-21 21:17:12 +11:00
> @@ -13,6 +13,7 @@
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/pfkeyv2.h>
> +#include <linux/crypto.h>
> #include <net/xfrm.h>
> #if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE)
> #include <net/ah.h>
> @@ -346,58 +347,48 @@
> return NULL;
> }
>
> -struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name)
> +static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list,
> + int entries, char *name,
> + int probe)
> {
> - int i;
> + int i, status;
>
> if (!name)
> return NULL;
>
> - for (i=0; i < aalg_entries(); i++) {
> - if (strcmp(name, aalg_list[i].name) == 0) {
> - if (aalg_list[i].available)
> - return &aalg_list[i];
> - else
> - break;
> - }
> + for (i = 0; i < entries; i++) {
> + if (!strcmp(name, list[i].name))
> + continue;
You probably didn't mean this. :-)
Return the first matching entry in xfrm_get_byname instead of the first
non-matching one.
Signed-off-by: Andreas Schwab <schwab@suse.de>
--- linux-2.6.11-rc3/net/xfrm/xfrm_algo.c.~1~ 2005-02-03 22:54:42.000000000 +0100
+++ linux-2.6.11-rc3/net/xfrm/xfrm_algo.c 2005-02-04 21:56:11.000000000 +0100
@@ -357,7 +357,7 @@ static struct xfrm_algo_desc *xfrm_get_b
return NULL;
for (i = 0; i < entries; i++) {
- if (!strcmp(name, list[i].name))
+ if (strcmp(name, list[i].name) != 0)
continue;
if (list[i].available)
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2005-02-04 21:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-21 10:19 [XFRM] Probe selected algorithm only Herbert Xu
2005-01-21 14:01 ` James Morris
2005-01-21 22:45 ` Herbert Xu
2005-01-26 6:22 ` David S. Miller
2005-02-04 21:29 ` Andreas Schwab [this message]
2005-02-04 21:32 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3fz0cj9o2.fsf@igel.m5r.de \
--to=schwab@suse.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.