Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mrouted for openSUSE:Factory checked 
in at 2023-08-30 10:19:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mrouted (Old)
 and      /work/SRC/openSUSE:Factory/.mrouted.new.1766 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mrouted"

Wed Aug 30 10:19:42 2023 rev:8 rq:1107096 version:4.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/mrouted/mrouted.changes  2021-11-18 
10:33:54.579911649 +0100
+++ /work/SRC/openSUSE:Factory/.mrouted.new.1766/mrouted.changes        
2023-08-30 10:22:18.816067747 +0200
@@ -1,0 +2,19 @@
+Sun Aug 27 14:05:21 UTC 2023 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 4.5
+  Fixes
+  * Ignore IGMP proxy querys (src ip: 0.0.0.0), they must never
+    win a querier election.
+  * Fix compat read location and new location for mrouted.genid
+  * Fix "non-decreasing" generation id, must increment on each
+    restart.
+  Changes
+  * Add support for configurable IGMP query response interval.
+  * Add support for configurable IGMP querier timeout.
+  * New join-group <group> phyint option for cases where an IGMP
+    snooping switch blocks flooding of multicast to the port where
+    mrouted is connected.
+  * On startup and reconf, log why we skip disabled interfaces.
+  * Change to always log when assuming the IGMP querier role.
+
+-------------------------------------------------------------------

Old:
----
  mrouted-4.4.tar.gz

New:
----
  mrouted-4.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mrouted.spec ++++++
--- /var/tmp/diff_new_pack.CvdfR7/_old  2023-08-30 10:22:20.552129714 +0200
+++ /var/tmp/diff_new_pack.CvdfR7/_new  2023-08-30 10:22:20.556129857 +0200
@@ -1,8 +1,8 @@
 #
 # spec file for package mrouted
 #
-# Copyright (c) 2021 SUSE LLC
-# Copyright (c) 2018-2021, Martin Hauke <mar...@gmx.de>
+# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2018-2023, Martin Hauke <mar...@gmx.de>
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 
 Name:           mrouted
-Version:        4.4
+Version:        4.5
 Release:        0
 Summary:        An implementation of the DVMRP multicast routing protocol
 License:        BSD-3-Clause AND BSD-4-Clause

++++++ harden_mrouted.service.patch ++++++
--- /var/tmp/diff_new_pack.CvdfR7/_old  2023-08-30 10:22:20.584130856 +0200
+++ /var/tmp/diff_new_pack.CvdfR7/_new  2023-08-30 10:22:20.588130999 +0200
@@ -1,7 +1,7 @@
-Index: mrouted-4.3/mrouted.service.in
-===================================================================
---- mrouted-4.3.orig/mrouted.service.in
-+++ mrouted-4.3/mrouted.service.in
+diff --git a/mrouted.service.in b/mrouted.service.in
+index 80d5d64..8c25a16 100644
+--- a/mrouted.service.in
++++ b/mrouted.service.in
 @@ -10,6 +10,19 @@ After=network-online.target
  Requires=network-online.target
  
@@ -21,5 +21,5 @@
 +# end of automatic additions 
  Type=simple
  ExecStartPre=-/sbin/modprobe ipip
- ExecStart=@SBINDIR@/mrouted -ns
+ EnvironmentFile=-@SYSCONFDIR@/default/mrouted
 

++++++ mrouted-4.4.tar.gz -> mrouted-4.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/.github/FUNDING.yml 
new/mrouted-4.5/.github/FUNDING.yml
--- old/mrouted-4.4/.github/FUNDING.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/mrouted-4.5/.github/FUNDING.yml 2023-06-04 17:06:04.000000000 +0200
@@ -0,0 +1,3 @@
+# These are supported funding model platforms
+
+github: [troglobit]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/.github/workflows/build.yml 
new/mrouted-4.5/.github/workflows/build.yml
--- old/mrouted-4.4/.github/workflows/build.yml 2021-11-03 11:55:17.000000000 
+0100
+++ new/mrouted-4.5/.github/workflows/build.yml 2023-06-04 17:06:04.000000000 
+0200
@@ -29,7 +29,7 @@
           sudo modprobe ipip
           sudo apt-get -y update
           sudo apt-get -y install pkg-config libsystemd-dev bird2 ethtool 
keepalived tshark tree
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Configure
         # Build in a sub-directory so we can safely set a+w on all
         # directories.  Needed for `make check` since it runs with
@@ -58,7 +58,7 @@
         run: |
           make check || (cat test/test-suite.log; false)
       - name: Upload Test Results
-        uses: actions/upload-artifact@v2
+        uses: actions/upload-artifact@v3
         with:
           name: mrouted-test-${{ matrix.compiler }}
           path: test/*
@@ -68,7 +68,7 @@
     runs-on: ubuntu-latest
     container: debian:stable
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Installing dependencies
         run: |
           apt-get update
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/.github/workflows/container.yml 
new/mrouted-4.5/.github/workflows/container.yml
--- old/mrouted-4.4/.github/workflows/container.yml     2021-11-03 
11:55:17.000000000 +0100
+++ new/mrouted-4.5/.github/workflows/container.yml     2023-06-04 
17:06:04.000000000 +0200
@@ -17,7 +17,7 @@
       MAKEFLAGS: -j3
       IMAGE_NAME: mrouted
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Build image
         run: docker build . --file Dockerfile --tag $IMAGE_NAME --label 
"runnumber=${GITHUB_RUN_ID}"
       - name: Log in to registry
@@ -28,7 +28,7 @@
           # Change all uppercase to lowercase
           IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
           # Strip git ref prefix from version
-          VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
+          VERSION=$(echo "${{ github.ref_name }}" | sed -e 's,.*/\(.*\),\1,')
           # Use Docker `latest` tag convention
           [ "$VERSION" == "master" ] && VERSION=latest
           echo IMAGE_ID=$IMAGE_ID
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/.github/workflows/coverity.yml 
new/mrouted-4.5/.github/workflows/coverity.yml
--- old/mrouted-4.4/.github/workflows/coverity.yml      2021-11-03 
11:55:17.000000000 +0100
+++ new/mrouted-4.5/.github/workflows/coverity.yml      2023-06-04 
17:06:04.000000000 +0200
@@ -15,7 +15,7 @@
   coverity:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Fetch latest Coverity Scan MD5
         id: var
         env:
