]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drivers/net/wan/hdlc_cisco: Add hard_header_len
authorXie He <xie.he.0141@gmail.com>
Fri, 28 Aug 2020 07:07:52 +0000 (00:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2020 19:22:43 +0000 (12:22 -0700)
This driver didn't set hard_header_len. This patch sets hard_header_len
for it according to its header_ops->create function.

This driver's header_ops->create function (cisco_hard_header) creates
a header of (struct hdlc_header), so hard_header_len should be set to
sizeof(struct hdlc_header).

Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Acked-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/hdlc_cisco.c

index d8cba3625c185d76b5fd47e97eeaa1ab4900065a..444130655d8ea845ee7395a344f0a57c98aabddf 100644 (file)
@@ -370,6 +370,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
                memcpy(&state(hdlc)->settings, &new_settings, size);
                spin_lock_init(&state(hdlc)->lock);
                dev->header_ops = &cisco_header_ops;
+               dev->hard_header_len = sizeof(struct hdlc_header);
                dev->type = ARPHRD_CISCO;
                call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev);
                netif_dormant_on(dev);