net/mcast-proxy - allow upstream interface to receive reports

While here:
- use GH_*
- enable building of debug package
- add rc_configtest to rc script

Tested by, and OK from, Paul de Weerd (maintainer)
This commit is contained in:
bket 2022-10-10 17:34:15 +00:00
parent 3c4682f196
commit b5880430bc
5 changed files with 55 additions and 9 deletions

View File

@ -1,21 +1,26 @@
COMMENT = multicast proxy daemon
DISTNAME = mcast-proxy-1.0
CATEGORIES = net
REVISION = 3
GH_ACCOUNT = Esdenera
GH_PROJECT = mcast-proxy
GH_TAGNAME = v1.0
REVISION = 4
MASTER_SITES = http://www.weirdnet.nl/openbsd/code/mcast-proxy/
CATEGORIES = net
MAINTAINER = Paul de Weerd <weerd@weirdnet.nl>
# ISC
PERMIT_PACKAGE = Yes
# uses pledge()
WANTLIB = c event
FAKE_FLAGS = BINDIR="${PREFIX}/sbin" \
MANDIR="${PREFIX}/man/man"
DEBUG_PACKAGES = ${BUILD_PACKAGES}
NO_TEST = Yes
FAKE_FLAGS = BINDIR="${PREFIX}/sbin" MANDIR="${PREFIX}/man/man"
WRKSRC = ${WRKDIST}/usr.sbin/mcast-proxy
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (mcast-proxy-1.0.tar.gz) = sAEcDnDFT4t/Tpf1AFngdktMlcahtE6o1yuCZk1hqrM=
SIZE (mcast-proxy-1.0.tar.gz) = 24944
SHA256 (mcast-proxy-1.0.tar.gz) = DWrjoZ4ca/hU6jfItLNw0fS9IS2NrFIvkeo+dnJLEfU=
SIZE (mcast-proxy-1.0.tar.gz) = 28538

View File

@ -0,0 +1,36 @@
Allow upstream interface to receive query and report IGMP messages. RFC4605
section 4.1 states "The proxy device performs the host portion of the IGMP/MLD
protocol on the upstream interface", and RFC2236 section 6 states "All other
events, such as receiving invalid IGMP messages, or IGMP messages other than
Query or Report, are ignored in all states".
Index: usr.sbin/mcast-proxy/mcast-proxy.c
--- usr.sbin/mcast-proxy/mcast-proxy.c.orig
+++ usr.sbin/mcast-proxy/mcast-proxy.c
@@ -605,13 +605,6 @@ igmp_recv(int fd, __unused short ev, __unused void *ar
return;
}
- /* Don't receive commands from upstream interface. */
- if (id == upstreamif) {
- log_debug("%s: ignoring host command on upstream interface",
- __func__);
- return;
- }
-
switch (igmp->igmp_type) {
case IGMP_HOST_MEMBERSHIP_QUERY:
break;
@@ -624,6 +617,12 @@ igmp_recv(int fd, __unused short ev, __unused void *ar
&igmp->igmp_group);
break;
case IGMP_HOST_LEAVE_MESSAGE:
+ if (id == upstreamif) {
+ log_debug("%s: ignoring command on upstream interface",
+ __func__);
+ return;
+ }
+
mrt_remove4(id, &sstosin(&src)->sin_addr, &igmp->igmp_group);
break;
}

View File

@ -1,6 +1,6 @@
@newgroup _mcastproxy:792
@newuser _mcastproxy:792:792:daemon:Multicast Proxy:/var/empty:/sbin/nologin
@rcscript ${RCDIR}/mcastproxy
@man man/man5/mcast-proxy.conf.5
@man man/man8/mcast-proxy.8
@bin sbin/mcast-proxy
@rcscript ${RCDIR}/mcastproxy

View File

@ -4,6 +4,11 @@ daemon="${TRUEPREFIX}/sbin/mcast-proxy"
. /etc/rc.d/rc.subr
rc_configtest() {
# use rc_exec here since daemon_flags may contain arguments with spaces
rc_exec "${daemon} -n ${daemon_flags}"
}
rc_reload=NO
rc_cmd $1