Skip to content

Commit

Permalink
dns/dnsmasq: Fix --dhcp-relay not working on FreeBSD
Browse files Browse the repository at this point in the history
PR:		283138
MFH:		2024Q2
Reported by:	Harald Schmalzbauer
Obtained from:	Simon Kelley, https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff;h=5a1f2c577db58ea47727f1b6900c0be25e6db205

(cherry picked from commit b572f52)
  • Loading branch information
mandree committed Dec 8, 2024
1 parent 63698f0 commit 8cb026d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 1 addition & 2 deletions dns/dnsmasq/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PORTNAME= dnsmasq
DISTVERSION= 2.90
# Leave the PORTREVISION in even if 0 to avoid accidental PORTEPOCH bumps:
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= dns
MASTER_SITES= https://www.thekelleys.org.uk/dnsmasq/ \
Expand Down Expand Up @@ -31,7 +31,6 @@ CPPFLAGS+= -I${LOCALBASE}/include

CONFLICTS_INSTALL= dnsmasq-devel

PATCH_STRIP= -p1
SUB_FILES= pkg-message

PORTDOCS= CHANGELOG CHANGELOG.archive FAQ doc.html setup.html
Expand Down
10 changes: 10 additions & 0 deletions dns/dnsmasq/files/patch-CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- CHANGELOG.orig 2024-02-13 13:49:15 UTC
+++ CHANGELOG
@@ -1,3 +1,7 @@
+post version 2.90
+ Fix broken dhcp-relay on *BSD. Thanks to Harold for finding
+ this problem.
+
version 2.90
Fix reversion in --rev-server introduced in 2.88 which
caused breakage if the prefix length is not exactly divisible
12 changes: 12 additions & 0 deletions dns/dnsmasq/files/patch-src_dhcp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- src/dhcp.c.orig 2024-02-13 13:49:15 UTC
+++ src/dhcp.c
@@ -1121,6 +1121,9 @@ static int relay_upstream4(int iface_index, struct dhc
to.sa.sa_family = AF_INET;
to.in.sin_addr = relay->server.addr4;
to.in.sin_port = htons(relay->port);
+#ifdef HAVE_SOCKADDR_SA_LEN
+ to.in.sin_len = sizeof(struct sockaddr_in);
+#endif

/* Broadcasting to server. */
if (relay->server.addr4.s_addr == 0)

0 comments on commit 8cb026d

Please sign in to comment.