Skip to content

Commit

Permalink
Drop and correct licensing of project
Browse files Browse the repository at this point in the history
Originally based on a cut down mrouted, since then rewritten by me,
through various guises: mrouted -> bridged (first cut-down version)
-> querierd (evern more rewrites) -> mcd (now with the final engine
replacement).

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Mar 15, 2024
1 parent 0a56c46 commit edb5563
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 228 deletions.
29 changes: 0 additions & 29 deletions LICENSE

This file was deleted.

63 changes: 0 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,72 +75,9 @@ win an election.
> needs to be SIGHUP'ed to use any new interface or address, e.g. DHCP.

Motivation
----------

The Linux bridge recently gained support for per-VLAN IGMP/MLD snooping.
It stands fine on its own legs, with lots of new per-VLAN settings. But
since it lives in the bridge, it cannot know about any VLAN interfaces
that may (or may not) sit on top of the bridge. There are naming issues
(br0.1 vs vlan1), and the fact that an interface can have multiple IP
addresses assigned to it. Therefore, the current bridge implementation
in `br_multicast.c` can only act as a proxy querier, i.e., for IGMP this
means it can only send queries (per-VLAN) with source IP 0.0.0.0.

To understand why this might be a problem there are two things to
consider:

1. Some networks don't have a (dynamic) multicast router¹. Usually the
multicast router is the IGMP/MLD querier for a LAN, but some LANs
consist only of (industrial) switches that try their best to limit
the spread of multicast² on low-capacity links
2. Some end-devices discard queries with source IP 0.0.0.0. This is
of course wrong, but good luck telling a PLC vendor they should
change their embedded firmware of an aging product, or even the
customer site to upgrade their locked-down system with a brand new
firmware -- these people don't like change and sometimes because it
comes with drawn-out re-certification processes

So, proxy queries are allowed per RFC, but that might not work with some
end-devices, and we can't disable proxy-query because some end-devices
don't do gratuitous join/leave. Hence, we need a service to provide us
with an IGMP/MLD querier that can (at least) use one of the IP address
on the interfaces we have on top of the bridge.

Other limitations to be aware of in `br_multicast.c` (currently) is the
lack of IGMP/MLD version fallback. I.e., per RFC, the LAN should start
out as IGMPv3 and when an end-device shows up with an IGMPv2 join then
the whole LAN should fall back to to IGMPv2, with a timer to return to
IGMPv3 if that end-device stops transmitting (IGMP control frames). Of
course, optimizations can be done here, e.g., only falling back on the
given port, or not tracking (the timer) per individual end-devices. It
is worth remembering, that the IGMP standard was written for old hubbed
networks, in those days everyone could see a single IGMPv2 message and
everyone could potentially confuse that end-device with a newer version.

_____
¹ E.g., Quagga/Frr PIM, or little mrouted/pimd/pimd-dense/pim6sd
² remember, multicast acts like broadcast if it's not limited (by IGMP
or MLD), so disabling IGMP/MLD snooping is not an option in these
networks, they are what actually keep most of these sites afloat.


Origin & References
-------------------

This is a fork of [querierd][], by Westermo Network Technologies, which
in turn was based on the [mrouted][] project, with DNA strands from the
[pimd][] project. It should be quite easy to also add MLD/MLDv2 querier
functionality from the [pim6sd][] project, because they all share a the
same ancestor (mrouted).

[GitHub]: https://github.com/kernelkit/mcd/actions/workflows/build.yml/
[GitHub Status]: https://github.com/kernelkit/mcd/actions/workflows/build.yml/badge.svg
[License]: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/mrouted/LICENSE
[License Badge]: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
[Coverity Scan]: https://scan.coverity.com/projects/24475
[Coverity Status]: https://scan.coverity.com/projects/24475/badge.svg
[querierd]: https://github.com/westermo/querierd/
[mrouted]: https://github.com/troglobit/mrouted/
[pimd]: https://github.com/troglobit/pimd/
[pim6sd]: https://github.com/troglobit/pim6sd/
5 changes: 0 additions & 5 deletions src/config.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#include <ifaddrs.h>

#include "defs.h"
Expand Down
4 changes: 0 additions & 4 deletions src/defs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/
#ifndef MCD_DEFS_H_
#define MCD_DEFS_H_

Expand Down
5 changes: 0 additions & 5 deletions src/iface.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#include "defs.h"
#include "inet.h"

Expand Down
4 changes: 0 additions & 4 deletions src/iface.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/
#ifndef MCD_IFACE_H_
#define MCD_IFACE_H_

Expand Down
5 changes: 0 additions & 5 deletions src/igmp.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#include <stddef.h>
#include <net/ethernet.h>
#include <netinet/if_ether.h>
Expand Down
5 changes: 0 additions & 5 deletions src/igmpv2.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

/*
* Constants for IGMP Version 2. Several of these, especially the
* robustness variable, should be variables and not constants.
Expand Down
36 changes: 3 additions & 33 deletions src/igmpv3.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
/*
* Copyright (c) 1998-2001
* University of Southern California/Information Sciences Institute.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

#ifndef PIMD_IGMPV3_H_
#define PIMD_IGMPV3_H_
#ifndef MCD_IGMPV3_H_
#define MCD_IGMPV3_H_

/*
* IGMPv3 report modes.
Expand Down Expand Up @@ -88,7 +58,7 @@ struct igmpv3_report {
#define IGMP_V3_REPORT_MAXRECS 65535
#endif

#endif /* PIMD_IGMPV3_H_ */
#endif /* MCD_IGMPV3_H_ */

/**
* Local Variables:
Expand Down
5 changes: 0 additions & 5 deletions src/inet.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#include <netdb.h>

#include "defs.h"
Expand Down
5 changes: 0 additions & 5 deletions src/inet.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#ifndef MCD_INET_H_
#define MCD_INET_H_

Expand Down
33 changes: 10 additions & 23 deletions src/ipc.c
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
/*
* Copyright (c) 2018-2020 Joachim Wiberg <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
Expand Down
16 changes: 14 additions & 2 deletions src/ipc.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
* Copyright (c) 2018-2020 Joachim Wiberg <[email protected]>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef MCD_IPC_H_
#define MCD_IPC_H_

Expand Down
5 changes: 0 additions & 5 deletions src/log.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#define SYSLOG_NAMES
#include "defs.h"
#include <stdarg.h>
Expand Down
5 changes: 0 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/

#include "defs.h"
#include <err.h>
#include <getopt.h>
Expand Down
33 changes: 10 additions & 23 deletions src/mctl.c
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
/*
* Copyright (c) 2018-2020 Joachim Wiberg <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include "config.h"
Expand Down
10 changes: 3 additions & 7 deletions src/pathnames.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
/*
* Parts of this program has been derived from mrouted. It is covered
* by the license in the accompanying file named "LICENSE".
*/
#ifndef MCD_PATHNAMES_H_
#define MCD_PATHNAMES_H_

#include <paths.h>

#define _PATH_MCD_CONF SYSCONFDIR "/%s.conf"
#define _PATH_MCD_RUNDIR RUNSTATEDIR
#define _PATH_MCD_SOCK RUNSTATEDIR "/%s.sock"
#define _PATH_MCD_CONF SYSCONFDIR "/%s.conf"
#define _PATH_MCD_RUNDIR RUNSTATEDIR
#define _PATH_MCD_SOCK RUNSTATEDIR "/%s.sock"

#endif /* MCD_PATHNAMES_H_ */

0 comments on commit edb5563

Please sign in to comment.