salsa.debian.org/debian / smcroute

New upstream version 2.5.4

Micha Lenk · 4 years ago 🏷 upstream/2.5.4commit dd4057e · parent 4ca5585 · child 5f79b3d · patch
diff --git a/ChangeLog.md b/ChangeLog.md
index 6ea4fea..168b0cc 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -4,6 +4,20 @@ ChangeLog
 All notable changes to the project are documented in this file.
 
 
+[v2.5.4][] - 2021-11-13
+-----------------------
+
+### Changes
+- Automatically extract new version from GIT tag
+
+### Fixes
+- Avoid trying to delete inactive VIFs.  Fixing an annoying bogus error:
+  *"Failed deleting VIF for iface lo: Resource temporarily unavailable"*
+- Fix #171: too small string buffer for IPv6 address causing garbled
+  output in periodic expiry callback
+- Fix too small buffer for IPv6 address in mroute display functions
+
+
 [v2.5.3][] - 2021-09-23
 -----------------------
 
@@ -590,7 +604,8 @@ Initial public release by Carsten Schill.
 
 [mrdisc]:     https://github.com/troglobit/mrdisc
 [RFC4286]:    https://tools.ietf.org/html/rfc4286
-[UNRELEASED]: https://github.com/troglobit/smcroute/compare/2.5.3...HEAD
+[UNRELEASED]: https://github.com/troglobit/smcroute/compare/2.5.4...HEAD
+[v2.5.4]:     https://github.com/troglobit/smcroute/compare/2.5.3...2.5.4
 [v2.5.3]:     https://github.com/troglobit/smcroute/compare/2.5.2...2.5.3
 [v2.5.2]:     https://github.com/troglobit/smcroute/compare/2.5.1...2.5.2
 [v2.5.1]:     https://github.com/troglobit/smcroute/compare/2.5.0...2.5.1
diff --git a/Makefile.am b/Makefile.am
index 7bdf164..fdfb82a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,11 @@
 ## SMCRoute - A static multicast routing tool             -*-Makefile-*-
 ACLOCAL_AMFLAGS         = -I m4
-SUBDIRS                 = man src
+TAG                     = $(top_srcdir)/.git/refs/tags/$(PACKAGE_VERSION)
 DISTCLEANFILES		= *~ DEADJOE semantic.cache *.gdb *.elf core core.* *.d
 dist_sbin_SCRIPTS       = smcroute
 doc_DATA		= README.md COPYING smcroute.conf
 EXTRA_DIST		= README.md ChangeLog.md autogen.sh smcroute.conf smcroute.default smcroute.init
+SUBDIRS                 = man src
 
 if ENABLE_TEST
 SUBDIRS                += test
@@ -15,25 +16,12 @@ systemd_DATA            = smcroute.service
 endif
 
 ## Check if tagged in git
-release-hook:
-	@if [ ! `git tag -l $(PACKAGE_VERSION) | grep $(PACKAGE_VERSION)` ]; then	\
-		echo;									\
-		printf "\e[1m\e[41mCannot find release tag $(PACKAGE_VERSION)\e[0m\n";	\
-		printf "\e[1m\e[5mDo release anyway?\e[0m "; read yorn;			\
-		if [ "$$yorn" != "y" -a "$$yorn" != "Y" ]; then				\
-			printf "OK, aborting release.\n";				\
-			exit 1;								\
-		fi;									\
-		echo;									\
-	else										\
-		echo;									\
-		printf "\e[1m\e[42mFound GIT release tag $(PACKAGE_VERSION)\e[0m\n";	\
-		printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n";			\
-		echo;									\
-	fi
+$(TAG):
+	@printf "\e[1m\e[41mPlease create the \"$(PACKAGE_VERSION)\" tag first\e[0m\n"
+	@exit 1
 
 ## Target to run when building a release
-release: release-hook distcheck
+release: $(TAG) distcheck
 	@for file in $(DIST_ARCHIVES); do		\
 		md5sum    $$file > ../$$file.md5;	\
 		sha256sum $$file > ../$$file.sha256;	\
diff --git a/Makefile.in b/Makefile.in
index 9ad0b16..0dad156 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -337,11 +337,12 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = man src $(am__append_1)
+TAG = $(top_srcdir)/.git/refs/tags/$(PACKAGE_VERSION)
 DISTCLEANFILES = *~ DEADJOE semantic.cache *.gdb *.elf core core.* *.d
 dist_sbin_SCRIPTS = smcroute
 doc_DATA = README.md COPYING smcroute.conf
 EXTRA_DIST = README.md ChangeLog.md autogen.sh smcroute.conf smcroute.default smcroute.init
