netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0 of 2] IPv6: Fix temporary address support (updated)
@ 2008-04-01 23:08 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:09 ` [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime Benoit Boissinot
  0 siblings, 2 replies; 7+ messages in thread
From: Benoit Boissinot @ 2008-04-01 23:08 UTC (permalink / raw)
  To: netdev; +Cc: pekkas, yoshfuji

This two patches are the patches Yoshfuji said he agreed, I fixed
his comments.

regards,

Benoit

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1 of 2] IPv6: only update the lifetime of the relevant temporary address
  2008-04-01 23:08 [PATCH 0 of 2] IPv6: Fix temporary address support (updated) Benoit Boissinot
@ 2008-04-01 23:09 ` Benoit Boissinot
  2008-04-01 23:48   ` YOSHIFUJI Hideaki / 吉藤英明
  2008-04-01 23:09 ` [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime Benoit Boissinot
  1 sibling, 1 reply; 7+ messages in thread
From: Benoit Boissinot @ 2008-04-01 23:09 UTC (permalink / raw)
  To: netdev; +Cc: pekkas, yoshfuji

IPv6: only update the lifetime of the relevant temporary address

When receiving a prefix information from a routeur, only update the lifetimes
of the temporary address associated with that prefix.
Otherwise if one deprecated prefix is advertized, all your temporary addresses
will become deprecated.

Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>

diff -r a3c03e70c69f -r 0c33481968e0 net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	Wed Apr 02 00:45:29 2008 +0200
+++ b/net/ipv6/addrconf.c	Sat Mar 22 00:41:39 2008 +0100
@@ -1831,6 +1831,9 @@
 				 * lifetimes of an existing temporary address
 				 * when processing a Prefix Information Option.
 				 */
+				if (ifp != ift->ifpub)
+					continue;
+
 				spin_lock(&ift->lock);
 				flags = ift->flags;
 				if (ift->valid_lft > valid_lft &&

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime
  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:09 ` Benoit Boissinot
  2008-04-01 23:50   ` YOSHIFUJI Hideaki / 吉藤英明
  1 sibling, 1 reply; 7+ messages in thread
From: Benoit Boissinot @ 2008-04-01 23:09 UTC (permalink / raw)
  To: netdev; +Cc: pekkas, yoshfuji

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() */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1 of 2] IPv6: only update the lifetime of the relevant temporary address
  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
  0 siblings, 1 reply; 7+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-04-01 23:48 UTC (permalink / raw)
  To: benoit.boissinot; +Cc: netdev, pekkas

In article <0c33481968e0b6b8efd7.1207091340@pirzuine> (at Wed, 02 Apr 2008 01:09:00 +0200), Benoit Boissinot <benoit.boissinot@ens-lyon.org> says:

> IPv6: only update the lifetime of the relevant temporary address
> 
> When receiving a prefix information from a routeur, only update the lifetimes
> of the temporary address associated with that prefix.
> Otherwise if one deprecated prefix is advertized, all your temporary addresses
> will become deprecated.
> 
> Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>

Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

> 
> diff -r a3c03e70c69f -r 0c33481968e0 net/ipv6/addrconf.c
> --- a/net/ipv6/addrconf.c	Wed Apr 02 00:45:29 2008 +0200
> +++ b/net/ipv6/addrconf.c	Sat Mar 22 00:41:39 2008 +0100
> @@ -1831,6 +1831,9 @@
>  				 * lifetimes of an existing temporary address
>  				 * when processing a Prefix Information Option.
>  				 */
> +				if (ifp != ift->ifpub)
> +					continue;
> +
>  				spin_lock(&ift->lock);
>  				flags = ift->flags;
>  				if (ift->valid_lft > valid_lft &&
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime
  2008-04-01 23:09 ` [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime Benoit Boissinot
@ 2008-04-01 23:50   ` YOSHIFUJI Hideaki / 吉藤英明
  2008-04-02  7:02     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-04-01 23:50 UTC (permalink / raw)
  To: benoit.boissinot, davem; +Cc: netdev, pekkas

In article <00affc24c178e6da3a3b.1207091341@pirzuine> (at Wed, 02 Apr 2008 01:09:01 +0200), Benoit Boissinot <benoit.boissinot@ens-lyon.org> says:

> 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>

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.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() */
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1 of 2] IPv6: only update the lifetime of the relevant temporary address
  2008-04-01 23:48   ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-04-02  7:02     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2008-04-02  7:02 UTC (permalink / raw)
  To: yoshfuji; +Cc: benoit.boissinot, netdev, pekkas

From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Date: Wed, 02 Apr 2008 08:48:36 +0900 (JST)

> In article <0c33481968e0b6b8efd7.1207091340@pirzuine> (at Wed, 02 Apr 2008 01:09:00 +0200), Benoit Boissinot <benoit.boissinot@ens-lyon.org> says:
> 
> > IPv6: only update the lifetime of the relevant temporary address
> > 
> > When receiving a prefix information from a routeur, only update the lifetimes
> > of the temporary address associated with that prefix.
> > Otherwise if one deprecated prefix is advertized, all your temporary addresses
> > will become deprecated.
> > 
> > Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
> 
> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime
  2008-04-01 23:50   ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-04-02  7:02     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2008-04-02  7:02 UTC (permalink / raw)
  To: yoshfuji; +Cc: benoit.boissinot, netdev, pekkas

From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Date: Wed, 02 Apr 2008 08:50:11 +0900 (JST)

> In article <00affc24c178e6da3a3b.1207091341@pirzuine> (at Wed, 02 Apr 2008 01:09:01 +0200), Benoit Boissinot <benoit.boissinot@ens-lyon.org> says:
> 
> > 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>
> 
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-02  7:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2 of 2] IPv6: do not create temporary adresses with too short preferred lifetime Benoit Boissinot
2008-04-01 23:50   ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-02  7:02     ` David Miller

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).