From: Patrick McHardy <kaber@trash.net>
To: Kazunori MIYAZAWA <kazunori@miyazawa.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
David Miller <davem@davemloft.net>, Miika Komu <miika@iki.fi>,
Diego Beltrami <Diego.Beltrami@hiit.fi>,
netdev@vger.kernel.org, usagi-core@linux-ipv6.org
Subject: Re: [PATCH][IPSEC][4/6] changing "ipip tunnel" and xfrm4_tunnel to the API change
Date: Thu, 08 Feb 2007 14:10:32 +0100 [thread overview]
Message-ID: <45CB2148.8060307@trash.net> (raw)
In-Reply-To: <20070208170412.2e627947.kazunori@miyazawa.org>
Kazunori MIYAZAWA wrote:
> Changing ipip tunnel and xfrm4_tunnel to the API
Fixing up users after API changes should be done in the same
patch as the API change itself to avoid breaking compilation
for people doing a bisection.
> index f110af5..00fc09f 100644
> --- a/net/ipv4/xfrm4_tunnel.c
> +++ b/net/ipv4/xfrm4_tunnel.c
> @@ -66,12 +66,15 @@ static struct xfrm_tunnel xfrm_tunnel_ha
>
> static int __init ipip_init(void)
> {
> - if (xfrm_register_type(&ipip_type, AF_INET) < 0) {
> - printk(KERN_INFO "ipip init: can't add xfrm type\n");
> + if (xfrm_register_type(&ipip_type, AF_INET) < 0)
> + return -EAGAIN;
Why are you removing the printk?
> +
> + if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) {
> + printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n");
> return -EAGAIN;
Does not unregister ipip_type on error.
> }
> - if (xfrm4_tunnel_register(&xfrm_tunnel_handler)) {
> - printk(KERN_INFO "ipip init: can't add xfrm handler\n");
> + if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET6)) {
You register xfrm_tunnel_handler twice, which will corrupt the list.
> + printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n");
> xfrm_unregister_type(&ipip_type, AF_INET);
Does not unregister AF_INET tunnel handler on error.
> return -EAGAIN;
> }
The next patch has similar problems.
next prev parent reply other threads:[~2007-02-08 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 8:04 [PATCH][IPSEC][4/6] changing "ipip tunnel" and xfrm4_tunnel to the API change Kazunori MIYAZAWA
2007-02-08 13:10 ` Patrick McHardy [this message]
2007-02-09 0:37 ` Kazunori MIYAZAWA
2007-02-09 8:36 ` Patrick McHardy
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=45CB2148.8060307@trash.net \
--to=kaber@trash.net \
--cc=Diego.Beltrami@hiit.fi \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kazunori@miyazawa.org \
--cc=miika@iki.fi \
--cc=netdev@vger.kernel.org \
--cc=usagi-core@linux-ipv6.org \
/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 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).