ethernet: Add helper for assigning packet type when dest address does not match device address

[ Upstream commit 6e159fd653d7ebf6290358e0330a0cb8a75cf73b ]

Enable reuse of logic in eth_type_trans for determining packet type.

Suggested-by: Sabrina Dubroca <sd@queasysnail.net>
Cc: stable@vger.kernel.org
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/20240423181319.115860-3-rrameshbabu@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 3d63a6c77b51c1a7cef2987a7f70ec9d91b04d95)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2 files changed