@@ -24,10 +24,8 @@
           wget -q https://scan.coverity.com/download/cxx/linux64         \
                --post-data "token=$TOKEN&project=${COVERITY_PROJ}&md5=1" \
                -O coverity-latest.tar.gz.md5
-          export MD5=$(cat coverity-latest.tar.gz.md5)
-          echo "Got MD5 $MD5"
-          echo ::set-output name=md5::${MD5}
-      - uses: actions/cache@v2
+          echo "md5=$(cat coverity-latest.tar.gz.md5)" | tee -a $GITHUB_OUTPUT
+      - uses: actions/cache@v3
         id: cache
         with:
           path: coverity-latest.tar.gz
@@ -76,7 +74,7 @@
             --form description="${PROJECT_NAME} $(git rev-parse HEAD)" \
             https://scan.coverity.com/builds?project=${COVERITY_PROJ}
       - name: Upload build.log
-        uses: actions/upload-artifact@v2
+        uses: actions/upload-artifact@v3
         with:
           name: coverity-build.log
           path: cov-int/build-log.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/.github/workflows/release.yml 
new/mrouted-4.5/.github/workflows/release.yml
--- old/mrouted-4.4/.github/workflows/release.yml       2021-11-03 
11:55:17.000000000 +0100
+++ new/mrouted-4.5/.github/workflows/release.yml       2023-06-04 
17:06:04.000000000 +0200
@@ -7,38 +7,11 @@
 
 jobs:
   release:
-    name: Create GitHub release
-    runs-on: ubuntu-latest
-    if: startsWith(github.ref, 'refs/tags/')
-    outputs:
-      upload_url: ${{ steps.create_release.outputs.upload_url }}
-      release_id: ${{ steps.create_release.outputs.id }}
-    steps:
-      - uses: actions/checkout@v2
-      - name: Extract ChangeLog entry ...
-        # Hack to extract latest entry for body_path below
-        run: |
-          awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
-              |head -n -1 > release.md
-          cat release.md
-      - name: Create release ...
-        id: create_release
-        uses: actions/create-release@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          tag_name: ${{ github.ref }}
-          release_name: mrouted v${{ github.ref }}
-          body_path: release.md
-          draft: false
-          prerelease: false
-  tarball:
     name: Build and upload release tarball
-    needs: release
     if: startsWith(github.ref, 'refs/tags/')
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Installing dependencies ...
         run: |
           sudo apt-get -y update
@@ -46,17 +19,20 @@
       - name: Creating Makefiles ...
         run: |
           ./autogen.sh
