Handle broadcast and multicast packets in router mode.
Multicast packets are treated as broadcast packets. Based on a patch from Max Rijevski.
This commit is contained in:
parent
a5f899a979
commit
de032054de
2 changed files with 13 additions and 2 deletions
1
THANKS
1
THANKS
|
@ -21,6 +21,7 @@ We would like to thank the following people for their contributions to tinc:
|
||||||
* Markus Goetz
|
* Markus Goetz
|
||||||
* Martin Kihlgren
|
* Martin Kihlgren
|
||||||
* Matias Carrasco
|
* Matias Carrasco
|
||||||
|
* Max Rijevski
|
||||||
* Miles Nordin
|
* Miles Nordin
|
||||||
* Nick Patavalis
|
* Nick Patavalis
|
||||||
* Paul Littlefield
|
* Paul Littlefield
|
||||||
|
|
14
src/route.c
14
src/route.c
|
@ -376,7 +376,14 @@ static void route_ipv4(node_t *source, vpn_packet_t *packet)
|
||||||
if(!checklength(source, packet, ether_size + ip_size))
|
if(!checklength(source, packet, ether_size + ip_size))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
route_ipv4_unicast(source, packet);
|
if(packet->data[30] & 0xf0 == 0xe0 ||
|
||||||
|
packet->data[30] == 255 &&
|
||||||
|
packet->data[31] == 255 &&
|
||||||
|
packet->data[32] == 255 &&
|
||||||
|
packet->data[33] == 255)
|
||||||
|
broadcast_packet(source, packet);
|
||||||
|
else
|
||||||
|
route_ipv4_unicast(source, packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RFC 2463 */
|
/* RFC 2463 */
|
||||||
|
@ -645,7 +652,10 @@ static void route_ipv6(node_t *source, vpn_packet_t *packet)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
route_ipv6_unicast(source, packet);
|
if(packet->data[38] == 255)
|
||||||
|
broadcast_packet(source, packet);
|
||||||
|
else
|
||||||
|
route_ipv6_unicast(source, packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RFC 826 */
|
/* RFC 826 */
|
||||||
|
|
Loading…
Add table
Reference in a new issue