icmp6-util: drop unused icmp6_send_router_solicitation()

This commit is contained in:
Yu Watanabe
2024-03-15 23:26:36 +09:00
parent 349d51e7a1
commit d112b4454c
3 changed files with 0 additions and 46 deletions

View File

@@ -27,15 +27,6 @@ int icmp6_send(int fd, const struct sockaddr_in6 *dst, const struct iovec *iov,
return writev(fd, iov, n_iov);
}
int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
static const struct nd_router_solicit header = {
.nd_rs_type = ND_ROUTER_SOLICIT,
};
assert_se(write(s, &header, sizeof(header)) >= 0);
return 0;
}
int icmp6_receive(
int fd,
void *iov_base,

View File

@@ -102,42 +102,6 @@ int icmp6_send(int fd, const struct sockaddr_in6 *dst, const struct iovec *iov,
return 0;
}
int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr) {
struct sockaddr_in6 dst = {
.sin6_family = AF_INET6,
.sin6_addr = IN6ADDR_ALL_ROUTERS_MULTICAST_INIT,
};
struct {
struct nd_router_solicit rs;
struct nd_opt_hdr rs_opt;
struct ether_addr rs_opt_mac;
} _packed_ rs = {
.rs.nd_rs_type = ND_ROUTER_SOLICIT,
.rs_opt.nd_opt_type = ND_OPT_SOURCE_LINKADDR,
.rs_opt.nd_opt_len = 1,
};
struct iovec iov = {
.iov_base = &rs,
.iov_len = sizeof(rs),
};
struct msghdr msg = {
.msg_name = &dst,
.msg_namelen = sizeof(dst),
.msg_iov = &iov,
.msg_iovlen = 1,
};
assert(s >= 0);
assert(ether_addr);
rs.rs_opt_mac = *ether_addr;
if (sendmsg(s, &msg, 0) < 0)
return -errno;
return 0;
}
int icmp6_receive(
int fd,
void *buffer,

View File

@@ -22,7 +22,6 @@
int icmp6_bind(int ifindex, bool is_router);
int icmp6_send(int fd, const struct sockaddr_in6 *dst, const struct iovec *iov, size_t n_iov);
int icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr);
int icmp6_receive(
int fd,
void *buffer,