Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] drivers/net/wan/hdlc_cisco: Add hard_header_len
@ 2020-08-28  7:07 Xie He
  2020-08-28 10:37 ` Krzysztof Hałasa
  2020-08-31 19:23 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Xie He @ 2020-08-28  7:07 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Krzysztof Halasa, netdev, linux-kernel
  Cc: Xie He, Martin Schiller

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(+)

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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-31 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28  7:07 [PATCH net] drivers/net/wan/hdlc_cisco: Add hard_header_len Xie He
2020-08-28 10:37 ` Krzysztof Hałasa
2020-08-28 21:05   ` Xie He
2020-08-31 19:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).