Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions net/ipforward/ipv4_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,18 @@ void ipv4_forward_broadcast(FAR struct net_driver_s *dev,
return;
}

/* Do not forward link-local multicast packets (224.0.0.0/24).
* Per RFC 3171, addresses in 224.0.0.0/24 are reserved for
* link-local scope and MUST NOT be forwarded by any router,
* regardless of TTL.
*/

if ((net_ip4addr_conv32(ipv4->destipaddr) &
HTONL(0xffffff00)) == HTONL(0xe0000000))
{
return;
Comment thread
acassis marked this conversation as resolved.
}

/* Don't bother if the TTL would expire */

if (ipv4->ttl > 1)
Expand Down
11 changes: 11 additions & 0 deletions net/ipforward/ipv6_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,17 @@ void ipv6_forward_broadcast(FAR struct net_driver_s *dev,
return;
}

/* Do not forward reserved, interface-local, or link-local multicast
* destinations (ffx0::/16, ffx1::/16, ffx2::/16).
*/

if (((ipv6->destipaddr[0] & HTONS(0xff0f)) == HTONS(0xff00)) ||
((ipv6->destipaddr[0] & HTONS(0xff0f)) == HTONS(0xff01)) ||
((ipv6->destipaddr[0] & HTONS(0xff0f)) == HTONS(0xff02)))
{
return;
}

/* Don't bother if the TTL would expire */

if (ipv6->ttl > 1)
Expand Down
Loading