]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/addrconf.h
Merge commit 'v2.6.26-rc9' into x86/cpu
[linux-2.6-omap-h63xx.git] / include / net / addrconf.h
index 92af23d66eb93a24f9e7cc812c94d6c2b1e21436..bbd3d583c6e65fe65768030cff346d235763595b 100644 (file)
@@ -94,6 +94,28 @@ extern void                  addrconf_join_solict(struct net_device *dev,
 extern void                    addrconf_leave_solict(struct inet6_dev *idev,
                                        struct in6_addr *addr);
 
+static inline unsigned long addrconf_timeout_fixup(u32 timeout,
+                                                   unsigned unit)
+{
+       if (timeout == 0xffffffff)
+               return ~0UL;
+
+       /*
+        * Avoid arithmetic overflow.
+        * Assuming unit is constant and non-zero, this "if" statement
+        * will go away on 64bit archs.
+        */
+       if (0xfffffffe > LONG_MAX / unit && timeout > LONG_MAX / unit)
+               return LONG_MAX / unit;
+
+       return timeout;
+}
+
+static inline int addrconf_finite_timeout(unsigned long timeout)
+{
+       return ~timeout;
+}
+
 /*
  *     IPv6 Address Label subsystem (addrlabel.c)
  */
@@ -205,17 +227,6 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
                      htonl(0xFF000000) | addr->s6_addr32[3]);
 }
 
-
-static inline void ipv6_addr_all_nodes(struct in6_addr *addr)
-{
-       ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x1));
-}
-
-static inline void ipv6_addr_all_routers(struct in6_addr *addr)
-{
-       ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x2));
-}
-
 static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
 {
        return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);