From bc7c938f1853c156edc9edd0cd7b7f55f171e9dc Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Sat, 23 Nov 2024 15:52:43 +0300 Subject: [PATCH] ipfw: fix order of memcpy arguments. This fixes `ipfw table N lookup addr` command for MAC tables. (cherry picked from commit e012d79c9c732a6aef21066feba2e5e48833cca4) --- sys/netpfil/ipfw/ip_fw_table_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw_table_algo.c b/sys/netpfil/ipfw/ip_fw_table_algo.c index 89e6b69bc3a..ccc1a809858 100644 --- a/sys/netpfil/ipfw/ip_fw_table_algo.c +++ b/sys/netpfil/ipfw/ip_fw_table_algo.c @@ -4306,7 +4306,7 @@ ta_find_mac_radix_tentry(void *ta_state, struct table_info *ti, if (tent->subtype == AF_LINK) { struct sa_mac sa; KEY_LEN(sa) = KEY_LEN_MAC; - memcpy(tent->k.mac, sa.mac_addr.octet, ETHER_ADDR_LEN); + memcpy(sa.mac_addr.octet, tent->k.mac, ETHER_ADDR_LEN); rnh = (struct radix_node_head *)ti->state; e = rnh->rnh_matchaddr(&sa, &rnh->rh); }