]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: ipv4: reset check_lifetime_work after changing lifetime
authorJiri Pirko <jiri@resnulli.us>
Thu, 4 Apr 2013 23:39:38 +0000 (23:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2013 16:04:51 +0000 (12:04 -0400)
This will result in calling check_lifetime in nearest opportunity and
that function will adjust next time to call check_lifetime correctly.
Without this, check_lifetime is called in time computed by previous run,
not affecting modified lifetime.

Introduced by: commit 5c766d642bcaf "ipv4: introduce address lifetime"

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c

index 96083b7a436bc9efddd0b8b3473caa78286e5f02..00386e02e708e540bf1adca821806a89255302ea 100644 (file)
@@ -804,6 +804,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
                        return -EEXIST;
                ifa = ifa_existing;
                set_ifa_lifetime(ifa, valid_lft, prefered_lft);
+               cancel_delayed_work(&check_lifetime_work);
+               schedule_delayed_work(&check_lifetime_work, 0);
                rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
                blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
        }