X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Froute.c;h=ec01491cd5f35979f1269c5d2a2c5357ea006c0d;hb=c81f90b91a054eeafcc3c8c45abc52045e4a8146;hp=0123107e4acabc444efbc8767d07410a26939396;hpb=134dc8995b296b0bd8b346617c705204b0f3125c;p=tinc diff --git a/src/route.c b/src/route.c index 0123107e..ec01491c 100644 --- a/src/route.c +++ b/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)) 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 */ @@ -645,7 +652,10 @@ static void route_ipv6(node_t *source, vpn_packet_t *packet) return; } - route_ipv6_unicast(source, packet); + if(packet->data[38] == 255) + broadcast_packet(source, packet); + else + route_ipv6_unicast(source, packet); } /* RFC 826 */