]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-ndisc: drop unused functions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Oct 2021 13:05:16 +0000 (22:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Oct 2021 13:05:27 +0000 (22:05 +0900)
All received information is stored in sd_ndisc_router, and we have
sd_ndisc_router_get_mtu() and sd_ndisc_router_get_hop_limit().

src/libsystemd-network/ndisc-internal.h
src/libsystemd-network/sd-ndisc.c
src/libsystemd-network/test-ndisc-rs.c
src/systemd/sd-ndisc.h

index d379b44519446829c85fb761b3a6fe4f370370cf..615de0db51851a176663c9e73f7cd0bfdb9b0247 100644 (file)
@@ -25,8 +25,6 @@ struct sd_ndisc {
         int event_priority;
 
         struct ether_addr mac_addr;
-        uint8_t hop_limit;
-        uint32_t mtu;
 
         sd_event_source *recv_event_source;
         sd_event_source *timeout_event_source;
index 65f75cc2506e555aba17e747505cc8626f97c316..276c205ecfb60e38b6a242eee5a9ea7253adfcf6 100644 (file)
@@ -179,28 +179,6 @@ _public_ int sd_ndisc_new(sd_ndisc **ret) {
         return 0;
 }
 
-_public_ int sd_ndisc_get_mtu(sd_ndisc *nd, uint32_t *mtu) {
-        assert_return(nd, -EINVAL);
-        assert_return(mtu, -EINVAL);
-
-        if (nd->mtu == 0)
-                return -ENODATA;
-
-        *mtu = nd->mtu;
-        return 0;
-}
-
-_public_ int sd_ndisc_get_hop_limit(sd_ndisc *nd, uint8_t *ret) {
-        assert_return(nd, -EINVAL);
-        assert_return(ret, -EINVAL);
-
-        if (nd->hop_limit == 0)
-                return -ENODATA;
-
-        *ret = nd->hop_limit;
-        return 0;
-}
-
 static int ndisc_handle_datagram(sd_ndisc *nd, sd_ndisc_router *rt) {
         int r;
 
@@ -213,12 +191,6 @@ static int ndisc_handle_datagram(sd_ndisc *nd, sd_ndisc_router *rt) {
         if (r < 0)
                 return 0;
 
-        /* Update global variables we keep */
-        if (rt->mtu > 0)
-                nd->mtu = rt->mtu;
-        if (rt->hop_limit > 0)
-                nd->hop_limit = rt->hop_limit;
-
         log_ndisc(nd, "Received Router Advertisement: flags %s preference %s lifetime %" PRIu16 " sec",
                   rt->flags & ND_RA_FLAG_MANAGED ? "MANAGED" : rt->flags & ND_RA_FLAG_OTHER ? "OTHER" : "none",
                   rt->preference == SD_NDISC_PREFERENCE_HIGH ? "high" : rt->preference == SD_NDISC_PREFERENCE_LOW ? "low" : "medium",
index ae26ee7e741cdd2510666eacc9a5bcc522b955a7..1366b44115ac025919594b769c85813744d009e7 100644 (file)
@@ -242,7 +242,6 @@ static void test_callback(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router
                 ND_RA_FLAG_MANAGED
         };
         uint64_t flags;
-        uint32_t mtu;
 
         assert_se(nd);
 
@@ -263,8 +262,6 @@ static void test_callback(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router
                 return;
         }
 
-        assert_se(sd_ndisc_get_mtu(nd, &mtu) == -ENODATA);
-
         sd_event_exit(e, 0);
 }
 
index f45b2ad65ecc6256a7d9a06f949a725a427c249e..ab9ff55ddb110a945e2e9e9b448a6572a89215d8 100644 (file)
@@ -82,9 +82,6 @@ int sd_ndisc_set_ifname(sd_ndisc *nd, const char *interface_name);
 int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret);
 int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr);
 
-int sd_ndisc_get_mtu(sd_ndisc *nd, uint32_t *ret);
-int sd_ndisc_get_hop_limit(sd_ndisc *nd, uint8_t *ret);
-
 int sd_ndisc_router_from_raw(sd_ndisc_router **ret, const void *raw, size_t raw_size);
 sd_ndisc_router *sd_ndisc_router_ref(sd_ndisc_router *rt);
 sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt);