Skip to content

Commit df95908

Browse files
Old-DingRbb666
authored andcommitted
bsp: zynqmp-r5: Fix IGMP multicast range check
Reject IPv4 addresses outside 224.0.0.0/4 before updating the multicast MAC hash. The previous condition used AND, so it could never reject a non-multicast first octet. Generated-by: OpenAI Codex Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
1 parent 858433a commit df95908

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • bsp/zynqmp-r5-axu4ev/drivers/Zynq_HAL_Driver/xemacpsif

‎bsp/zynqmp-r5-axu4ev/drivers/Zynq_HAL_Driver/xemacpsif/xemacpsif.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static err_t xemacpsif_mac_filter_update (struct netif *netif, ip_addr_t *group,
632632
unsigned int i;
633633
u8_t * ip_addr = (u8_t *) group;
634634

635-
if ((ip_addr[0] < 224) && (ip_addr[0] > 239)) {
635+
if ((ip_addr[0] < 224) || (ip_addr[0] > 239)) {
636636
LWIP_DEBUGF(NETIF_DEBUG,
637637
("%s: The requested MAC address is not a multicast address.\r\n", __func__));
638638
LWIP_DEBUGF(NETIF_DEBUG,

0 commit comments

Comments
 (0)