realtek: correct egress frame port verification
Destination switch ports for outgoing frame can range from 0 to CPU_PORT-1. Refactor the code to only generate egress frame CPU headers when a valid destination port number is available, and make the code a bit more consistent between different switch generations. Change the dest_port argument's type to 'unsigned int', since only positive values are valid. This fixes the issue where egress frames on switch port 0 did not receive a VLAN tag, because they are sent out without a CPU header. Also fixes a potential issue with invalid (negative) egress port numbers on RTL93xx switches. Reported-by: NArınç ÜNAL <arinc.unal@xeront.com> Suggested-by: NBirger Koblitz <mail@birger-koblitz.de> Tested-by: NLuiz Angelo Daros de Luca <luizluca@gmail.com> Signed-off-by: NSander Vanheule <sander@svanheule.net>
Showing