.. | .. |
---|
318 | 318 | static void addrconf_mod_rs_timer(struct inet6_dev *idev, |
---|
319 | 319 | unsigned long when) |
---|
320 | 320 | { |
---|
321 | | - if (!timer_pending(&idev->rs_timer)) |
---|
| 321 | + if (!mod_timer(&idev->rs_timer, jiffies + when)) |
---|
322 | 322 | in6_dev_hold(idev); |
---|
323 | | - mod_timer(&idev->rs_timer, jiffies + when); |
---|
324 | 323 | } |
---|
325 | 324 | |
---|
326 | 325 | static void addrconf_mod_dad_work(struct inet6_ifaddr *ifp, |
---|
.. | .. |
---|
1364 | 1363 | * idev->desync_factor if it's larger |
---|
1365 | 1364 | */ |
---|
1366 | 1365 | cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_prefered_lft); |
---|
1367 | | - max_desync_factor = min_t(__u32, |
---|
| 1366 | + max_desync_factor = min_t(long, |
---|
1368 | 1367 | idev->cnf.max_desync_factor, |
---|
1369 | 1368 | cnf_temp_preferred_lft - regen_advance); |
---|
1370 | 1369 | |
---|
.. | .. |
---|
2580 | 2579 | ipv6_ifa_notify(0, ift); |
---|
2581 | 2580 | } |
---|
2582 | 2581 | |
---|
2583 | | - if ((create || list_empty(&idev->tempaddr_list)) && |
---|
2584 | | - idev->cnf.use_tempaddr > 0) { |
---|
| 2582 | + /* Also create a temporary address if it's enabled but no temporary |
---|
| 2583 | + * address currently exists. |
---|
| 2584 | + * However, we get called with valid_lft == 0, prefered_lft == 0, create == false |
---|
| 2585 | + * as part of cleanup (ie. deleting the mngtmpaddr). |
---|
| 2586 | + * We don't want that to result in creating a new temporary ip address. |
---|
| 2587 | + */ |
---|
| 2588 | + if (list_empty(&idev->tempaddr_list) && (valid_lft || prefered_lft)) |
---|
| 2589 | + create = true; |
---|
| 2590 | + |
---|
| 2591 | + if (create && idev->cnf.use_tempaddr > 0) { |
---|
2585 | 2592 | /* When a new public address is created as described |
---|
2586 | 2593 | * in [ADDRCONF], also create a new temporary address. |
---|
2587 | | - * Also create a temporary address if it's enabled but |
---|
2588 | | - * no temporary address currently exists. |
---|
2589 | 2594 | */ |
---|
2590 | 2595 | read_unlock_bh(&idev->lock); |
---|
2591 | 2596 | ipv6_create_tempaddr(ifp, false); |
---|