]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-radv: router lifetime is uint16_t
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 Nov 2020 07:35:24 +0000 (16:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 Nov 2020 15:04:52 +0000 (00:04 +0900)
src/libsystemd-network/sd-radv.c
src/systemd/sd-radv.h

index 5cef06a8a8ad19835a9b9c5999a1885d7b6ae005..5ad89ae7de0ee39498bdfbf44c56e6e295ee2b50 100644 (file)
@@ -466,14 +466,14 @@ _public_ int sd_radv_set_hop_limit(sd_radv *ra, uint8_t hop_limit) {
         return 0;
 }
 
-_public_ int sd_radv_set_router_lifetime(sd_radv *ra, uint32_t router_lifetime) {
+_public_ int sd_radv_set_router_lifetime(sd_radv *ra, uint16_t router_lifetime) {
         assert_return(ra, -EINVAL);
 
         if (ra->state != SD_RADV_STATE_IDLE)
                 return -EBUSY;
 
-        /* RFC 4191, Section 2.2, "...If the Router Lifetime is zero, the
-           preference value MUST be set to (00) by the sender..." */
+        /* RFC 4191, Section 2.2, "...If the Router Lifetime is zero, the preference value MUST be set
+         * to (00) by the sender..." */
         if (router_lifetime == 0 &&
             (ra->flags & (0x3 << 3)) != (SD_NDISC_PREFERENCE_MEDIUM << 3))
                 return -ETIME;
index 55ddee573186417e7af3e8a871812b363b259480..3f6c149d5e259daba08b92da1799b184195c9893 100644 (file)
@@ -56,7 +56,7 @@ int sd_radv_set_ifindex(sd_radv *ra, int interface_index);
 int sd_radv_set_mac(sd_radv *ra, const struct ether_addr *mac_addr);
 int sd_radv_set_mtu(sd_radv *ra, uint32_t mtu);
 int sd_radv_set_hop_limit(sd_radv *ra, uint8_t hop_limit);
-int sd_radv_set_router_lifetime(sd_radv *ra, uint32_t router_lifetime);
+int sd_radv_set_router_lifetime(sd_radv *ra, uint16_t router_lifetime);
 int sd_radv_set_managed_information(sd_radv *ra, int managed);
 int sd_radv_set_other_information(sd_radv *ra, int other);
 int sd_radv_set_preference(sd_radv *ra, unsigned preference);