debian/0000755000000000000000000000000011766075236007203 5ustar debian/mrd6.init0000755000000000000000000000255511766075140010744 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: mrd6 # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Required-Start: $network $remote_fs $syslog # Required-Stop: $network $remote_fs $syslog # Short-Description: IPv6 Multicast Routing Daemon # Description: mrd6 is a IPv6 IPv6 Multicast Routing Daemon which # implements: MLDv1, MLDv2, PIM-SM, partial MBGP support, # Native and virtual (tunnel) interfaces support and CLI # support. ### END INIT INFO # Author: Hugo Santos PATH=/usr/sbin:/usr/bin:/sbin:/bin DAEMON=/usr/sbin/mrd6 NAME=mrd6 DESC="Multicast routing daemon" CONF=/etc/mrd6.conf test -x $DAEMON || exit 0 test -r $CONF || exit 0 . /lib/lsb/init-functions case "$1" in start) log_begin_msg "Starting $DESC: $NAME" start-stop-daemon --start --quiet -m --pidfile /run/mrd6.pid --exec $DAEMON -- -D log_end_msg $? ;; stop) log_begin_msg "Stopping $DESC: $NAME" start-stop-daemon --stop --quiet --oknodo --exec $DAEMON rm -f /run/mrd6.pid log_end_msg $? ;; status) status_of_proc $DAEMON "$DESC: $NAME" ;; restart|force-reload) invoke-rc.d $NAME stop invoke-rc.d $NAME start ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|status|restart|force-reload}" >&2 exit 1 ;; esac exit 0 debian/rules0000755000000000000000000000062411766075140010257 0ustar #!/usr/bin/make -f export PREFIX=/usr export TARGET=mrd6 override_dh_auto_configure: dh_auto_configure -- \ --prefix /usr \ --static mld \ --static pim \ --static console \ --external bgp \ --external msnip \ --external mrdisc override_dh_auto_clean: dh_auto_clean rm -rf src/build/ rm -f src/Makefile.options clean: rm -f build dh clean build: dh build touch build %: dh $@ debian/compat0000644000000000000000000000000211766075140010373 0ustar 9 debian/examples0000644000000000000000000000001411766075140010731 0ustar src/confs/* debian/manpages0000644000000000000000000000003211766075140010706 0ustar docs/mrd6.8 docs/mrd6sh.1 debian/dirs0000644000000000000000000000001511766075140010055 0ustar usr/lib/mrd6 debian/copyright0000644000000000000000000000457611766075140011144 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: MRD6 Upstream-Contact: Hugo Santos Source: http://fivebits.net/proj/mrd6/ License: GPL-2+ Files: * Copyright: 2006-2008 Hugo Santos 2004-2006 Universidade de Aveiro, IT Aveiro Marco d'Itri License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". Files: debian/* Copyright: 2010 Thomas Preud'homme 2005, 2008 Hugo Santos 2005, 2006 Anand Kumria License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/watch0000644000000000000000000000036211766075140010227 0ustar version=3 # Using example fron the uscan man page: # This is a variant HTTP format which allows direct specification of # the homepage: # Homepage Pattern [Version [Action]] http://githubredir.debian.net/github/hugosantos/mrd6 (.*).tar.gz debian/docs0000644000000000000000000000005111766075140010044 0ustar MRD6shQuickRef.txt Troubleshooter README debian/patches/0000755000000000000000000000000011766075140010624 5ustar debian/patches/0004-Add-climits-header-when-used.patch0000644000000000000000000000206311766075140017504 0ustar From adce927e0c0c58226e8152bd78aa626fc9e949a7 Mon Sep 17 00:00:00 2001 From: James Westby Date: Mon, 3 May 2010 17:49:16 +0200 Subject: Add climits header when used Include climits in file using PATH_MAX or INT_MAX Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=tmpdulqaW;att=1;bug=507211 Bug-Debian: http://bugs.debian.org/507211 Forwarded: yes Last-Update: 2010-05-03 Applied-Upstream: commit: 83f3bc69c38e7b1d0948288ed69451f871a43d03 --- src/bgp/bgp.cpp | 1 + src/mrd.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bgp/bgp.cpp b/src/bgp/bgp.cpp index d4b9fec..cc1593b 100644 --- a/src/bgp/bgp.cpp +++ b/src/bgp/bgp.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include diff --git a/src/mrd.cpp b/src/mrd.cpp index 0c86835..3d09ac7 100644 --- a/src/mrd.cpp +++ b/src/mrd.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include debian/patches/0001-Fix-FTBFS-on-mips-and-mipsel.patch0000644000000000000000000000200711766075140017221 0ustar From ef89e5707b4665476438e0a17228179e0655123e Mon Sep 17 00:00:00 2001 From: Hugo Santos Date: Tue, 4 May 2010 18:52:35 +0200 Subject: Fix FTBFS on mips and mipsel Exception and interrupt handlers on mips and mipsel architectures copy program counter in EPC register so let's use EPC when getting current frame. Origin: upstream, http://fivebits.net/proj/mrd6/changeset/1717 Forwarded: http://fivebits.net/proj/mrd6/changeset/1717 Last-Update: 2010-05-04 Applied-Upstream: commit: r1717 --- src/linux/mrd_components.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/linux/mrd_components.cpp b/src/linux/mrd_components.cpp index ca6eff1..1d0a463 100644 --- a/src/linux/mrd_components.cpp +++ b/src/linux/mrd_components.cpp @@ -92,8 +92,6 @@ void *mrd::posix_uctx::get_current_frame() const { #if defined(__GLIBC__) #if defined(__i386__) return (void *)base->uc_mcontext.gregs[REG_EIP]; -#elif defined(__mips__) - return (void *)base->uc_mcontext.gpregs[CTX_EPC]; #endif #endif return 0; debian/patches/0003-Fix-a-FTBFS-on-s390.patch0000644000000000000000000000266411766075140015151 0ustar From 271c4359c0388fe32f78f86f8fa2a75a9e62d234 Mon Sep 17 00:00:00 2001 From: Hugo Santos Date: Fri, 6 Jun 2008 10:41:02 +0200 Subject: Fix a FTBFS on s390 Fix usage of size_t on s390 Origin: upstream, http://fivebits.net/proj/mrd6/changeset/1722 Bug-Debian: http://bugs.debian.org/466838 Forwarded: http://fivebits.net/proj/mrd6/changeset/1722 Last-Update: 2010-05-04 Applied-Upstream: commit: r1722 --- include/mrd/log.h | 6 ++++++ src/log.cpp | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/include/mrd/log.h b/include/mrd/log.h index a8c6d99..c0b0905 100644 --- a/include/mrd/log.h +++ b/include/mrd/log.h @@ -53,6 +53,12 @@ void stream_push_formated_type(base_stream &, uint64_t val); void stream_push_formated_type(base_stream &, const char *val); void stream_push_formated_type(base_stream &, const void *val); + +#ifdef __s390__ +const char *stream_type_format_parameter(size_t); +void stream_push_formated_type(base_stream &, size_t val); +#endif + /*! * base log stream */ diff --git a/src/log.cpp b/src/log.cpp index a12261e..2234810 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -667,3 +667,12 @@ void stream_push_formated_type(base_stream &os, const void *val) { os.nprintf(32, "%p", val); } +#ifdef __s390__ +const char *stream_type_format_parameter(size_t) { + return "u"; +} + +void stream_push_formated_type(base_stream &os, size_t val) { + os.nprintf(32, "%z", val); +} +#endif debian/patches/0010-Add-support-for-s390x.patch0000644000000000000000000000240111766075140016072 0ustar From 2b8b5f3fbf030853f2f7ca71024a017acaee97c2 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 2 Mar 2012 23:10:38 +0100 Subject: Add support for s390x Exclude __s390x__ to all the macro test for s390* architectures. Origin: vendor Forwarded: https://github.com/hugosantos/mrd6/pull/18 Last-Update: 2012-03-04 --- include/mrd/log.h | 2 +- src/log.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mrd/log.h b/include/mrd/log.h index c0b0905..7843c07 100644 --- a/include/mrd/log.h +++ b/include/mrd/log.h @@ -54,7 +54,7 @@ void stream_push_formated_type(base_stream &, const char *val); void stream_push_formated_type(base_stream &, const void *val); -#ifdef __s390__ +#if defined (__s390__) && !defined (__s390x__) const char *stream_type_format_parameter(size_t); void stream_push_formated_type(base_stream &, size_t val); #endif diff --git a/src/log.cpp b/src/log.cpp index 2234810..17229e0 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -667,7 +667,7 @@ void stream_push_formated_type(base_stream &os, const void *val) { os.nprintf(32, "%p", val); } -#ifdef __s390__ +#if defined (__s390__) && !defined (__s390x__) const char *stream_type_format_parameter(size_t) { return "u"; } debian/patches/0002-Fix-an-ambiguous-function-call-on-64-bit-platforms.patch0000644000000000000000000000252011766075140023514 0ustar From af580f8003c114977318f975eb8b6aee98bd2244 Mon Sep 17 00:00:00 2001 From: Hugo Santos Date: Tue, 4 May 2010 18:52:20 +0200 Subject: Fix an ambiguous function call on 64-bit platforms Cast m_read.size and m_write.size in uint32_t to fix ambiguous function call on 64-bit platforms in mrd::show_info Origin: upstream, http://fivebits.net/proj/mrd6/changeset/1718 Forwarded: http://fivebits.net/proj/mrd6/changeset/1718 Last-Update: 2010-05-04 Applied-Upstream: commit: r1718 --- src/mrd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mrd.cpp b/src/mrd.cpp index 5c16a69..0c86835 100644 --- a/src/mrd.cpp +++ b/src/mrd.cpp @@ -2338,7 +2338,8 @@ bool mrd::show_info(base_stream &out, const std::vector &ctx) { out.xprintf("Uptime: %{duration}\n", time_duration((time(0) - m_startup) * 1000)); out.xprintf("Performed tasks: %u (spent %llu ms)\n", m_tasks_stat, m_tasks_time_spent); - out.xprintf("Registered sockets: %u reading, %u writing\n", m_read.size(), m_write.size()); + out.xprintf("Registered sockets: %u reading, %u writing\n", + (uint32_t)m_read.size(), (uint32_t)m_write.size()); out.xprintf("MRIB prefix count: %u\n", mrib().registry_prefix_count()); out.xprintf("Interface count: %u\n", m_intflist.size()); out.xprintf("Group state count: %u\n", m_grplist.size()); debian/patches/0007-Fix-build-warnings.patch0000644000000000000000000000326711766075140015712 0ustar From 2d066bf2f21dd16c36fe1e5d20c30e7160cb7771 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 5 May 2010 15:20:00 +0200 Subject: Fix build warnings. - Disable strict aliasing as mrd6 violates aliasing rules - Use --as-needed to avoid unecessary library links Origin: vendor Forwarded: http://github.com/hugosantos/mrd6/issues/issue/2 Last-Updated: 2010-05-05 Applied-Upstream: commit: 83f3bc69c38e7b1d0948288ed69451f871a43d03 --- src/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index bceb6a5..0e7c2b3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,6 +33,7 @@ endif ifeq ($(SUPPORT_MODULES),yes) MODULES ?= BGP LDCMD = -rdynamic + LDMODCMD = -Wl,--as-needed else MODULE_OPTIONS += -DMRD_NO_DYNAMIC_MODULE_LOADING endif @@ -101,7 +102,7 @@ TESTS = tests/address_unittest tests/ptree_unittest tests/mrib_unittest DEST_PREFIX = $(DESTDIR)$(PREFIX) CXXFLAGS = $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \ - -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) + -fno-strict-aliasing -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) ifeq ($(OPTIMIZE),yes) ifeq ($(SPACE_OPTIMIZE),yes) @@ -119,6 +120,7 @@ else endif LDFLAGS += -lm +LDCMD += -Wl,--as-needed ifeq ($(STATIC_STDCXX),no) LDFLAGS += -lstdc++ @@ -135,7 +137,7 @@ define module_template BUILT_SOURCES += $$($(1)_SOURCES) $$($(1)_TARGET): $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) @echo "Module $$($(1)_TARGET)" - @$(CXX) -shared $(CXXFLAGS) -o $$($(1)_TARGET) \ + @$(CXX) -shared $(LDMODCMD) $(CXXFLAGS) -o $$($(1)_TARGET) \ $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) endef debian/patches/0013-Interpret-syslog-buffer-string-as-string-only.patch0000644000000000000000000000212511766075140023157 0ustar From d58a6921209c779cb84e64f34afd551780abbeac Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 4 Mar 2012 21:13:14 +0100 Subject: Interpret syslog buffer string as string only Don't interpret any format specifier in the buffer string passed to syslog. In other word, consider the whole buffer string as containing only characters. Origin: vendor Bug-Debian: http://bugs.debian.org/662191 Forwarded: https://github.com/hugosantos/mrd6/commit/83f3bc69c38e7b1d0948288ed69451f871a43d03 Last-Update: 2012-03-04 Applied-Upstream: commit: 83f3bc69c38e7b1d0948288ed69451f871a43d03 --- src/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log.cpp b/src/log.cpp index 17229e0..759a7b0 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -321,7 +321,7 @@ static inline int type_as_syslog_priority(int t) { } void syslog_log_node::log(int type, int level, const char *msg, bool) { - syslog(type_as_syslog_priority(type), msg); + syslog(type_as_syslog_priority(type), "%s", msg); } tb_log_node::tb_log_node(log_base *parent, const char *name, int level) debian/patches/0011-Enable-verbose-build.patch0000644000000000000000000000375411766075140016163 0ustar From 148c8cf909ca172c434e8ef3f4c64aa71d80792a Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 4 Mar 2012 20:51:39 +0100 Subject: Enable verbose build. Enable verbose build so it's easy to detect missing (hardening) flags. Origin: vendor Bug-Debian: http://bugs.debian.org/662191 Forwarded: not-needed Last-Update: 2012-03-04 --- src/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index ff17486..642500e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -141,7 +141,7 @@ define module_template BUILT_SOURCES += $$($(1)_SOURCES) $$($(1)_TARGET): $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) @echo "Module $$($(1)_TARGET)" - @$(CXX) -shared $(LDMODCMD) $(CXXFLAGS) -o $$($(1)_TARGET) \ + $(CXX) -shared $(LDMODCMD) $(CXXFLAGS) -o $$($(1)_TARGET) \ $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) endef @@ -154,7 +154,7 @@ define unittest_template BUILT_SOURCES += $(1).cpp $(1): $(TEST_OBJECTS) $(1).cpp @echo "Linking $(1)" - @$(CXX) $(LDCMD) $(CXXFLAGS) -o $(1) $(1).cpp $(TEST_OBJECTS) \ + $(CXX) $(LDCMD) $(CXXFLAGS) -o $(1) $(1).cpp $(TEST_OBJECTS) \ $(LDFLAGS) -lboost_unit_test_framework endef @@ -166,7 +166,7 @@ $(foreach test,$(TESTS),$(eval $(call unittest_template,$(test)))) $(TARGET): $(MRD_OBJECTS) @echo "Linking $(TARGET)" - @$(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS) + $(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS) install: $(TARGET) $(EXTERNAL_MODULES) install -D $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET) @@ -196,7 +196,7 @@ $(OPTIONS): $(DEPS_DIR)/%.d: %.cpp $(OPTIONS) @echo "Deps $<" - @set -e; mkdir -p $(dir $@); \ + set -e; mkdir -p $(dir $@); \ $(CXX) -MM -MT $@ -MT $(addprefix $(OBJ_DIR)/,$(<:.cpp=.o)) \ $(CXXFLAGS) $< > $@ @@ -210,7 +210,7 @@ endif $(OBJ_DIR)/%.o: %.cpp $(OPTIONS) @echo "C++ $<" - @set -e; mkdir -p $(dir $@); \ + set -e; mkdir -p $(dir $@); \ $(CXX) -c $(CXXFLAGS) $< -o $@ clean: debian/patches/series0000644000000000000000000000115511766075140012043 0ustar 0001-Fix-FTBFS-on-mips-and-mipsel.patch 0002-Fix-an-ambiguous-function-call-on-64-bit-platforms.patch 0003-Fix-a-FTBFS-on-s390.patch 0004-Add-climits-header-when-used.patch 0005-Make-Makefile-architecture-aware.patch 0006-Fix-FTBFS-on-Hurd.patch 0007-Fix-build-warnings.patch 0008-Don-t-build-Makefile.options-if-cleaning.patch 0009-Fix-errors-and-warnings-from-last-build-on-amd64.patch 0010-Add-support-for-s390x.patch 0011-Enable-verbose-build.patch 0012-Always-allow-flags-to-be-set-from-environment.patch 0013-Interpret-syslog-buffer-string-as-string-only.patch 0014-Correctly-detect-and-enable-new-interfaces.patch debian/patches/0006-Fix-FTBFS-on-Hurd.patch0000644000000000000000000000230611766075140015133 0ustar From 15ab532f76d683a9f8ff5e173a2b1295bf14672b Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 4 May 2010 21:02:00 +0200 Subject: Fix FTBFS on Hurd Add missing SA_SIGINFO define and handle the absence of PATH_MAX. Origin: vendor Forwarded: http://github.com/hugosantos/mrd6/commit/680dbf95c919280f26f345e3ec42e830a08476ee Last-Update: 2011-04-21 Applied-Upstream: commit: 680dbf95c919280f26f345e3ec42e830a08476ee --- src/mrd.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mrd.cpp b/src/mrd.cpp index 3d09ac7..fe1316c 100644 --- a/src/mrd.cpp +++ b/src/mrd.cpp @@ -66,6 +66,10 @@ #define IPV6_RECVPKTINFO IPV6_PKTINFO #endif +#if !defined(SA_SIGINFO) && defined(__gnu_hurd__) +#define SA_SIGINFO 0x00000004u +#endif + #define CRASH_COMMAND mrd *g_mrd = 0; @@ -1976,10 +1980,8 @@ bool mrd::load_modulex(const char *name) { return false; } - char tmp[PATH_MAX]; - strncpy(tmp, path.c_str(), sizeof(tmp)); - - void *foo = dlopen(tmp, RTLD_NOW | RTLD_GLOBAL); + /* There will be a FS limit so don't worry for the size */ + void *foo = dlopen(path.c_str(), RTLD_NOW | RTLD_GLOBAL); module_init_sig *load = 0; if (foo) { debian/patches/0014-Correctly-detect-and-enable-new-interfaces.patch0000644000000000000000000000567011766075140022347 0ustar From f44fbf66edf74dababb784215a7863a5fff14a86 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Sat, 26 May 2012 10:30:59 +0200 Subject: Correctly detect and enable new interfaces When new interfaces are created while mrd6 is running, they are detected but incorrectly added as down. This patch correctly manages the case of enabling interfaces which were not previously available. Signed-off-by: Luca Bruno Origin: upstream, https://github.com/hugosantos/mrd6/commit/2ecdfe06976f7a8db61e7aafe7817fab78637e80 Forwarded: https://github.com/hugosantos/mrd6/commit/2ecdfe06976f7a8db61e7aafe7817fab78637e80 Last-Update: 2012-06-13 Applied-Upstream: commit: 2ecdfe06976f7a8db61e7aafe7817fab78637e80 --- include/mrd/interface.h | 2 +- src/interface.cpp | 16 ++++++++++------ src/linux/linux_unicast_route.cpp | 2 +- src/mrd.cpp | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/mrd/interface.h b/include/mrd/interface.h index c413eb0..ad79e0b 100644 --- a/include/mrd/interface.h +++ b/include/mrd/interface.h @@ -200,7 +200,7 @@ private: void add_remove_address(bool isnew, const inet6_addr &); void broadcast_change_state(bool wasdown); - void set_enabled(bool); + void set_enabled(bool newstate, bool newiface=false); }; uint16_t ipv6_checksum(uint8_t protocol, const in6_addr &src, const in6_addr &dst, const void *data, uint16_t len); diff --git a/src/interface.cpp b/src/interface.cpp index 083dc09..c449005 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -283,12 +283,16 @@ void interface::broadcast_change_state(bool wasdown) { } } -void interface::set_enabled(bool newstate) { - bool wasdown = !up(); - - mif_enabled = newstate; - - broadcast_change_state(wasdown); +void interface::set_enabled(bool newstate, bool newiface) { + if (!newiface) { + bool wasdown = !up(); + mif_enabled = newstate; + broadcast_change_state(wasdown); + } else { + mif_state = (newstate) ? Up : Down; + mif_enabled = newstate; + g_mrd->broadcast_interface_state_changed(this); + } } bool interface::attach_node(interface_node *node) { diff --git a/src/linux/linux_unicast_route.cpp b/src/linux/linux_unicast_route.cpp index 7ce1ab4..331a7a0 100644 --- a/src/linux/linux_unicast_route.cpp +++ b/src/linux/linux_unicast_route.cpp @@ -199,7 +199,7 @@ static void _install_interface(const interface_desc &d) { ((linux_unicast_router &)g_mrd->rib()).do_dump(RTM_GETADDR); } - intf->change_state(d.up ? interface::Up : interface::Down); + intf->change_state((d.up | intf->up()) ? interface::Up : interface::Down); } } diff --git a/src/mrd.cpp b/src/mrd.cpp index fe1316c..82943f3 100644 --- a/src/mrd.cpp +++ b/src/mrd.cpp @@ -1483,7 +1483,7 @@ interface *mrd::found_interface(int index, const char *name, int type, (uint32_t)intf->mtu()); } - intf->set_enabled(enabled); + intf->set_enabled(enabled, true); return intf; } debian/patches/0008-Don-t-build-Makefile.options-if-cleaning.patch0000644000000000000000000000124511766075140021671 0ustar From 45e674f593410dc3b42efef6182efa9e28f6ac04 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 5 May 2010 20:52:09 +0200 Subject: Don't build Makefile.options if cleaning Don't include Makefile.options if we are cleaning so that it is not created if we are cleaning. Origin: vendor Forwarded: yes Last-Update: 2010-05-05 --- src/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Makefile b/src/Makefile index 0e7c2b3..ff17486 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,8 @@ +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),distclean) -include Makefile.options +endif +endif CXX ?= g++ debian/patches/0009-Fix-errors-and-warnings-from-last-build-on-amd64.patch0000644000000000000000000000422211766075140023203 0ustar From 6fc5eaf4797279eecb1c096ed86311119518d413 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 3 May 2011 01:44:14 +0200 Subject: Fix errors and warnings from last build on amd64. * Missing cstddef include in ptree.h for g++ to know ptrdiff_t * Uses %z for displaying the content of a size_t variable * Remove unaccessed prevpointer in parser.cpp Origin: vendor Bug-Debian: http://bugs.debian.org/625100 Forwarded: https://github.com/hugosantos/mrd6/pull/8 Last-Updated: 2011-05-04 Applied-Upstream: commit: b74db86c07cc49bcf0ca413220c91272b55d6da8 --- include/mrd/support/ptree.h | 1 + src/parser.cpp | 3 +-- src/timers.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mrd/support/ptree.h b/include/mrd/support/ptree.h index a488c77..4d745be 100644 --- a/include/mrd/support/ptree.h +++ b/include/mrd/support/ptree.h @@ -35,6 +35,7 @@ #ifndef _Ptree_h_ #define _Ptree_h_ +#include #include #include #include diff --git a/src/parser.cpp b/src/parser.cpp index 3a8feb2..b3bfda0 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -171,7 +171,7 @@ int parser_context::eat(int count, ...) { int parser_context::read_token(bool strict, int *sym, const char **symstart, bool eat) { int res, readnum; - int pointer = 0, prevpointer = 0; + int pointer = 0; int linenumber = m_current_line; int state = 0; const char *currline = m_input_line_start; @@ -236,7 +236,6 @@ int parser_context::read_token(bool strict, int *sym, const char **symstart, break; } - prevpointer = pointer; pointer += readnum; } diff --git a/src/timers.cpp b/src/timers.cpp index 1e6a47b..abfac43 100644 --- a/src/timers.cpp +++ b/src/timers.cpp @@ -403,7 +403,7 @@ bool timermgr::output_info(base_stream &ctx, bool extended) const { namelen = 50; char fmt[64]; - snprintf(fmt, sizeof(fmt), "| %%%is | %%12s | %%10s | %%8s |", namelen); + snprintf(fmt, sizeof(fmt), "| %%%zis | %%12s | %%10s | %%8s |", namelen); _draw_sep(ctx, namelen); ctx.printf(fmt, "timer name", "time left", "interval", "repeat").newl(); debian/patches/0012-Always-allow-flags-to-be-set-from-environment.patch0000644000000000000000000000326511766075140023001 0ustar From a7590b6ab1f53510a41d7656a2fdd99628a44202 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 4 Mar 2012 20:59:36 +0100 Subject: Always allow flags to be set from environment. * Transform flag affectation statements in append statements to allow flags to be set from the environment. * Use LDFLAGS when linking modules. Origin: vendor Bug-Debian: http://bugs.debian.org/662191 Forwarded: https://github.com/hugosantos/mrd6/pull/19 Last-Update: 2012-03-04 --- src/Makefile | 4 ++-- tools/c/Makefile | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 642500e..30c8332 100644 --- a/src/Makefile +++ b/src/Makefile @@ -105,7 +105,7 @@ TESTS = tests/address_unittest tests/ptree_unittest tests/mrib_unittest DEST_PREFIX = $(DESTDIR)$(PREFIX) -CXXFLAGS = $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \ +CXXFLAGS += $(CPPFLAGS) $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \ -fno-strict-aliasing -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) ifeq ($(OPTIMIZE),yes) @@ -142,7 +142,7 @@ BUILT_SOURCES += $$($(1)_SOURCES) $$($(1)_TARGET): $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) @echo "Module $$($(1)_TARGET)" $(CXX) -shared $(LDMODCMD) $(CXXFLAGS) -o $$($(1)_TARGET) \ - $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) + $$(addprefix $(OBJ_DIR)/,$($(1)_SOURCES:.cpp=.o)) $(LDFLAGS) endef define static_module_template diff --git a/tools/c/Makefile b/tools/c/Makefile index f078d68..126dc23 100644 --- a/tools/c/Makefile +++ b/tools/c/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -g -O2 -Wall -ansi +CFLAGS ?= -g -O2 +CFLAGS += -Wall -ansi PREFIX ?= /usr/local debian/patches/0005-Make-Makefile-architecture-aware.patch0000644000000000000000000000307711766075140020403 0ustar From a795fdcafb9425207226adefc1457ede05e0f82c Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Mon, 3 May 2010 17:15:57 +0200 Subject: Make Makefile architecture aware The Makefile behaves differently depending on the value of $(PLATFORM) but this variable is not set appropriately on the various supported kernels. This patch sets PLATFORM depending on the value of uname -s Origin: vendor Forwarded: http://github.com/hugosantos/mrd6/issues/issue/3 Last-Update: 2010-05-03 --- src/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 8b2143b..bceb6a5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ CXX ?= g++ -PLATFORM ?= OS_LINUX +PLATFORM ?= OS_OTHER SUPPORT_MODULES ?= yes TARGET ?= mrd PREFIX ?= /usr/local @@ -17,6 +17,14 @@ MODULES_CPP = $(OBJ_DIR)/modules.cpp STATIC_MODULES ?= MLD PIM CONSOLE +KERNEL = $(shell uname -s) +ifeq ($(KERNEL),Linux) + PLATFORM = OS_LINUX +endif +ifneq (,$(findstring BSD,$(KERNEL))) + PLATFORM = OS_BSD +endif + ifeq ($(FULL_STATIC),yes) SUPPORT_MODULES = no LDCMD = -static @@ -38,10 +46,11 @@ SOURCES = address.cpp address_set.cpp group.cpp icmp_inet6.cpp icmp.cpp \ parser.cpp rib.cpp router.cpp timers.cpp support/objpool.cpp \ support/ptree.cpp +LDFLAGS += -ldl # mrd.cpp requires dl* functions + ifeq ($(PLATFORM),OS_LINUX) SOURCES += linux/us_mfa.cpp linux/linux_icmp_raw.cpp \ linux/linux_unicast_route.cpp linux/mrd_components.cpp - LDFLAGS += -ldl endif ifeq ($(PLATFORM),OS_BSD) debian/control0000644000000000000000000000245111766075140010602 0ustar Source: mrd6 Section: net Priority: optional Maintainer: Thomas Preud'homme Build-Depends: debhelper (>= 9.0.0), perl Standards-Version: 3.9.3 DM-Upload-Allowed: yes Homepage: http://fivebits.net/proj/mrd6/ Vcs-Browser: http://git.debian.org/?p=collab-maint/mrd6.git;a=summary Vcs-Git: git://git.debian.org/collab-maint/mrd6.git Package: mrd6 Architecture: linux-any kfreebsd-any Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, initscripts (>= 2.88dsf-13.3) Recommends: ${perl:Depends} Description: IPv6 Multicast Routing Daemon mrd6 is a modular IPv6 Multicast Routing Daemon which implements: * MLDv1 and MLDv2 support - MLD proxying * PIM-SM (ASM and SSM) - Bootstrap (BSR) Mechanism support - Static RP configuration - Embedded-RP support (RFC 3956) * partial MBGP support - Implements basic BGP4 mechanisms (IPv6 Multicast SAFI) to update local MRIB from MBGP info - Uses IPv6 Multicast SAFI prefixes announced by peers to update local MRIB - Is able to announce local prefixes - Filter support * Supports both native and virtual (tunnel) interfaces (tested IPv6-IPv4, IPv6-IPv6 and TUN/TAP tunnels) * Abstract Forwarding Interface (MFA) with user-space module * Remote configuration and online administration debian/source/0000755000000000000000000000000011766075140010475 5ustar debian/source/format0000644000000000000000000000001411766075140011703 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000002274111766075140011055 0ustar mrd6 (0.9.6-10) unstable; urgency=low * Make sure new interface are correctly marked up by mrd6 (Closes: #674738). -- Thomas Preud'homme Wed, 13 Jun 2012 13:14:11 +0200 mrd6 (0.9.6-9) unstable; urgency=low * Improve fortification of mrd6 (Closes: #662191, big thanks Simon Ruderich): + Enable verbose build to catch missing flags. + Always allow flags to be set from environment. + Use LDFLAGS when linking modules. + Interpret syslog buffer string as string only. + Remove manual setting of *FLAGS with dpkg-buildflags in debian/rules. -- Thomas Preud'homme Sun, 04 Mar 2012 21:48:42 +0100 mrd6 (0.9.6-8) unstable; urgency=low * Fix support of s390x: s390x is now excluded from tests for s390. -- Thomas Preud'homme Sun, 04 Mar 2012 12:19:21 +0100 mrd6 (0.9.6-7) unstable; urgency=low * Store PID file in the new /run directory. * debian/control: + Add support for s390x. + Remove Hurd from valid architectures as some code is missing to build correctly for now. + Set DMUA flag. + Bump Standards-Version to 3.9.3 (no changes needed). * debian/rules: + Use dpkg-buildflags to set build flags (CPPFLAGS, CXXFLAGS and LDFLAGS). * debian/copyright: + Use final version for DEP5 1.0 copyright. + Document global license and copyright. + Add missing dots between paragraph in Expat license statement. + Add missing hyphens in GPL-2+ license shortname. + Move GPL-2+ to a separate license stanza. * Update debian/compat to 9 (no changes needed). -- Thomas Preud'homme Sat, 03 Mar 2012 00:41:22 +0100 mrd6 (0.9.6-6) unstable; urgency=low * Fix errors and warnings from last build on amd64: + Fix FTBFS on amd64 due to missing cstddef include (Closes: #625100). + Uses %zi for displaying the content of a size_t variable. + Remove unaccessed prevpointer in parser.cpp. * Use the same name as upstream for init script to avoid mistakes. * Fix a code typo in patch fixing Hurd FTBFS. * Remove duplicate clean target in debian/rules. -- Thomas Preud'homme Sat, 23 Apr 2011 19:11:24 +0200 mrd6 (0.9.6-5) unstable; urgency=low * Don't use any debian/* files from orig.tar.gz. -- Thomas Preud'homme Fri, 22 Apr 2011 00:27:32 +0200 mrd6 (0.9.6-4) unstable; urgency=low * Fix FTBFS on Hurd. * Add missing dependency on $syslog in init script. * debian/watch: + Track new upstream repository on github. * debian/control: + Recommends perl as mrd6sh needs it. + Bumps Standards-Version to 3.9.2 (no changes needed). * debian/copyright: + Convert to DEP5 candidate format. * debian/compat: + Bumps debhelper compatibility from 7 to 8 (no changes needed). -- Thomas Preud'homme Mon, 18 Oct 2010 22:01:51 +0200 mrd6 (0.9.6-3) unstable; urgency=low * Make dl* functions available on all archs (Fix FTBFS on *BSD). * debian/control: + Bumps Standards-Version to 3.9.1 (no changes needed). -- Thomas Preud'homme Mon, 09 Aug 2010 22:18:03 +0200 mrd6 (0.9.6-2) unstable; urgency=low * New maintainer. (Closes: #572373) * Acknowledge NMUs. (Closes: #507211) * Make Makefile architecture aware (fix FTBFS on *BSD). * Fix FTBFS on Hurd. * Support status command in init script. * Fix lintian errors and warnings: - Add dependency on remote_fs in init script - Use invoke-rc.d in init script - Add a ${misc:Depends} build dependency. * Switch to dpkg-source 3.0 (quilt) format. * Update Standards-Version to 3.8.4. * Bumps debhelper compatibility to 7. - Uses a dh based debian/rules. * Fix build warnings: - Disable strict aliasing as mrd6 violates aliasing rules - Avoid unnecessary libgcc dependency thanks to Pierre Habouzit * Deactivate watch file as upstream tarballs are no longer reachable. * Set Vcs-Browser and Vcs-Git fields. -- Thomas Preud'homme Wed, 05 May 2010 22:47:16 +0200 mrd6 (0.9.6-1.3) unstable; urgency=low * Non-maintainer upload. * add #include's in src/mrd.cpp and src/bgp/bgp.cpp to fix FTBFS. Thanks, James Westby for the patch. (Closes: #507211) -- Daniel Kahn Gillmor Sun, 22 Mar 2009 20:13:42 -0400 mrd6 (0.9.6-1.2) unstable; urgency=low * Non-maintainer upload. * Apply patch from upstream (r1722) to fix FTBFS on s390. Affects: - include/mrd/log.h - src/log.cpp -- Laurent Bigonville Tue, 16 Sep 2008 19:53:14 +0200 mrd6 (0.9.6-1.1) unstable; urgency=low * Non-maintainer upload. * Apply patch from upstream to fix FBTFS on s390, mips and mipsel. Effects: - src/linux/mrd_components.cpp - src/mrd.cpp -- Lior Kaplan Sat, 09 Feb 2008 13:08:17 +0200 mrd6 (0.9.6-1) unstable; urgency=low [ Hugo Santos ] * New upstream release (Closes: #462786) - Incorporates NMU changes (Closes: #423063, #417436) * Now really fix FTBFS with GCC 4.3 (Closes: #455280) [ Lior Kaplan ] * Bump standards-version to 3.7.3 - Move homepage to a regular header. * Fix debian-changelog-line-too-long lintian warning. * Fix debian-rules-ignores-make-clean-error lintain warning. * Add a debian version number to differentiate this package from upstream's native package. -- Hugo Santos Thu, 31 Jan 2008 11:51:25 +0200 mrd6 (0.9.5-rev3.dfsg-0.2) unstable; urgency=low * Non-maintainer upload. * Repackage upstream tarball to remove non-free IETF RFC/I-D (Closes: #423063) * Really fix FTBFS with GCC 4.3 (Closes: #417436) * Clean up debian/rules and create debian/{examples,manpages} -- Lior Kaplan Sat, 09 Jun 2007 00:57:01 +0300 mrd6 (0.9.5-rev3-0.1) unstable; urgency=low * Non-maintainer upload. (Closes: #418074) * New maintainer. (Closes: #418084) - Adopt this package by its upstream, which works on it very tightly with Debian. Thank you Hugo for covering for an MIA maintainer. * New upstream release - Fix segfault when unloading module (Closes: #394590) - Fix FTBFS with GCC 4.3 (Closes: #417436) - New upstream address (Closes: #411805) - Change the package's version number inside debian, so it will be more accurate and easy to maintain with future (debian & upstream) versions. * debian/control: - Bump standards version to 3.7.2.2 (no changes needed) - Remove extra build depends, as they are covered by build-essential. - Update package description according to the README file. - Change maintainer to Hugo Santos. * Add watch file. -- Lior Kaplan Mon, 09 Apr 2007 20:28:32 +0300 mrd6 (0.9.5-release-1) unstable; urgency=low * New upstream release * Hack the version number so we can upgrade properly * New features: - update to draft 06 - implements MSNIP and MRDISC - improved user-space forwarding on Linux -- Anand Kumria Sun, 8 Jan 2006 12:28:48 +1100 mrd6 (0.9.5-pre2-1) unstable; urgency=low * New upstream (pre)release -- Anand Kumria Mon, 28 Nov 2005 15:41:11 +1100 mrd6 (0.9.5-pre1-1) unstable; urgency=low * Initial upload to Debian -- Anand Kumria Tue, 15 Nov 2005 11:05:57 +1100 mrd6 (0.9.4-beta2-1) unstable; urgency=low * beta2 -- Hugo Santos Mon, 17 Oct 2005 22:57:45 +0100 mrd6 (0.9.4-beta1-1) unstable; urgency=low * Bumped to 0.9.4-beta1 -- Hugo Santos Wed, 28 Sep 2005 01:11:03 +0100 mrd6 (0.9.2-beta3-1) unstable; urgency=low * beta3 -- Hugo Santos Tue, 23 Aug 2005 23:36:40 +0100 mrd6 (0.9.2-beta2-1) unstable; urgency=low * beta2 -- Hugo Santos Thu, 18 Aug 2005 00:09:07 +0100 mrd6 (0.9.2-beta1-1) unstable; urgency=low * Bumped to 0.9.2. -- Hugo Santos Fri, 12 Aug 2005 00:30:29 +0100 mrd6 (0.9.1-beta2-1) unstable; urgency=low * Version bump -- Hugo Santos Mon, 25 Jul 2005 00:32:34 +0100 mrd6 (0.9.1-beta1-1) unstable; urgency=low * Version bump -- Hugo Santos Thu, 7 Jul 2005 02:34:26 +0100 mrd6 (0.9-beta2) unstable; urgency=low * Beta 2 -- Hugo Santos Thu, 30 Jun 2005 06:19:51 +0100 mrd6 (0.9-beta1) unstable; urgency=low * Bump to 0.9 -- Hugo Santos Sat, 25 Jun 2005 20:07:24 +0100 mrd6 (0.8.5-beta1-1) unstable; urgency=low * Bumped to 0.8.5 -- Hugo Santos Sat, 30 Apr 2005 21:55:09 +0100 mrd6 (0.8-beta2-1) unstable; urgency=low * Yet another bump. 0.8-beta2 -- Hugo Santos Sat, 23 Apr 2005 03:06:53 +0100 mrd6 (0.8-beta1-1) unstable; urgency=low * Bumped version to 0.8-beta1 -- Hugo Santos Tue, 19 Apr 2005 23:34:04 +0100 mrd6 (0.7-beta3-1) unstable; urgency=low * Bumped version to 0.7-beta3 -- Hugo Santos Tue, 5 Apr 2005 02:08:32 +0100 mrd6 (0.7-beta2-1) unstable; urgency=low * Bumped version to 0.7-beta2 -- Hugo Santos Thu, 26 Mar 2005 03:46:26 +0000 mrd6 (0.7-beta1-1) unstable; urgency=low * Bumped version to 0.7-beta1 -- Hugo Santos Thu, 24 Mar 2005 14:52:00 +0000 mrd6 (0.6-beta6-1) unstable; urgency=low * Bumped version to beta6 -- Hugo Santos Sun, 7 Mar 2005 23:13:08 +0000 mrd6 (0.6-beta5-1) unstable; urgency=low * Initial Release. -- Hugo Santos Sun, 27 Feb 2005 03:08:08 +0000