From: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
To: netdev@vger.kernel.org
Cc: pekkas@netcore.fi, yoshfuji@linux-ipv6.org
Subject: [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime
Date: Wed, 02 Apr 2008 01:09:01 +0200 [thread overview]
Message-ID: <00affc24c178e6da3a3b.1207091341@pirzuine> (raw)
In-Reply-To: <patchbomb.1207091339@pirzuine>
IPv6: do not create temporary adresses with too short preferred lifetime
>From RFC341:
A temporary address is created only if this calculated Preferred
Lifetime is greater than REGEN_ADVANCE time units. In particular,
an implementation must not create a temporary address with a zero
Preferred Lifetime.
Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
diff -r 0c33481968e0 -r 00affc24c178 net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c Sat Mar 22 00:41:39 2008 +0100
+++ b/net/ipv6/addrconf.c Sat Mar 22 00:39:16 2008 +0100
@@ -776,6 +776,7 @@
struct inet6_dev *idev = ifp->idev;
struct in6_addr addr, *tmpaddr;
unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp;
+ unsigned long regen_advance;
int tmp_plen;
int ret = 0;
int max_addresses;
@@ -836,7 +837,22 @@
tmp_tstamp = ifp->tstamp;
spin_unlock_bh(&ifp->lock);
+ regen_advance = idev->cnf.regen_max_retry *
+ idev->cnf.dad_transmits *
+ idev->nd_parms->retrans_time / HZ;
write_unlock(&idev->lock);
+
+ /* A temporary address is created only if this calculated Preferred
+ * Lifetime is greater than REGEN_ADVANCE time units. In particular,
+ * an implementation must not create a temporary address with a zero
+ * Preferred Lifetime.
+ */
+ if (tmp_prefered_lft <= regen_advance) {
+ in6_ifa_put(ifp);
+ in6_dev_put(idev);
+ ret = -1;
+ goto out;
+ }
addr_flags = IFA_F_TEMPORARY;
/* set in addrconf_prefix_rcv() */
next prev parent reply other threads:[~2008-04-01 23:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 23:08 [PATCH 0 of 2] IPv6: Fix temporary address support (updated) Benoit Boissinot
2008-04-01 23:09 ` [PATCH 1 of 2] IPv6: only update the lifetime of the relevant temporary address Benoit Boissinot
2008-04-01 23:48 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-02 7:02 ` David Miller
2008-04-01 23:09 ` Benoit Boissinot [this message]
2008-04-01 23:50 ` [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime YOSHIFUJI Hideaki / 吉藤英明
2008-04-02 7:02 ` David Miller
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=00affc24c178e6da3a3b.1207091341@pirzuine \
--to=benoit.boissinot@ens-lyon.org \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=yoshfuji@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