]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/route: use our definitions of route preference
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Apr 2024 06:29:28 +0000 (15:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Apr 2024 00:23:31 +0000 (09:23 +0900)
Including linux/icmpv6.h easily trigger conflicts when another header
includes netinet/icmp6.h. Let's drop the dependency and use our
definition of the same values.

src/network/networkd-route.c

index efe378a457289beac0309786376b44fa90eedaf1..a4c56f1bbd6554acda5b84e7454b3100bac0b055 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <linux/icmpv6.h>
 #include <linux/ipv6_route.h>
 #include <linux/nexthop.h>
 
@@ -1810,11 +1809,11 @@ int config_parse_ipv6_route_preference(
         }
 
         if (streq(rvalue, "low"))
-                route->pref = ICMPV6_ROUTER_PREF_LOW;
+                route->pref = SD_NDISC_PREFERENCE_LOW;
         else if (streq(rvalue, "medium"))
-                route->pref = ICMPV6_ROUTER_PREF_MEDIUM;
+                route->pref = SD_NDISC_PREFERENCE_MEDIUM;
         else if (streq(rvalue, "high"))
-                route->pref = ICMPV6_ROUTER_PREF_HIGH;
+                route->pref = SD_NDISC_PREFERENCE_HIGH;
         else {
                 log_syntax(unit, LOG_WARNING, filename, line, 0, "Unknown route preference: %s", rvalue);
                 return 0;