net: ethernet: Check IPv4 multicast pkt using util function
Instead of directly checking the multicast IPv4 address, use the net_ipv4_is_addr_mcast() utility function. Fixes #26584 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
9a791dd6bb
commit
ccea4d3258
1 changed files with 2 additions and 2 deletions
|
@ -321,7 +321,7 @@ static inline bool ethernet_ipv4_dst_is_broadcast_or_mcast(struct net_pkt *pkt)
|
||||||
{
|
{
|
||||||
if (net_ipv4_is_addr_bcast(net_pkt_iface(pkt),
|
if (net_ipv4_is_addr_bcast(net_pkt_iface(pkt),
|
||||||
&NET_IPV4_HDR(pkt)->dst) ||
|
&NET_IPV4_HDR(pkt)->dst) ||
|
||||||
NET_IPV4_HDR(pkt)->dst.s4_addr[0] == 224U) {
|
net_ipv4_is_addr_mcast(&NET_IPV4_HDR(pkt)->dst)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ static bool ethernet_fill_in_dst_on_ipv4_mcast(struct net_pkt *pkt,
|
||||||
struct net_eth_addr *dst)
|
struct net_eth_addr *dst)
|
||||||
{
|
{
|
||||||
if (net_pkt_family(pkt) == AF_INET &&
|
if (net_pkt_family(pkt) == AF_INET &&
|
||||||
NET_IPV4_HDR(pkt)->dst.s4_addr[0] == 224U) {
|
net_ipv4_is_addr_mcast(&NET_IPV4_HDR(pkt)->dst)) {
|
||||||
/* Multicast address */
|
/* Multicast address */
|
||||||
dst->addr[0] = 0x01;
|
dst->addr[0] = 0x01;
|
||||||
dst->addr[1] = 0x00;
|
dst->addr[1] = 0x00;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue