Skip to content

Commit

Permalink
do not forward multicast
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Jun 6, 2024
1 parent 02cc2e8 commit 0ab0778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ipv4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ void ipv4::operator()()
int payload_size = size - header_size;

if (pkt_dst != myip) {
if (forward) {
// do not forward multicast
if (forward && (pkt_dst[0] & 0xf0) != 224) {
CDOLOG(ll_debug, pkt->get_log_prefix().c_str(), "forwarding packet to router\n");

r->route_packet({ }, 0x0800, pkt_dst, pkt->get_src_mac_addr(), pkt_src, p, size);
Expand Down

0 comments on commit 0ab0778

Please sign in to comment.