diff mbox series

[net] drivers/net/wan/hdlc_cisco: Add hard_header_len

Message ID 20200828070752.54444-1-xie.he.0141@gmail.com
State New
Headers show
Series [net] drivers/net/wan/hdlc_cisco: Add hard_header_len | expand

Commit Message

Xie He Aug. 28, 2020, 7:07 a.m. UTC
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>
---
 drivers/net/wan/hdlc_cisco.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Miller Aug. 31, 2020, 7:23 p.m. UTC | #1
From: Xie He <xie.he.0141@gmail.com>
Date: Fri, 28 Aug 2020 00:07:52 -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>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index d8cba3625c18..444130655d8e 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -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);