diff options
Diffstat (limited to 'include/net/addrconf.h')
-rw-r--r-- | include/net/addrconf.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 0a2f0372df3..06b28142b3a 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -94,12 +94,35 @@ extern void addrconf_join_solict(struct net_device *dev, | |||
94 | extern void addrconf_leave_solict(struct inet6_dev *idev, | 94 | extern void addrconf_leave_solict(struct inet6_dev *idev, |
95 | struct in6_addr *addr); | 95 | struct in6_addr *addr); |
96 | 96 | ||
97 | static inline unsigned long addrconf_timeout_fixup(u32 timeout, | ||
98 | unsigned unit) | ||
99 | { | ||
100 | if (timeout == 0xffffffff) | ||
101 | return ~0UL; | ||
102 | |||
103 | /* | ||
104 | * Avoid arithmetic overflow. | ||
105 | * Assuming unit is constant and non-zero, this "if" statement | ||
106 | * will go away on 64bit archs. | ||
107 | */ | ||
108 | if (0xfffffffe > LONG_MAX / unit && timeout > LONG_MAX / unit) | ||
109 | return LONG_MAX / unit; | ||
110 | |||
111 | return timeout; | ||
112 | } | ||
113 | |||
114 | static inline int addrconf_finite_timeout(unsigned long timeout) | ||
115 | { | ||
116 | return ~timeout; | ||
117 | } | ||
118 | |||
97 | /* | 119 | /* |
98 | * IPv6 Address Label subsystem (addrlabel.c) | 120 | * IPv6 Address Label subsystem (addrlabel.c) |
99 | */ | 121 | */ |
100 | extern int ipv6_addr_label_init(void); | 122 | extern int ipv6_addr_label_init(void); |
101 | extern void ipv6_addr_label_rtnl_register(void); | 123 | extern void ipv6_addr_label_rtnl_register(void); |
102 | extern u32 ipv6_addr_label(const struct in6_addr *addr, | 124 | extern u32 ipv6_addr_label(struct net *net, |
125 | const struct in6_addr *addr, | ||
103 | int type, int ifindex); | 126 | int type, int ifindex); |
104 | 127 | ||
105 | /* | 128 | /* |