-          ./configure --prefix=
+          ./configure
       - name: Build release ...
         run: |
           make release
           ls -lF ../
           mkdir -p artifacts/
           mv ../*.tar.* artifacts/
-      - name: Upload release artifacts ...
-        uses: skx/github-action-publish-binaries@release-0.15
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+      - name: Extract ChangeLog entry ...
+        run: |
+          awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
+              |head -n -1 > release.md
+          cat release.md
+      - uses: ncipollo/release-action@v1
         with:
-          releaseId: ${{ needs.release.outputs.release_id }}
-          args: artifacts/*
+          name: mrouted v${{ github.ref_name }}
+          bodyFile: "release.md"
+          artifacts: "artifacts/*"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/ChangeLog.md new/mrouted-4.5/ChangeLog.md
--- old/mrouted-4.4/ChangeLog.md        2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/ChangeLog.md        2023-06-04 17:06:04.000000000 +0200
@@ -3,6 +3,25 @@
 
 All notable changes to the project are documented in this file.
 
+[v4.5][] - 2023-06-04
+---------------------
+
+### Fixes
+- Ignore IGMP proxy querys (src ip: 0.0.0.0), they must never win a
+  querier election.
+- Fix compat read location and new location for `mrouted.genid`
+- Fix "non-decreasing" generation id, must increment on each restart
+
+### Changes
+- Add support for configurable IGMP query response interval
+- Add support for configurable IGMP querier timeout
+- New `join-group <group>` phyint option for cases where an IGMP
+  snooping switch blocks flooding of multicast to the port where
+  mrouted is connected
+- On startup and reconf, log why we skip disabled interfaces
+- Change to always log when assuming the IGMP querier role
+
+
 [v4.4][] - 2021-11-03
 ---------------------
 
@@ -650,7 +669,8 @@
 - Multicast traceroute could send a reply on a disabled interface.
 
 
-[UNRELEASED]: https://github.com/troglobit/mrouted/compare/4.4...HEAD
+[UNRELEASED]: https://github.com/troglobit/mrouted/compare/4.5...HEAD
+[v4.5]:       https://github.com/troglobit/mrouted/compare/4.4...4.5
 [v4.4]:       https://github.com/troglobit/mrouted/compare/4.3...4.4
 [v4.3]:       https://github.com/troglobit/mrouted/compare/4.2...4.3
 [v4.2]:       https://github.com/troglobit/mrouted/compare/4.1...4.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/configure.ac new/mrouted-4.5/configure.ac
--- old/mrouted-4.4/configure.ac        2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/configure.ac        2023-06-04 17:06:04.000000000 +0200
@@ -1,12 +1,12 @@
-AC_PREREQ(2.61)
-AC_INIT([mrouted], [4.4], [https://github.com/troglobit/mrouted/issues],,
+AC_PREREQ([2.61])
+AC_INIT([mrouted], [4.5], [https://github.com/troglobit/mrouted/issues],,
                [https://troglobit.com/projects/mrouted/])
 AC_CONFIG_AUX_DIR(aux)
 AM_INIT_AUTOMAKE([1.11 foreign])
 AM_SILENT_RULES([yes])
 
 AC_CONFIG_SRCDIR([src/main.c])
-AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile man/Makefile src/Makefile test/Makefile 
mrouted.service])
 
 # Check for standard programs, headers, and functions
@@ -18,7 +18,6 @@
 PKG_PROG_PKG_CONFIG
 
 # Check for linux/netlink.h is only to be able to define LINUX below
-AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h ifaddrs.h sys/ioctl.h sys/time.h linux/netlink.h 
termios.h])
 AC_CHECK_HEADERS([net/if.h netinet/igmp.h], [], [], [
 #include <stdio.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/debian/changelog 
new/mrouted-4.5/debian/changelog
--- old/mrouted-4.4/debian/changelog    2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/debian/changelog    2023-06-04 17:06:04.000000000 +0200
@@ -1,3 +1,19 @@
+mrouted (4.5) stable; urgency=low
+
+  * Ignore IGMP proxy querys (src ip: 0.0.0.0), they must never win
+    a querier election.
+  * Add support for configurable IGMP query response interval
+  * Add support for configurable IGMP querier timeout
+  * ADd support for explicit group memberships, using a new
+    phyint keyword 'join-group <GROUP>'.  Forces an IGMPv2 join
+    on the given interface.  Never expires
+  * On startup and reconf, log why we skip disabled interfaces
+  * Change to always log when assuming the IGMP querier role
+  * Fix compat read location and new location for `mrouted.genid`
+  * Fix "non-decreasing" generation id, must increment on each restart
+
+ -- Joachim Wiberg <troglo...@gmail.com>  Sun, 04 Jun 2023 17:05:48 +0200
+
 mrouted (4.4) stable; urgency=low
 
   * Issue #52: fix IPIP tunnels, both configuration and an off-by-one
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/man/mrouted.conf.5 
new/mrouted-4.5/man/mrouted.conf.5
--- old/mrouted-4.4/man/mrouted.conf.5  2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/man/mrouted.conf.5  2023-06-04 17:06:04.000000000 +0200
@@ -100,10 +100,37 @@
 .Nm mrouted
 always calculates the IP payload offset based on the IP header length
 value of ingressing DVMRP and IGMP frames.
+.It Cm router-timeout Ar <1-1024>
+Known in the RFC as Other Querier Present Interval, controls the timer
+used to detect when an elected IGMP querier stops sending queries.  When
+the timer expires,
+.Nm mrouted
+will assume the role as querier.  The default is calculated based on the
+.Cm igmp-robustness
+value, see below.  Setting this to any value overrides the RFC
+algorithm, which may be necessary in some scenarios.
+.Pp
+.Sy Note:
+it is strongly recommended to leave this setting commented out.  Use the
+.Cm igmp-robustness
+setting to tweak behavior instead.
 .It Cm igmp-query-interval Ar <1-1024>
 This setting controls the IGMP query interval in seconds, used when this
-router is elected querier on a LAN.  It is not recommended to go below
-10 sec.  Default: 125.
+router is elected querier on a LAN.  The query interval on all eligable
+IGMP queriers on a LAN must be the same.  Default: 125.
+.Pp
+.Sy Note:
+this value must be greater than the
+.Cm igmp-query-response-interval .
+.It Cm igmp-query-response-interval Ar <1-1024>
+Controls the Max Resp Code in IGMP queries, which encodes the maximum
+time allowed before responding to a query.  Can be used to control the
+burstiness of IGMP/MLD traffic, a lower value causes burstier traffic.
+Default 10 sec.
+.Pp
+.Sy Note:
+this value must always be less than the
+.Cm igmp-query-interval .
 .It Cm igmp-query-last-member-interval Ar <1-1024>
 This setting controls the maximum time in seconds between group specific
 IGMP queries.  These are sent as response to a host on a LAN requesting
@@ -114,23 +141,26 @@
 .Cm igmp-robustness
 (below), which controls how many group-specific queries are sent.
 .It Cm igmp-robustness Ar <2-10>
-This setting controls many aspects of IGMP timers, for end devices and
-routers alike.  The
-.Cm query-response-interval
-used below is hard-coded to 10 sec in
-.Nm mrouted :
+The robustness setting controls many aspects of IGMP timers, for end
+devices and routers alike.  Default 2.
 .Pp
 .Bl -tag -indent
 .It Group Membership Timeout
 Number of seconds before
 .Nm mrouted
 determines that there are no more members of a group on a LAN.  Formula:
-(igmp-robustness x igmp-query-interval) + (1 x query-response-interval)
-.It Other Querier Timeout
+.Bd -literal -offset indent
+robustness x query-interval + query-response-interval
+.Ed
+.It Other Querier Present Interval
 Number of seconds before
 .Nm mrouted
-determines there is no longer an elected querier on the LAN.  Formula:
-(igmp-robustness x igmp-query-interval) + (0.5 x query-response-interval)
+determines there is no longer an elected querier on the LAN.  See also
+.Cm router-timeout .
+Formula:
+.Bd -literal -offset indent
+robustness x query-interval + query-response-interval / 2
+.Ed
 .It Last Member Query Count
 Number of group-specific queries sent before
 .Nm mrouted
@@ -154,9 +184,9 @@
 .Sy Note:
 Most UNIX kernels, including Linux, have a hard coded limit of 32 VIFs.
 In non-trivial setups this limit is often reached, causing weird errors
-that can be hard to debug.  The recommendation for those cases is to
-disable all phyint (this setting), and then selectively enable only the
-ones needed.
+that can be difficuly to debug.  The recommendation for those cases is
+to disable all phyint (this setting), and then selectively enable only
+the ones needed.
 .It Cm phyint Ar <local-addr | ifname> Oo Cm disable | enable Oc Oo Cm passive 
Oc Oo Cm blaster Oc Oo Cm force-leaf Oc Oo Cm noflood Oc Oo Cm igmpv1 | igmpv2 
| igmpv3 Oc Oo Cm static-group Ar group Oc Oo Cm altnet Ar network Ns / Ns Ar 
mask-len Oc Oo Cm boundary Ar boundary-name | scoped-addr Ns / Ns Ar mask-len 
Oc Oo Cm metric Ar <1-31> Oc Oo Cm advert-metric Ar <0-31> Oc Oo Cm 
prune-lifetime Ar sec Oc Oo Cm rexmit-prunes Oo Ar on | off Oc Oc Oo Cm 
allow-nonpruners Oc Oo Cm notransit Oc Oo Cm accept|deny Po Ar route Ns / Ns Ar 
mask-len Oo Cm exact Oc Pc Ns + Oo Cm bidir Oc Oc Oo Cm rate-limit Ar kbps Oc 
Oo Cm threshold Ar ttl Oc
 .Pp
 This setting selects and alters properties of the physical interfaces
@@ -185,12 +215,14 @@
 modes on the given interface.  Default:
 .Cm igmpv3
 .It Cm static-group Ar group
-Useful when there is no IGMP capable hosts on the LAN, or when a group
-should always be routed.  It behaves as if an IGMPv2 join for
+This setting makes
+.Nm mrouted
+behave as if an IGMPv2 join for
 .Ar group
 was received on the
 .Cm phyint .
-It is listed as
+Useful when there is no IGMP capable hosts on the LAN, or when a group
+should always be routed.  The group is listed as
 .Cm static
 in the
 .Nm mroutectl
@@ -203,8 +235,22 @@
 With the added exception for better handling of dynamic changes to the
 input interface.
 .Pp
-This is also very useful for testing routing without having the set up
-IGMP capable receivers.
+This can also be used for testing routing without having to set up IGMP
+capable receivers.
+.It Cm join-group Ar group
+This setting makes
+.Nm mrouted
+join the desired
+.Ar group
+on the
+.Cm phyint
+connected to the LAN which is source of the multicast to be forwarded.
+Useful when there are switches with IGMP snooping that do not detect
+.Nm mrouted
+as a multicast router, and thus prevent flooding multicast on the
+corresponding port.  Most managed switches support configuring a
+static multicast router port, but sometimes that is not available,
+or access to the switch is restricted.
 .It Cm altnet Ar network Ns / Ns Ar mask-len
 If an interface is attached to multiple IP subnets, describe each
 additional subnet with this keyword.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/mrouted.conf new/mrouted-4.5/mrouted.conf
--- old/mrouted-4.4/mrouted.conf        2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/mrouted.conf        2023-06-04 17:06:04.000000000 +0200
@@ -37,7 +37,7 @@
 #                         [metric <M>] [threshold <TTL>] [rate-limit <BPS>]
 #                         [boundary (<BOUNDNAME>|<SCOPED-ADDR>/<LEN>)]
 #                        [altnet (<SUBNET>/<LEN>|<SUBNET>)]
-#                        [static-group <GROUP>]
+#                        [static-group <GROUP>] [join-group <GROUP>]
 #
 # Example of use of named boundary
 #phyint le1 boundary EE                # le1 is our interface to comp sci,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/mrouted.service.in 
new/mrouted-4.5/mrouted.service.in
--- old/mrouted-4.4/mrouted.service.in  2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/mrouted.service.in  2023-06-04 17:06:04.000000000 +0200
@@ -12,7 +12,8 @@
 [Service]
 Type=simple
 ExecStartPre=-/sbin/modprobe ipip
-ExecStart=@SBINDIR@/mrouted -ns
+EnvironmentFile=-@SYSCONFDIR@/default/mrouted
+ExecStart=@SBINDIR@/mrouted --foreground --syslog $MROUTED_OPTS $MROUTED_ARGS
 
 [Install]
 WantedBy=multi-user.target
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/cfparse.y 
new/mrouted-4.5/src/cfparse.y
--- old/mrouted-4.4/src/cfparse.y       2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/cfparse.y       2023-06-04 17:06:04.000000000 +0200
@@ -62,13 +62,13 @@
 };
 
 %token CACHE_LIFETIME PRUNE_LIFETIME PRUNING BLACK_HOLE NOFLOOD
-%token QUERY_INTERVAL QUERY_LAST_MEMBER_INTERVAL IGMP_ROBUSTNESS
+%token QUERY_INTERVAL QUERY_LAST_MEMBER_INTERVAL QUERY_RESPONSE_INTERVAL 
IGMP_ROBUSTNESS
 %token NO PHYINT TUNNEL NAME
-%token DISABLE ENABLE IGMPV1 IGMPV2 IGMPV3 STATIC_GROUP SRCRT BESIDE
+%token DISABLE ENABLE IGMPV1 IGMPV2 IGMPV3 STATIC_GROUP JOIN_GROUP SRCRT BESIDE
 %token METRIC THRESHOLD RATE_LIMIT BOUNDARY NETMASK ALTNET ADVERT_METRIC
 %token FILTER ACCEPT DENY EXACT BIDIR REXMIT_PRUNES REXMIT_PRUNES2
 %token PASSIVE ALLOW_NONPRUNERS
-%token NOTRANSIT BLASTER FORCE_LEAF ROUTER_ALERT
+%token NOTRANSIT BLASTER FORCE_LEAF ROUTER_ALERT ROUTER_TIMEOUT
 %token PRUNE_LIFETIME2 NOFLOOD2
 %token SYSNAM SYSCONTACT SYSVERSION SYSLOCATION
 %token <num> BOOLEAN
@@ -170,6 +170,12 @@
        {
            router_alert = $2;
        }
+       | ROUTER_TIMEOUT NUMBER
+       {
+           if ($2 < 1 || $2 > 1024)
+               fatal("Invalid multicast router timeout [1,1024]: %d", $2);
+           router_timeout = $2;
+       }
        | BLACK_HOLE
        {
 #ifdef ALLOW_BLACK_HOLES
@@ -240,6 +246,12 @@
                fatal("Invalid IGMP query interval [1,1024]: %d", $2);
            igmp_query_interval = $2;
        }
+       | QUERY_RESPONSE_INTERVAL NUMBER
+       {
+           if ($2 < 1 || $2 > 1024)
+               fatal("Invalid IGMP query response interval [1,1024]: %d", $2);
+           igmp_response_interval = $2;
+       }
        | QUERY_LAST_MEMBER_INTERVAL NUMBER
        {
            if ($2 < 1 || $2 > 1024)
@@ -303,6 +315,23 @@
 
            TAILQ_INSERT_TAIL(&v->uv_static, a, al_link);
        }
+       | JOIN_GROUP GROUP
+       {
+           struct listaddr *a;
+
+           a = calloc(1, sizeof(struct listaddr));
+           if (!a) {
+               fatal("Failed allocating memory for 'struct listaddr'");
+               return 0;
+           }
+
+           a->al_addr  = $2;
+           a->al_pv    = 2;    /* IGMPv2 only, no SSM */
+           a->al_flags = NBRF_JOIN_GROUP;
+           time(&a->al_ctime);
+
+           TAILQ_INSERT_TAIL(&v->uv_join, a, al_link);
+       }
        | NETMASK addrname
        {
            uint32_t subnet, mask;
@@ -735,6 +764,7 @@
        { "prune_lifetime",     PRUNE_LIFETIME, PRUNE_LIFETIME2 },
        { "prune-lifetime",     PRUNE_LIFETIME, PRUNE_LIFETIME2 },
        { "igmp-query-interval", QUERY_INTERVAL, 0 },
+       { "igmp-query-reponse-interval", QUERY_RESPONSE_INTERVAL, 0 },
        { "igmp-query-last-member-interval", QUERY_LAST_MEMBER_INTERVAL, 0 },
        { "igmp-robustness",    IGMP_ROBUSTNESS, 0 },
        { "no",                 NO, 0 },
@@ -752,6 +782,7 @@
        { "force_leaf",         FORCE_LEAF, 0 },
        { "force-leaf",         FORCE_LEAF, 0 },
        { "router-alert",       ROUTER_ALERT, 0 },
+       { "router-timeout",     ROUTER_TIMEOUT, 0 },
        { "srcrt",              SRCRT, 0 },
        { "sourceroute",        SRCRT, 0 },
        { "boundary",           BOUNDARY, 0 },
@@ -760,6 +791,7 @@
        { "igmpv2",             IGMPV2, 0 },
        { "igmpv3",             IGMPV3, 0 },
        { "static-group",       STATIC_GROUP, 0 },
+       { "join-group",         JOIN_GROUP, 0 },
        { "altnet",             ALTNET, 0 },
        { "name",               NAME, 0 },
        { "accept",             ACCEPT, 0 },
@@ -862,6 +894,7 @@
 void config_vifs_from_file(void)
 {
     TAILQ_INIT(&scrap.uv_static);
+    TAILQ_INIT(&scrap.uv_join);
     TAILQ_INIT(&scrap.uv_groups);
     TAILQ_INIT(&scrap.uv_neighbors);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/defs.h new/mrouted-4.5/src/defs.h
--- old/mrouted-4.4/src/defs.h  2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/defs.h  2023-06-04 17:06:04.000000000 +0200
@@ -6,10 +6,12 @@
  * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
  * Leland Stanford Junior University.
  */
+
 #ifndef MROUTED_DEFS_H_
 #define MROUTED_DEFS_H_
 
-#include <config.h>
+#include "config.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -137,12 +139,14 @@
 extern uint8_t         *send_buf;
 extern int             igmp_socket;
 extern int             router_alert;
+extern uint32_t                router_timeout;
 extern uint32_t                allhosts_group;
 extern uint32_t                allrtrs_group;
 extern uint32_t                allreports_group;
 extern uint32_t                dvmrp_group;
 extern uint32_t                dvmrp_genid;
 extern uint32_t                igmp_query_interval;
+extern uint32_t                igmp_response_interval;
 extern uint32_t                igmp_last_member_interval;
 extern uint32_t                igmp_robustness;
 extern uint32_t                virtual_time;
@@ -261,7 +265,7 @@
 extern int             log_str2lvl(char *);
 extern const char *    log_lvl2str(int);
 extern int             log_list(char *, size_t);
-extern void            logit(int, int, const char *, ...);
+extern void            logit(int, int, const char *, ...) __attribute__ 
((format (printf, 3, 4)));
 extern void             resetlogging(void *);
 
 /* igmp.c */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/igmp.c new/mrouted-4.5/src/igmp.c
--- old/mrouted-4.4/src/igmp.c  2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/igmp.c  2023-06-04 17:06:04.000000000 +0200
@@ -25,7 +25,9 @@
 uint8_t                *send_buf;                   /* output packet buffer    
    */
 int            igmp_socket;                 /* socket for all network I/O  */
 int             router_alert;               /* IP option Router Alert      */
+uint32_t       router_timeout;              /* Other querier present intv. */
 uint32_t       igmp_query_interval;         /* Default: 125 sec            */
+uint32_t       igmp_response_interval;      /* Default: 10 sec             */
 uint32_t       igmp_last_member_interval;   /* Default: 1                  */
 uint32_t       igmp_robustness;             /* Default: 2                  */
 uint32_t       allhosts_group;              /* All hosts addr in net order */
@@ -96,9 +98,11 @@
     allreports_group = htonl(INADDR_ALLRPTS_GROUP);
 
     igmp_query_interval       = IGMP_QUERY_INTERVAL_DEFAULT;
+    igmp_response_interval    = IGMP_QUERY_RESPONSE_INTERVAL;
     igmp_last_member_interval = IGMP_LAST_MEMBER_INTERVAL_DEFAULT;
     igmp_robustness           = IGMP_ROBUSTNESS_DEFAULT;
     router_alert              = 1;
+    router_timeout            = IGMP_OTHER_QUERIER_PRESENT_INTERVAL;
 
 #ifdef REGISTER_HANDLER
     if (register_input_handler(igmp_socket, igmp_read) < 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/igmpv2.h new/mrouted-4.5/src/igmpv2.h
--- old/mrouted-4.4/src/igmpv2.h        2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/igmpv2.h        2023-06-04 17:06:04.000000000 +0200
@@ -17,12 +17,12 @@
 #define        IGMP_ROBUSTNESS_DEFAULT                 2
 #define        IGMP_QUERY_INTERVAL_DEFAULT             125
 #define        IGMP_QUERY_RESPONSE_INTERVAL            10
-#define        IGMP_GROUP_MEMBERSHIP_INTERVAL          (igmp_robustness * \
-                                       igmp_query_interval + \
-                                       IGMP_QUERY_RESPONSE_INTERVAL)
-#define        IGMP_OTHER_QUERIER_PRESENT_INTERVAL     (igmp_robustness * \
-                                       igmp_query_interval + \
-                                       IGMP_QUERY_RESPONSE_INTERVAL / 2)
+#define        IGMP_GROUP_MEMBERSHIP_INTERVAL          (igmp_robustness     * \
+                                                igmp_query_interval + \
+                                                igmp_response_interval)
+#define        IGMP_OTHER_QUERIER_PRESENT_INTERVAL     (igmp_robustness        
* \
+                                                igmp_query_interval    + \
+                                                igmp_response_interval / 2)
                                                /* Round to the nearest 
TIMER_INTERVAL */
 #define        IGMP_STARTUP_QUERY_INTERVAL             (((igmp_query_interval 
