From: Martin Schiller <ms@dev.tdt.de>
To: andrew.hendry@gmail.com, davem@davemloft.net, khc@pm.waw.pl,
isdn@linux-pingi.de
Cc: edumazet@google.com, linux-x25@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Martin Schiller <ms@dev.tdt.de>
Subject: [PATCH 3/4] isdn/i4l/isdn_x25iface: call skb_reset_network_header
Date: Wed, 3 Apr 2019 07:01:17 +0200 [thread overview]
Message-ID: <20190403050118.12785-3-ms@dev.tdt.de> (raw)
In-Reply-To: <20190403050118.12785-1-ms@dev.tdt.de>
... after skb_push() / skb_pull().
This fixes the output of tcpdump.
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
---
drivers/isdn/i4l/isdn_x25iface.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
index 48bfbcb4a09d..ffd50fa47111 100644
--- a/drivers/isdn/i4l/isdn_x25iface.c
+++ b/drivers/isdn/i4l/isdn_x25iface.c
@@ -194,6 +194,7 @@ static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb
if (((ix25_pdata_t *)(cprot->proto_data))
->state == WAN_CONNECTED) {
if (skb_push(skb, 1)) {
+ skb_reset_network_header(skb);
skb->data[0] = X25_IFACE_DATA;
skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb);
@@ -225,6 +226,7 @@ static int isdn_x25iface_connect_ind(struct concap_proto *cprot)
skb = dev_alloc_skb(1);
if (skb) {
skb_put_u8(skb, X25_IFACE_CONNECT);
+ skb_reset_network_header(skb);
skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb);
return 0;
@@ -254,6 +256,7 @@ static int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
skb = dev_alloc_skb(1);
if (skb) {
skb_put_u8(skb, X25_IFACE_DISCONNECT);
+ skb_reset_network_header(skb);
skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb);
return 0;
@@ -278,10 +281,14 @@ static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
case X25_IFACE_DATA:
if (*state == WAN_CONNECTED) {
skb_pull(skb, 1);
+ skb_reset_network_header(skb);
netif_trans_update(cprot->net_dev);
ret = (cprot->dops->data_req(cprot, skb));
/* prepare for future retransmissions */
- if (ret) skb_push(skb, 1);
+ if (ret) {
+ skb_push(skb, 1);
+ skb_reset_network_header(skb);
+ }
return ret;
}
illegal_state_warn(*state, firstbyte);
--
2.11.0
next prev parent reply other threads:[~2019-04-03 5:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Martin Schiller [this message]
2019-04-03 5:01 ` [PATCH 4/4] isdn/i4l: Call notifiers before and after changing device type Martin Schiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190403050118.12785-3-ms@dev.tdt.de \
--to=ms@dev.tdt.de \
--cc=andrew.hendry@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=isdn@linux-pingi.de \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox