1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

sd-ndisc: drop unused functions

All received information is stored in sd_ndisc_router, and we have
sd_ndisc_router_get_mtu() and sd_ndisc_router_get_hop_limit().
This commit is contained in:
Yu Watanabe 2021-10-29 22:05:16 +09:00
parent a27c229c15
commit 9661d2e80c
4 changed files with 0 additions and 36 deletions

View File

@ -25,8 +25,6 @@ struct sd_ndisc {
int event_priority; int event_priority;
struct ether_addr mac_addr; struct ether_addr mac_addr;
uint8_t hop_limit;
uint32_t mtu;
sd_event_source *recv_event_source; sd_event_source *recv_event_source;
sd_event_source *timeout_event_source; sd_event_source *timeout_event_source;

View File

@ -179,28 +179,6 @@ _public_ int sd_ndisc_new(sd_ndisc **ret) {
return 0; 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) { static int ndisc_handle_datagram(sd_ndisc *nd, sd_ndisc_router *rt) {
int r; int r;
@ -213,12 +191,6 @@ static int ndisc_handle_datagram(sd_ndisc *nd, sd_ndisc_router *rt) {
if (r < 0) if (r < 0)
return 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", 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->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", rt->preference == SD_NDISC_PREFERENCE_HIGH ? "high" : rt->preference == SD_NDISC_PREFERENCE_LOW ? "low" : "medium",

View File

@ -242,7 +242,6 @@ static void test_callback(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router
ND_RA_FLAG_MANAGED ND_RA_FLAG_MANAGED
}; };
uint64_t flags; uint64_t flags;
uint32_t mtu;
assert_se(nd); assert_se(nd);
@ -263,8 +262,6 @@ static void test_callback(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router
return; return;
} }
assert_se(sd_ndisc_get_mtu(nd, &mtu) == -ENODATA);
sd_event_exit(e, 0); sd_event_exit(e, 0);
} }

View 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_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_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); 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_ref(sd_ndisc_router *rt);
sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt); sd_ndisc_router *sd_ndisc_router_unref(sd_ndisc_router *rt);