/ 4) \
                                                        / TIMER_INTERVAL) * 
TIMER_INTERVAL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/igmpv3.h new/mrouted-4.5/src/igmpv3.h
--- old/mrouted-4.4/src/igmpv3.h        2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/igmpv3.h        2023-06-04 17:06:04.000000000 +0200
@@ -28,8 +28,8 @@
  * SUCH DAMAGE.
  */
 
-#ifndef PIMD_IGMPV3_H_
-#define PIMD_IGMPV3_H_
+#ifndef MROUTED_IGMPV3_H_
+#define MROUTED_IGMPV3_H_
 
 /*
  * IGMPv3 report modes.
@@ -88,7 +88,7 @@
 #define IGMP_V3_REPORT_MAXRECS         65535
 #endif
 
-#endif /* PIMD_IGMPV3_H_ */
+#endif /* MROUTED_IGMPV3_H_ */
 
 /**
  * Local Variables:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/ipc.c new/mrouted-4.5/src/ipc.c
--- old/mrouted-4.4/src/ipc.c   2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/ipc.c   2023-06-04 17:06:04.000000000 +0200
@@ -484,7 +484,7 @@
                } else {
                        inet_fmt(uv->uv_querier->al_addr, s1, sizeof(s1));
                        snprintf(timeout, sizeof(timeout), "%5us",
-                                IGMP_OTHER_QUERIER_PRESENT_INTERVAL - 
uv->uv_querier->al_timer);
+                                router_timeout - uv->uv_querier->al_timer);
                }
 
                TAILQ_FOREACH(group, &uv->uv_groups, al_link)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/main.c new/mrouted-4.5/src/main.c
--- old/mrouted-4.4/src/main.c  2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/main.c  2023-06-04 17:06:04.000000000 +0200
@@ -126,24 +126,32 @@
 
 /*
  * _PATH_MROUTED_GENID is the configurable fallback and old default used
- * by mrouted, which does not comply with FHS.  We only read that, if it
+ * by mrouted, which does not comply with FHS.  We only read that if it
  * exists, otherwise we use the system _PATH_VARDB, which works on all
  * *BSD and GLIBC based Linux systems.  Some Linux systms don't have the
  * correct FHS /var/lib/misc for that define, so we check for that too.
  */
 static FILE *fopen_genid(char *mode)
 {
+    const char *path = _PATH_VARDB;
     char fn[80];
 
+    /* If old /var/lib/mrouted.genid exists, use that for compat. */
     snprintf(fn, sizeof(fn), _PATH_MROUTED_GENID, ident);
-    if (access(fn, R_OK | W_OK)) {
-       if (strcmp(ident, PACKAGE_NAME))
-           return NULL;
-
-       if (!access(_PATH_VARDB, W_OK))
-           snprintf(fn, sizeof(fn), "%s/mrouted.genid", _PATH_VARDB);
+    if (access(fn, F_OK)) {
+#ifdef __linux__
+       /*
+        * Workaround for Linux systems where _PATH_VARDB is /var/db but
+        * the rootfs doesn't have it.  Let's check for /var/lib/misc
+        */
+       if (access(path, W_OK))
+           path = PRESERVEDIR "/misc";
+#endif
+       if (!access(path, W_OK))
+           snprintf(fn, sizeof(fn), "%s/%s.genid", path, ident);
     }
 
+    /* If all fails we fall back to try _PATH_MROUTED_GENID */
     return fopen(fn, mode);
 }
 
@@ -168,8 +176,8 @@
        ret = fscanf(fp, "%u", &prev_genid);
        (void)fclose(fp);
 
-       if (ret == 1 && prev_genid == dvmrp_genid)
-           dvmrp_genid++;
+       if (ret == 1)
+           dvmrp_genid = prev_genid + 1;
        else
            dvmrp_genid = rand_genid();
     } else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/timer.c new/mrouted-4.5/src/timer.c
