net: hdlc_fr: Add support for any Ethertype
authorXie He <xie.he.0141@gmail.com>
Sat, 31 Oct 2020 18:10:43 +0000 (11:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 23:19:21 +0000 (15:19 -0800)
commit54b77a77e30a5170a25cfd2f211e08ea5a6c0c4c
treeb03ee3ca633fd7d35cc9f77d2721ed9a0e80e4b3
parent77124c4463d45083e69b7284415467737f31f76b
net: hdlc_fr: Add support for any Ethertype

Change the fr_rx function to make this driver support any Ethertype
when receiving skbs on normal (non-Ethernet-emulating) PVC devices.
(This driver is already able to handle any Ethertype when sending.)

Originally in the fr_rx function, the code that parses the long (10-byte)
header only recognizes a few Ethertype values and drops frames with other
Ethertype values. This patch replaces this code to make fr_rx support
any Ethertype. This patch also creates a new function fr_snap_parse as
part of the new code.

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wan/hdlc_fr.c