summaryrefslogtreecommitdiff
path: root/include/linux/inetdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-24 13:41:41 +0400
committerDavid S. Miller <davem@davemloft.net>2013-01-29 22:59:57 +0400
commit5c766d642bcaffd0c2a5b354db2068515b3846cf (patch)
treef5bb2ed37d70c79304c17911de77779ea92c1041 /include/linux/inetdevice.h
parent5a1dc31708701e54db1b2bb80215c67d61505d3e (diff)
downloadlinux-5c766d642bcaffd0c2a5b354db2068515b3846cf.tar.xz
ipv4: introduce address lifetime
There are some usecase when lifetime of ipv4 addresses might be helpful. For example: 1) initramfs networkmanager uses a DHCP daemon to learn network configuration parameters 2) initramfs networkmanager addresses, routes and DNS configuration 3) initramfs networkmanager is requested to stop 4) initramfs networkmanager stops all daemons including dhclient 5) there are addresses and routes configured but no daemon running. If the system doesn't start networkmanager for some reason, addresses and routes will be used forever, which violates RFC 2131. This patch is essentially a backport of ivp6 address lifetime mechanism for ipv4 addresses. Current "ip" tool supports this without any patch (since it does not distinguish between ipv4 and ipv6 addresses in this perspective. Also, this should be back-compatible with all current netlink users. Reported-by: Pavel Šimerda <psimerda@redhat.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r--include/linux/inetdevice.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index a9d828976a77..ea1e3b863890 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -166,6 +166,12 @@ struct in_ifaddr {
unsigned char ifa_flags;
unsigned char ifa_prefixlen;
char ifa_label[IFNAMSIZ];
+
+ /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
+ __u32 ifa_valid_lft;
+ __u32 ifa_preferred_lft;
+ unsigned long ifa_cstamp; /* created timestamp */
+ unsigned long ifa_tstamp; /* updated timestamp */
};
extern int register_inetaddr_notifier(struct notifier_block *nb);