use eth_broadcast_addr() to assign broadcast address

Using eth_broadcast_addr() to assign broadcast address instead
of copying from an array that contains the all-ones broadcast
address

Port 78adf574c969c14a470b686af8d6bd7e1dcf142b
Port 3b0a4a1bdb0f6348dba797a0fa1cf161f5639ded
Port 44c26bec861476f89ac5aee0bb19df128a42543b

Link: https://lore.kernel.org/r/20210616081243.2511663-4-yangyingliang@huawei.com
This commit is contained in:
Carlos Garces
2021-10-20 19:02:50 +02:00
parent 77e7d6747c
commit 27246f4eb5
6 changed files with 15 additions and 27 deletions

View File

@@ -811,7 +811,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
if (*((unsigned char *)&iph->daddr + 3) == 0xff) {
/* L2 is unicast but L3 is broadcast, make L2 bacome broadcast */
RTW_INFO("NAT25: Set DA as boardcast\n");
memset(skb->data, 0xff, ETH_ALEN);
eth_broadcast_addr(skb->data);
} else {
/* forward unknow IP packet to upper TCP/IP */
RTW_INFO("NAT25: Replace DA with BR's MAC\n");