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

tinc: add sequoia build patch #190728

Merged
merged 1 commit into from
Sep 16, 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
72 changes: 72 additions & 0 deletions Formula/t/tinc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Tinc < Formula

uses_from_macos "zlib"

# fix build errors, upstream pr ref, https://github.com/gsliepen/tinc/pull/464
patch :DATA

def install
system "./configure", "--prefix=#{prefix}", "--sysconfdir=#{etc}",
"--with-openssl=#{Formula["openssl@3"].opt_prefix}"
Expand All @@ -52,3 +55,72 @@ def post_install
assert_match version.to_s, shell_output("#{sbin}/tincd --version")
end
end

__END__
diff --git a/src/net_socket.c b/src/net_socket.c
index 6195c16..e072970 100644
--- a/src/net_socket.c
+++ b/src/net_socket.c
@@ -102,14 +102,14 @@ static bool bind_to_interface(int sd) {

#if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE)
memset(&ifr, 0, sizeof(ifr));
- strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
- ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0;
+ strncpy(ifr.ifr_name, iface, IFNAMSIZ);
+ ifr.ifr_name[IFNAMSIZ - 1] = 0;
free(iface);

status = setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr));

if(status) {
- logger(LOG_ERR, "Can't bind to interface %s: %s", ifr.ifr_ifrn.ifrn_name, strerror(errno));
+ logger(LOG_ERR, "Can't bind to interface %s: %s", ifr.ifr_name, strerror(errno));
return false;
}

@@ -157,13 +157,13 @@ int setup_listen_socket(const sockaddr_t *sa) {
struct ifreq ifr;

memset(&ifr, 0, sizeof(ifr));
- strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
- ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0;
+ strncpy(ifr.ifr_name, iface, IFNAMSIZ);
+ ifr.ifr_name[IFNAMSIZ - 1] = 0;
free(iface);

if(setsockopt(nfd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr))) {
closesocket(nfd);
- logger(LOG_ERR, "Can't bind to interface %s: %s", ifr.ifr_ifrn.ifrn_name, strerror(sockerrno));
+ logger(LOG_ERR, "Can't bind to interface %s: %s", ifr.ifr_name, strerror(sockerrno));
return -1;
}

diff --git a/src/raw_socket_device.c b/src/raw_socket_device.c
index f4ed694..cf13fe9 100644
--- a/src/raw_socket_device.c
+++ b/src/raw_socket_device.c
@@ -61,12 +61,12 @@ static bool setup_device(void) {
#endif

memset(&ifr, 0, sizeof(ifr));
- strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ);
- ifr.ifr_ifrn.ifrn_name[IFNAMSIZ - 1] = 0;
+ strncpy(ifr.ifr_name, iface, IFNAMSIZ);
+ ifr.ifr_name[IFNAMSIZ - 1] = 0;

if(ioctl(device_fd, SIOCGIFINDEX, &ifr)) {
close(device_fd);
- logger(LOG_ERR, "Can't find interface %s: %s", ifr.ifr_ifrn.ifrn_name, strerror(errno));
+ logger(LOG_ERR, "Can't find interface %s: %s", ifr.ifr_name, strerror(errno));
return false;
}

@@ -76,7 +76,7 @@ static bool setup_device(void) {
sa.sll_ifindex = ifr.ifr_ifindex;

if(bind(device_fd, (struct sockaddr *) &sa, (socklen_t) sizeof(sa))) {
- logger(LOG_ERR, "Could not bind %s to %s: %s", device, ifr.ifr_ifrn.ifrn_name, strerror(errno));
+ logger(LOG_ERR, "Could not bind %s to %s: %s", device, ifr.ifr_name, strerror(errno));
return false;
}
Loading