--- old/mrouted-4.4/src/timer.c 2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/timer.c 2023-06-04 17:06:04.000000000 +0200
@@ -127,7 +127,7 @@
        return 0;
     }
 
-    return ptr->time;
+    return (int)ptr->time;
 }
 
 /*
@@ -209,7 +209,7 @@
     TAILQ_FOREACH(ptr, &tl, link) {
        left += ptr->time;
        if (ptr->id == timer_id)
-           return left;
+           return (int)left;
     }
 
     return -1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/vif.c new/mrouted-4.5/src/vif.c
--- old/mrouted-4.4/src/vif.c   2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/vif.c   2023-06-04 17:06:04.000000000 +0200
@@ -100,8 +100,10 @@
     enabled_phyints = 0;
     phys_vif       = -1;
     UVIF_FOREACH(vifi, uv) {
-       if (uv->uv_flags & VIFF_DISABLED)
+       if (uv->uv_flags & VIFF_DISABLED) {
+           logit(LOG_INFO, 0, "%s is disabled; skipping", uv->uv_name);
            continue;
+       }
 
        ++enabled_vifs;
 
@@ -180,6 +182,7 @@
     uv->uv_subnetbcast = 0;
     uv->uv_name[0]     = '\0';
     TAILQ_INIT(&uv->uv_static);
+    TAILQ_INIT(&uv->uv_join);
     TAILQ_INIT(&uv->uv_groups);
     TAILQ_INIT(&uv->uv_neighbors);
     NBRM_CLRALL(uv->uv_nbrmap);
@@ -491,6 +494,21 @@
        k_join(allreports_group, src);
 
        /*
+        * Some switches with IGMP snooping enabled do not properly
+         * recognize mrouted as a dynamic multicast router port, so they
+         * will block traffic from the sender to the mrouted router.  In
+         * such a case, we might want to explicitely join a multicast
+         * group on this interface.
+        */
+       TAILQ_FOREACH(a, &uv->uv_join, al_link) {
+           uint32_t group = a->al_addr;
+
+           logit(LOG_INFO, 0, "Joining static group %s on %s from %s",
+                 inet_fmt(group, s1, sizeof(s1)), uv->uv_name, config_file);
+           k_join(group, src);
+       }
+
+       /*
         * Install an entry in the routing table for the subnet to which
         * the interface is connected.
         */