+SUBDIRS = man src $(am__append_1)
 @HAVE_SYSTEMD_TRUE@systemd_DATA = smcroute.service
 
 # Workaround for systemd unit file duing distcheck
@@ -907,24 +908,11 @@ uninstall-am: uninstall-dist_sbinSCRIPTS uninstall-docDATA \
 .PRECIOUS: Makefile
 
 
-release-hook:
-	@if [ ! `git tag -l $(PACKAGE_VERSION) | grep $(PACKAGE_VERSION)` ]; then	\
-		echo;									\
-		printf "\e[1m\e[41mCannot find release tag $(PACKAGE_VERSION)\e[0m\n";	\
-		printf "\e[1m\e[5mDo release anyway?\e[0m "; read yorn;			\
-		if [ "$$yorn" != "y" -a "$$yorn" != "Y" ]; then				\
-			printf "OK, aborting release.\n";				\
-			exit 1;								\
-		fi;									\
-		echo;									\
-	else										\
-		echo;									\
-		printf "\e[1m\e[42mFound GIT release tag $(PACKAGE_VERSION)\e[0m\n";	\
-		printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n";			\
-		echo;									\
-	fi
+$(TAG):
+	@printf "\e[1m\e[41mPlease create the \"$(PACKAGE_VERSION)\" tag first\e[0m\n"
+	@exit 1
 
-release: release-hook distcheck
+release: $(TAG) distcheck
 	@for file in $(DIST_ARCHIVES); do		\
 		md5sum    $$file > ../$$file.md5;	\
 		sha256sum $$file > ../$$file.sha256;	\
diff --git a/configure b/configure
index e2b3220..0e5fe85 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for SMCRoute 2.5.3.
+# Generated by GNU Autoconf 2.69 for SMCRoute 2.5.4.
 #
 # Report bugs to <https://github.com/troglobit/smcroute/issues>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='SMCRoute'
 PACKAGE_TARNAME='smcroute'
-PACKAGE_VERSION='2.5.3'
-PACKAGE_STRING='SMCRoute 2.5.3'
+PACKAGE_VERSION='2.5.4'
+PACKAGE_STRING='SMCRoute 2.5.4'
 PACKAGE_BUGREPORT='https://github.com/troglobit/smcroute/issues'
 PACKAGE_URL='https://troglobit.com/smcroute.html'
 
