Do not forward multicast packets to prevent packet loops

This commit is contained in:
thorkill 2015-07-14 12:12:19 +02:00
parent e282ed443f
commit 3a99a76fa5

View file

@ -399,6 +399,15 @@ static void route_ipv4(node_t *source, vpn_packet_t *packet) {
return; return;
} }
if (subnet->multicast) {
logger(DEBUG_TRAFFIC, LOG_WARNING, "Ignore multicast from %s (%s) to %d.%d.%d.%d !", source->name, source->hostname,
dest.x[0],
dest.x[1],
dest.x[2],
dest.x[3]);
return;
}
if (!subnet->owner) { if (!subnet->owner) {
broadcast_packet(source, packet); broadcast_packet(source, packet);
return; return;
@ -567,6 +576,22 @@ static void route_ipv6(node_t *source, vpn_packet_t *packet) {
return; return;
} }
if (subnet->multicast) {
// Prevent loops
logger(DEBUG_ALWAYS, LOG_WARNING, "Ignore multicast from %s (%s) to IPv6 source address %hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx",
source->name, source->hostname,
ntohs(dest.x[0]),
ntohs(dest.x[1]),
ntohs(dest.x[2]),
ntohs(dest.x[3]),
ntohs(dest.x[4]),
ntohs(dest.x[5]),
ntohs(dest.x[6]),
ntohs(dest.x[7]));
return;
}
if (!subnet->owner) { if (!subnet->owner) {
// Prevent loops // Prevent loops
if (strictsubnets && !subnet_src) { if (strictsubnets && !subnet_src) {