@@ -507,10 +525,8 @@
         * query.
         */
        uv->uv_flags |= VIFF_QUERIER;
-       IF_DEBUG(DEBUG_IGMP) {
-           logit(LOG_DEBUG, 0, "Assuming querier duties on vif %u", vifi);
-       }
-       send_query(uv, allhosts_group, IGMP_QUERY_RESPONSE_INTERVAL * 
IGMP_TIMER_SCALE, 0);
+       logit(LOG_INFO, 0, "Assuming querier duties on %s", uv->uv_name);
+       send_query(uv, allhosts_group, igmp_response_interval * 
IGMP_TIMER_SCALE, 0);
     }
 
     uv->uv_leaf_timer = LEAF_CONFIRMATION_TIME;
@@ -620,6 +636,16 @@
        }
        uv->uv_querier = NULL;
 
+       TAILQ_FOREACH_SAFE(a, &uv->uv_join, al_link, tmp) {
+           uint32_t group = a->al_addr;
+
+           logit(LOG_INFO, 0, "Leaving static group %s on %s from %s",
+                 inet_fmt(group, s1, sizeof(s1)), uv->uv_name, config_file);
+           k_leave(group, uv->uv_lcl_addr);
+           TAILQ_REMOVE(&uv->uv_join, a, al_link);
+           free(a);
+       }
+
        TAILQ_FOREACH_SAFE(a, &uv->uv_groups, al_link, tmp) {
            TAILQ_REMOVE(&uv->uv_groups, a, al_link);
            free(a);
@@ -737,8 +763,7 @@
            continue;
 
        if (uv->uv_flags & VIFF_QUERIER)
-           send_query(uv, allhosts_group, IGMP_QUERY_RESPONSE_INTERVAL *
-                      IGMP_TIMER_SCALE, 0);
+           send_query(uv, allhosts_group, igmp_response_interval * 
IGMP_TIMER_SCALE, 0);
     }
 }
 