@@ -1310,7 +1310,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures SMCRoute 2.5.3 to adapt to many kinds of systems.
+\`configure' configures SMCRoute 2.5.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1377,7 +1377,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of SMCRoute 2.5.3:";;
+     short | recursive ) echo "Configuration of SMCRoute 2.5.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1487,7 +1487,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-SMCRoute configure 2.5.3
+SMCRoute configure 2.5.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2021,7 +2021,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by SMCRoute $as_me 2.5.3, which was
+It was created by SMCRoute $as_me 2.5.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2884,7 +2884,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='smcroute'
- VERSION='2.5.3'
+ VERSION='2.5.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6815,7 +6815,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by SMCRoute $as_me 2.5.3, which was
+This file was extended by SMCRoute $as_me 2.5.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6882,7 +6882,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-SMCRoute config.status 2.5.3
+SMCRoute config.status 2.5.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 8c91d1b..a2b12f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,9 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT(SMCRoute, 2.5.3, https://github.com/troglobit/smcroute/issues, smcroute, https://troglobit.com/smcroute.html)
+AC_INIT(SMCRoute, m4_esyscmd_s(git describe --always --dirty --tags),
+	https://github.com/troglobit/smcroute/issues, smcroute,
+	https://troglobit.com/smcroute.html)
 AC_CONFIG_AUX_DIR(aux)
 AM_INIT_AUTOMAKE([1.11 foreign])
 AM_SILENT_RULES([yes])
diff --git a/src/Makefile.in b/src/Makefile.in
index d93af25..db5c240 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -411,9 +411,9 @@ clean-sbinPROGRAMS:
 	@$(MKDIR_P) ../lib/
 	@: > ../lib/$(am__dirstamp)
 ../lib/tempfile.$(OBJEXT): ../lib/$(am__dirstamp)
-../lib/utimensat.$(OBJEXT): ../lib/$(am__dirstamp)
 ../lib/strlcat.$(OBJEXT): ../lib/$(am__dirstamp)
 ../lib/strlcpy.$(OBJEXT): ../lib/$(am__dirstamp)
+../lib/utimensat.$(OBJEXT): ../lib/$(am__dirstamp)
 
 smcroutectl$(EXEEXT): $(smcroutectl_OBJECTS) $(smcroutectl_DEPENDENCIES) $(EXTRA_smcroutectl_DEPENDENCIES) 
 	@rm -f smcroutectl$(EXEEXT)
diff --git a/src/mroute.c b/src/mroute.c
index 291e9c4..9893692 100644
--- a/src/mroute.c
+++ b/src/mroute.c
@@ -298,6 +298,9 @@ static int mroute4_del_vif(struct iface *iface)
 	if (iface->mrdisc)
 		rc = mrdisc_deregister(iface->vif);
 
+	if (iface->vif == ALL_VIFS)
+		return 0;
+
 	if (kern_vif_del(iface)) {
 		switch (errno) {
 		case ENOENT:
@@ -446,7 +449,7 @@ void mroute_expire(int max_idle)
 	clock_gettime(CLOCK_MONOTONIC, &now);
 
 	TAILQ_FOREACH_SAFE(entry, &kern_list, link, tmp) {
-		char origin[INET_ADDRSTRLEN], group[INET_ADDRSTRLEN];
+		char origin[INET_ADDRSTR_LEN], group[INET_ADDRSTR_LEN];
 		struct iface *iface;
 
 		/* XXX: only consider (*,G) routes, not pure (S,G), and no overlap handling for now */
@@ -910,6 +913,9 @@ static int mroute6_del_mif(struct iface *iface)
 {
 	int rc = 0;
 
+	if (iface->mif == ALL_VIFS)
+		return 0;
+
 	if (kern_mif_del(iface) && errno != ENOENT) {
 		switch (errno) {
 		case ENOENT:
@@ -1095,11 +1101,11 @@ void mroute_reload_end(int do_vifs)
 
 static int show_mroute(int sd, struct mroute *r, int inw, int detail)
 {
-	char src[INET_ADDRSTRLEN] = "*";
+	char src[INET_ADDRSTR_LEN] = "*";
 	char src_len[5] = "";
-	char grp[INET_ADDRSTRLEN];
+	char grp[INET_ADDRSTR_LEN];
 	char grp_len[5] = "";
-	char sg[(INET_ADDRSTRLEN + 3) * 2 + 5];
+	char sg[(INET_ADDRSTR_LEN + 3) * 2 + 5];
 	char buf[MAX_MC_VIFS * 17 + 80];
 	struct iface *iface;
 	int max_len;
diff --git a/test/ipv6.sh b/test/ipv6.sh
index 1f5ef6b..6e298c9 100755
--- a/test/ipv6.sh
+++ b/test/ipv6.sh
@@ -13,6 +13,7 @@ topo basic
 ip addr add 2001:1::1/64 dev a1
 ip addr add   fc00::1/64 dev a1
 ip addr add 2001:2::1/64 dev a2
+ip addr add 2001:2:3:4:6:7:12:1/64 dev a2
 ip -br a
 
 print "Creating config ..."
@@ -26,11 +27,13 @@ mroute from a1 source fc00::1 group ff04:0:0:0:0:0:0:114 to a2
 
 mgroup from a1 group ff2e::42
 mroute from a1 group ff2e::42 to a2
+
+mroute from a1 group ff2e::7 to a2
 EOF
 cat "/tmp/$NM/conf"
 
 print "Starting smcrouted ..."
-../src/smcrouted -f "/tmp/$NM/conf" -n -N -P "/tmp/$NM/pid" -l debug -u "/tmp/$NM/sock" &
+../src/smcrouted -c 5 -f "/tmp/$NM/conf" -n -N -P "/tmp/$NM/pid" -l debug -u "/tmp/$NM/sock" &
 sleep 1
 
 echo "-----------------------------------------------------------------------------------"
@@ -53,6 +56,7 @@ ping -6 -c 3 -W 1 -I fc00::1   -t 3 ff04::114 >/dev/null
 ping -6 -c 3 -W 1 -I 2001:1::1 -t 3 ff2e::42  >/dev/null
 ping -6 -c 3 -W 1 -I 2001:1::1 -t 3 ff2e::43  >/dev/null
 ping -6 -c 3 -W 1 -I fc00::1   -t 3 ff2e::44  >/dev/null
+ping -6 -c 3 -W 1 -I 2001:2:3:4:6:7:12:1 -t 3 ff2e::7 >/dev/null
 show_mroute
 
 print "Analyzing ..."
@@ -66,6 +70,9 @@ echo " => $lines2 for group ff2e::42,  expected => 2"
 echo " => $lines3 for group ff2e::43,  expected => 2"
 echo " => $lines4 for group ff2e::44,  expected => 3"
 
+sleep 10
+show_mroute
+
 ########################################################################### DONE
 # one frame lost due to initial (*,G) -> (S,G) route setup
 # no frames lost in pure (S,G) route