Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 784e2710 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

ipv6: Use interface max_desync_factor instead of static default



max_desync_factor can be configured per-interface, but nothing is
using the value.

Reported-by: default avatarPiotr Lewandowski <piotr.lewandowski@gmail.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f56619fc
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -121,8 +121,6 @@ static inline void addrconf_sysctl_unregister(struct inet6_dev *idev)
static int __ipv6_regen_rndid(struct inet6_dev *idev);
static int __ipv6_regen_rndid(struct inet6_dev *idev);
static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr);
static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr);
static void ipv6_regen_rndid(unsigned long data);
static void ipv6_regen_rndid(unsigned long data);

static int desync_factor = MAX_DESYNC_FACTOR * HZ;
#endif
#endif


static int ipv6_generate_eui64(u8 *eui, struct net_device *dev);
static int ipv6_generate_eui64(u8 *eui, struct net_device *dev);
@@ -893,7 +891,8 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i
			      idev->cnf.temp_valid_lft);
			      idev->cnf.temp_valid_lft);
	tmp_prefered_lft = min_t(__u32,
	tmp_prefered_lft = min_t(__u32,
				 ifp->prefered_lft,
				 ifp->prefered_lft,
				 idev->cnf.temp_prefered_lft - desync_factor / HZ);
				 idev->cnf.temp_prefered_lft -
				 idev->cnf.max_desync_factor);
	tmp_plen = ifp->prefix_len;
	tmp_plen = ifp->prefix_len;
	max_addresses = idev->cnf.max_addresses;
	max_addresses = idev->cnf.max_addresses;
	tmp_cstamp = ifp->cstamp;
	tmp_cstamp = ifp->cstamp;
@@ -1653,7 +1652,8 @@ static void ipv6_regen_rndid(unsigned long data)


	expires = jiffies +
	expires = jiffies +
		idev->cnf.temp_prefered_lft * HZ -
		idev->cnf.temp_prefered_lft * HZ -
		idev->cnf.regen_max_retry * idev->cnf.dad_transmits * idev->nd_parms->retrans_time - desync_factor;
		idev->cnf.regen_max_retry * idev->cnf.dad_transmits * idev->nd_parms->retrans_time -
		idev->cnf.max_desync_factor * HZ;
	if (time_before(expires, jiffies)) {
	if (time_before(expires, jiffies)) {
		printk(KERN_WARNING
		printk(KERN_WARNING
			"ipv6_regen_rndid(): too short regeneration interval; timer disabled for %s.\n",
			"ipv6_regen_rndid(): too short regeneration interval; timer disabled for %s.\n",