@@ -799,14 +824,22 @@
     }
 
     if (uv->uv_querier == NULL || uv->uv_querier->al_addr != src) {
+       uint32_t cur = uv->uv_querier ? uv->uv_querier->al_addr : 
uv->uv_lcl_addr;
+
        /*
         * This might be:
         * - A query from a new querier, with a lower source address
         *   than the current querier (who might be me)
         * - A query from a new router that just started up and doesn't
         *   know who the querier is.
+        * - A proxy query (source address 0.0.0.0), never wins elections
         */
-       if (ntohl(src) < (uv->uv_querier ? ntohl(uv->uv_querier->al_addr) : 
ntohl(uv->uv_lcl_addr))) {
+       if (!ntohl(src)) {
+           logit(LOG_DEBUG, 0, "Ignoring proxy query on %s", uv->uv_name);
+           return;
+       }
+
+       if (ntohl(src) < ntohl(cur)) {
            IF_DEBUG(DEBUG_IGMP) {
                logit(LOG_DEBUG, 0, "New querier %s (was %s) on vif %u", 
inet_fmt(src, s1, sizeof(s1)),
                      uv->uv_querier ? inet_fmt(uv->uv_querier->al_addr, s2, 
sizeof(s2)) : "me", vifi);
@@ -1936,20 +1969,17 @@
 
        if (uv->uv_querier) {
            uv->uv_querier->al_timer += TIMER_INTERVAL;
-           if (uv->uv_querier->al_timer > IGMP_OTHER_QUERIER_PRESENT_INTERVAL) 
{
+           if (uv->uv_querier->al_timer > router_timeout) {
                /*
                 * The current querier has timed out.  We must become the
                 * querier.
                 */
-               IF_DEBUG(DEBUG_IGMP) {
-                   logit(LOG_DEBUG, 0, "Querier %s timed out",
-                         inet_fmt(uv->uv_querier->al_addr, s1, sizeof(s1)));
-               }
+               logit(LOG_INFO, 0, "Querier %s timed out, assuming role on %s",
+                     inet_fmt(uv->uv_querier->al_addr, s1, sizeof(s1)), 
uv->uv_name);
                free(uv->uv_querier);
                uv->uv_querier = NULL;
                uv->uv_flags |= VIFF_QUERIER;
-               send_query(uv, allhosts_group, IGMP_QUERY_RESPONSE_INTERVAL *
-                          IGMP_TIMER_SCALE, 0);
+               send_query(uv, allhosts_group, igmp_response_interval * 
IGMP_TIMER_SCALE, 0);
            }
        }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mrouted-4.4/src/vif.h new/mrouted-4.5/src/vif.h
--- old/mrouted-4.4/src/vif.h   2021-11-03 11:55:17.000000000 +0100
+++ new/mrouted-4.5/src/vif.h   2023-06-04 17:06:04.000000000 +0200
@@ -119,6 +119,7 @@
     uint32_t        uv_subnetbcast;    /* subnet broadcast addr (phyints)   */
     char            uv_name[IFNAMSIZ]; /* interface name                    */
     TAILQ_HEAD(,listaddr) uv_static;    /* list of static groups (phyints)   */
+    TAILQ_HEAD(,listaddr) uv_join;      /* list of joined groups (phyints)   */
     TAILQ_HEAD(,listaddr) uv_groups;    /* list of local groups  (phyints)   */
     TAILQ_HEAD(,listaddr) uv_neighbors;        /* list of neighboring routers  
     */
     nbrbitmap_t             uv_nbrmap;         /* bitmap of active neigh. 
routers   */
@@ -237,6 +238,7 @@
 #define        NBRF_TOOMANYROUTES      0x1000  /* Neighbor is spouting routes  
    */
 #define        NBRF_NOTPRUNING         0x2000  /* Neighbor doesn't appear to 
prune */
 #define        NBRF_STATIC_GROUP       0x4000  /* Static group entry           
    */
+#define        NBRF_JOIN_GROUP         0x8000  /* Join group entry             
    */
 
 /*
  * Don't peer with neighbors with any of these flags set

Reply via email to