]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ip: Move INFINITY_LIFE_TIME to addrconf.h.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 9 Aug 2024 23:54:06 +0000 (16:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 Aug 2024 01:56:14 +0000 (18:56 -0700)
INFINITY_LIFE_TIME is the common value used in IPv4 and IPv6 but defined
in both .c files.

Also, 0xffffffff used in addrconf_timeout_fixup() is INFINITY_LIFE_TIME.

Let's move INFINITY_LIFE_TIME's definition to addrconf.h

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20240809235406.50187-6-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/addrconf.h
net/ipv4/devinet.c
net/ipv6/addrconf.c

index b18e81f0c9e1a9c07bfee9d13c295e83d3f6bf2b..c8ed31828db364635523679f23cb1485df9820aa 100644 (file)
@@ -187,10 +187,12 @@ static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
        return 0;
 }
 
+#define INFINITY_LIFE_TIME 0xFFFFFFFF
+
 static inline unsigned long addrconf_timeout_fixup(u32 timeout,
                                                   unsigned int unit)
 {
-       if (timeout == 0xffffffff)
+       if (timeout == INFINITY_LIFE_TIME)
                return ~0UL;
 
        /*
index b5d2a9fd46c70bf8269a8e9f9a55f84f2e0b60e5..61be85154dd19d4a067ad96ed025150e33a1b363 100644 (file)
@@ -703,8 +703,6 @@ errout:
        return err;
 }
 
-#define INFINITY_LIFE_TIME     0xFFFFFFFF
-
 static void check_lifetime(struct work_struct *work)
 {
        unsigned long now, next, next_sec, next_sched;
index c87d008aefa4cc4dfeaf9269034efb840d4222e9..04ee75af2f6b7f6d99d0cfd604682de5a5e0a5e0 100644 (file)
@@ -92,8 +92,6 @@
 #include <linux/export.h>
 #include <linux/ioam6.h>
 
-#define        INFINITY_LIFE_TIME      0xFFFFFFFF
-
 #define IPV6_MAX_STRLEN \
        sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")