linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] net/x25: call skb_reset_network_header where needed
@ 2019-04-03  5:01 Martin Schiller
  2019-04-03  5:01 ` [PATCH 2/4] wan/hdlc_x25: fix skb handling Martin Schiller
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Martin Schiller @ 2019-04-03  5:01 UTC (permalink / raw)
  To: andrew.hendry, davem, khc, isdn
  Cc: edumazet, linux-x25, netdev, linux-kernel, Martin Schiller

This fixes some problems like:
 o tcpdump not showing X.25<->LapB Header
 o "protocol 0508 is buggy" warning from I4L

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
---
 net/x25/x25_dev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index 39231237e1c3..eef0305f3e99 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -127,6 +127,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
 
 	case X25_IFACE_DATA:
 		skb_pull(skb, 1);
+		skb_reset_network_header(skb);
 		if (x25_receive_data(skb, nb)) {
 			x25_neigh_put(nb);
 			goto out;
@@ -171,6 +172,8 @@ void x25_establish_link(struct x25_neigh *nb)
 		return;
 	}
 
+	skb_reset_network_header(skb);
+
 	skb->protocol = htons(ETH_P_X25);
 	skb->dev      = nb->dev;
 
@@ -198,6 +201,8 @@ void x25_terminate_link(struct x25_neigh *nb)
 	ptr  = skb_put(skb, 1);
 	*ptr = X25_IFACE_DISCONNECT;
 
+	skb_reset_network_header(skb);
+
 	skb->protocol = htons(ETH_P_X25);
 	skb->dev      = nb->dev;
 	dev_queue_xmit(skb);
@@ -207,8 +212,6 @@ void x25_send_frame(struct sk_buff *skb, struct x25_neigh *nb)
 {
 	unsigned char *dptr;
 
-	skb_reset_network_header(skb);
-
 	switch (nb->dev->type) {
 	case ARPHRD_X25:
 		dptr  = skb_push(skb, 1);
@@ -225,6 +228,8 @@ void x25_send_frame(struct sk_buff *skb, struct x25_neigh *nb)
 		return;
 	}
 
+	skb_reset_network_header(skb);
+
 	skb->protocol = htons(ETH_P_X25);
 	skb->dev      = nb->dev;
 
-- 
2.11.0


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

end of thread, other threads:[~2019-04-08  6:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03  5:01 [PATCH 1/4] net/x25: call skb_reset_network_header where needed Martin Schiller
2019-04-03  5:01 ` [PATCH 2/4] wan/hdlc_x25: fix skb handling Martin Schiller
2019-04-05  0:32   ` David Miller
2019-04-05  6:56     ` Martin Schiller
2019-04-05 19:15       ` David Miller
2019-04-08  6:07         ` Martin Schiller
2019-04-03  5:01 ` [PATCH 3/4] isdn/i4l/isdn_x25iface: call skb_reset_network_header Martin Schiller
2019-04-03  5:01 ` [PATCH 4/4] isdn/i4l: Call notifiers before and after changing device type Martin Schiller

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).