Skip to content

Commit 8e85d7d

Browse files
Charles E. Yousegalak
authored andcommitted
net/ip: fix input packet filtering criteria
The "is this packet for us?" filter in net_ipv4_input() has a minor logic error which fails to discard many packets which are.. not for us. Fixes: #14647 Signed-off-by: Charles E. Youse <[email protected]>
1 parent 6b62e5e commit 8e85d7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/ip/ipv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ enum net_verdict net_ipv4_input(struct net_pkt *pkt)
165165
goto drop;
166166
}
167167

168-
if (!net_ipv4_is_my_addr(&hdr->dst) &&
169-
!net_ipv4_is_addr_mcast(&hdr->dst) &&
168+
if ((!net_ipv4_is_my_addr(&hdr->dst) &&
169+
!net_ipv4_is_addr_mcast(&hdr->dst)) ||
170170
((hdr->proto == IPPROTO_UDP &&
171171
net_ipv4_addr_cmp(&hdr->dst, net_ipv4_broadcast_address()) &&
172172
!IS_ENABLED(CONFIG_NET_DHCPV4)) ||

0 commit comments

Comments
 (0)