Skip to content

Commit

Permalink
net: ipv4: notify when address lifetime changes
Browse files Browse the repository at this point in the history
if userspace changes lifetime of address, send netlink notification and
call notifier.

Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Apr 5, 2013
1 parent f01fc1a commit 34e2ed3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 34e2ed3

Please sign in to comment.