Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement setup_allrouters_membership() et al for FreeBSD #145 #241

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions device-bsd44.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,31 @@ int update_device_info(int sock, struct Interface *iface)

int setup_allrouters_membership(int sock, struct Interface *iface)
{
return 0;
struct ipv6_mreq mreq;

/* Quoting:
https://github.com/radvd-project/radvd/issues/145#issuecomment-810466476
memset(&mreq, 0, sizeof(mreq));
mreq.ipv6mr_interface = iface->props.if_index;

OK, it will be up to FreeBSD guys to show up
if they want to upstream their patches.
/* all-routers multicast address */
if (inet_pton(AF_INET6, "ff02::2",
&mreq.ipv6mr_multiaddr.s6_addr) != 1) {
flog(LOG_ERR, "inet_pton failed");
return -1;
}

*/
if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
&mreq, sizeof(mreq)) < 0 && errno != EADDRINUSE) {
flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->props.name);
return -1;
}

return 0;
}

int cleanup_allrouters_membership(int sock, struct Interface *iface)
{
/* no cleanup necessary */
return 0;

/* Quoting:
https://github.com/radvd-project/radvd/issues/145#issuecomment-810466476

OK, it will be up to FreeBSD guys to show up
if they want to upstream their patches.

*/
}

int set_interface_linkmtu(const char *iface, uint32_t mtu)
Expand Down Expand Up @@ -184,5 +187,5 @@ int check_ip6_forwarding(void)
int check_ip6_iface_forwarding(const char *iface)
{
dlog(LOG_DEBUG, 4, "checking ipv6 forwarding of interface not supported");
return -1;
return 1;
}
Loading