Linux Container Development
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley-VXdhtT5mjnY@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH 3/4] Add IPv6 address checkpoint handler
Date: Thu, 15 Apr 2010 16:32:08 -0400	[thread overview]
Message-ID: <4BC777C8.6050102@hp.com> (raw)
In-Reply-To: <87vdbs1oty.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>

Dan Smith wrote:
> BH> Is using IFA_F_PERMANENT correct here?  Should you save the flags
> BH> from the address when checkpointing?  Permanent means it was added
> BH> by the user, not by the kernel, so you could be changing things
> BH> slightly.
> 
> Does the kernel create global scope addresses?  Maybe it does in some
> more advanced IPv6 environments, but it seemed like excluding global
> scope addresses in checkpoint meant that we only saved (and thus
> restore) the permanent ones anyway.

It adds global-scope addresses through the auto-configuration process,
i.e. by receiving a prefix in a router advertisement.

> I guess it's a better idea to just save the flags anyhow now that I
> have a way to restore them.

Yes, and I just realized something else.  This code:

+	ret = inet6_addr_add(net, dev->ifindex, &addr->inet6_addr,
+			     addr->inet6_prefix_len, IFA_F_PERMANENT,
+			     INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);

isn't using the saved lifetimes either, so it won't ever go away.

And calling inet6_addr_add() isn't correct in all cases - you can
use it for manually-configured addresses (marked permanent), but
not for those added through address-autoconfiguration - for those
you'll want to use ipv6_add_addr().  But if you do that you'll
need to duplicate what's done after the add succeeds:

	ifp = ipv6_add_addr(idev, pfx, plen, addr_scope, addr_flags);

        if (!IS_ERR(ifp)) {
                spin_lock_bh(&ifp->lock);
                ifp->valid_lft = valid_lft;
                ifp->prefered_lft = prefered_lft;
                ifp->tstamp = jiffies;
                spin_unlock_bh(&ifp->lock);

                addrconf_prefix_route(&ifp->addr, ifp->prefix_len, dev,
                                      expires, flags);
                /*
                 * Note that section 3.1 of RFC 4429 indicates
                 * that the Optimistic flag should not be set for
                 * manually configured addresses
                 */
                addrconf_dad_start(ifp, 0);
                in6_ifa_put(ifp);
                addrconf_verify(0);
                return 0;
        }

That's just an example, not exactly correct.

-Brian

  parent reply	other threads:[~2010-04-15 20:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 17:48 A modular approach to handling netdev address c/r Dan Smith
     [not found] ` <1270748932-26745-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-08 17:48   ` [PATCH 1/4] Modularize the handling of " Dan Smith
     [not found]     ` <1270748932-26745-2-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-12 16:08       ` Serge E. Hallyn
2010-04-25 21:04       ` Oren Laadan
     [not found]         ` <4BD4AE6D.2070507-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-26 15:11           ` Dan Smith
     [not found]             ` <874oiyfdv1.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-26 16:05               ` Oren Laadan
2010-04-08 17:48   ` [PATCH 2/4] Fail checkpoint if IPv4 multicast addresses are configured Dan Smith
     [not found]     ` <1270748932-26745-3-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-12 16:09       ` Serge E. Hallyn
2010-04-08 17:48   ` [PATCH 3/4] Add IPv6 address checkpoint handler Dan Smith
     [not found]     ` <1270748932-26745-4-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-12 16:11       ` Serge E. Hallyn
     [not found]         ` <20100412161148.GC23380-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-12 17:39           ` Dan Smith
     [not found]             ` <871vekbmen.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-12 17:47               ` Serge E. Hallyn
2010-04-12 17:58                 ` Dan Smith
     [not found]                 ` <20100412174756.GA15269-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-25 20:49                   ` Oren Laadan
2010-04-15 19:35       ` Brian Haley
     [not found]         ` <4BC76A65.7060909-VXdhtT5mjnY@public.gmane.org>
2010-04-15 19:46           ` Dan Smith
     [not found]             ` <87vdbs1oty.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-15 20:32               ` Brian Haley [this message]
     [not found]                 ` <4BC777C8.6050102-VXdhtT5mjnY@public.gmane.org>
2010-04-16 15:02                   ` Dan Smith
2010-04-08 17:48   ` [PATCH 4/4] C/R: Fix storing IPv6 addresses and handle the "ipv6only" socket flag (v2) Dan Smith
     [not found]     ` <1270748932-26745-5-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-25 21:08       ` Oren Laadan
     [not found]         ` <4BD4AF37.10504-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-26 13:41           ` Dan Smith
     [not found]             ` <87d3xmfhzx.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2010-04-26 14:35               ` Oren Laadan
     [not found]                 ` <4BD5A49B.9030605-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-04-26 14:43                   ` Dan Smith

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=4BC777C8.6050102@hp.com \
    --to=brian.haley-vxdhtt5mjny@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.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