Patchwork [net] net: ipv4: notify when address lifetime changes

login
register
mail settings
Submitter Jiri Pirko
Date April 4, 2013, 6:33 p.m.
Message ID <1365100380-6796-1-git-send-email-jiri@resnulli.us>
Download mbox | patch
Permalink /patch/233897/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jiri Pirko - April 4, 2013, 6:33 p.m.
if userspace changes lifetime of address, send netlink notification and
call notifier.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/ipv4/devinet.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
David Miller - April 5, 2013, 4:51 a.m.
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu,  4 Apr 2013 20:33:00 +0200

> if userspace changes lifetime of address, send netlink notification and
> call notifier.
> 
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>

Applied and queued up for -stable, thanks Jiri.
--
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

Patch

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f678507..96083b7 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -802,8 +802,10 @@  static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
 		if (nlh->nlmsg_flags & NLM_F_EXCL ||
 		    !(nlh->nlmsg_flags & NLM_F_REPLACE))
 			return -EEXIST;
-
-		set_ifa_lifetime(ifa_existing, valid_lft, prefered_lft);
+		ifa = ifa_existing;
+		set_ifa_lifetime(ifa, valid_lft, prefered_lft);
+		rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
+		blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
 	}
 	return 0;
 }