Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88043
b: refs/heads/master
c: eac55bf
h: refs/heads/master
i:
  88041: b8a071d
  88039: a68fc52
v: v3
  • Loading branch information
Benoit Boissinot authored and David S. Miller committed Apr 2, 2008
1 parent ed2b430 commit b8224a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6fbfac2e61c9a8617f64b93e8c990b8d864bce5
refs/heads/master: eac55bf97094f6b64116426864cf4666ef7587bc
16 changes: 16 additions & 0 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i
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;
Expand Down Expand Up @@ -836,8 +837,23 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i
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() */
if (ifp->flags & IFA_F_OPTIMISTIC)
Expand Down

0 comments on commit b8224a7

Please sign in to comment.