From: Jakub Kicinski <kubakici@wp.pl>
To: Martin Schiller <ms@dev.tdt.de>
Cc: khc@pm.waw.pl, davem@davemloft.net, linux-x25@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] wan/hdlc_x25: fix skb handling
Date: Mon, 13 Jan 2020 05:44:21 -0800 [thread overview]
Message-ID: <20200113054421.55cd5ddc@cakuba> (raw)
In-Reply-To: <20200113124551.2570-2-ms@dev.tdt.de>
On Mon, 13 Jan 2020 13:45:51 +0100, Martin Schiller wrote:
> o call skb_reset_network_header() before hdlc->xmit()
> o change skb proto to HDLC (0x0019) before hdlc->xmit()
> o call dev_queue_xmit_nit() before hdlc->xmit()
>
> This changes make it possible to trace (tcpdump) outgoing layer2
> (ETH_P_HDLC) packets
>
> o use a copy of the skb for lapb_data_request() in x25_xmit()
It's not clear to me why
> This fixes the problem, that tracing layer3 (ETH_P_X25) packets
> results in a malformed first byte of the packets.
>
> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
> ---
> drivers/net/wan/hdlc_x25.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
> index b28051eba736..434e5263eddf 100644
> --- a/drivers/net/wan/hdlc_x25.c
> +++ b/drivers/net/wan/hdlc_x25.c
> @@ -72,6 +72,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
> unsigned char *ptr;
>
> skb_push(skb, 1);
> + skb_reset_network_header(skb);
>
> if (skb_cow(skb, 1))
This skb_cow() here is for the next handler down to have a 1 byte of
headroom guaranteed? It'd seem more natural to have skb_cow before the
push.. not that it's related to your patch.
> return NET_RX_DROP;
> @@ -88,6 +89,9 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
> static void x25_data_transmit(struct net_device *dev, struct sk_buff *skb)
> {
> hdlc_device *hdlc = dev_to_hdlc(dev);
Please insert a new line after the variable declaration since you're
touching this one.
> + skb_reset_network_header(skb);
> + skb->protocol = hdlc_type_trans(skb, dev);
> + dev_queue_xmit_nit(skb, dev);
> hdlc->xmit(skb, dev); /* Ignore return value :-( */
> }
>
next prev parent reply other threads:[~2020-01-13 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 12:45 [PATCH 1/2] wan/hdlc_x25: make lapb params configurable Martin Schiller
2020-01-13 12:45 ` [PATCH 2/2] wan/hdlc_x25: fix skb handling Martin Schiller
2020-01-13 13:44 ` Jakub Kicinski [this message]
2020-01-14 8:10 ` Martin Schiller
2020-01-13 13:53 ` [PATCH 1/2] wan/hdlc_x25: make lapb params configurable Jakub Kicinski
2020-01-14 5:37 ` Martin Schiller
2020-01-14 12:51 ` Jakub Kicinski
2020-01-14 13:33 ` Martin Schiller
2020-01-14 13:45 ` Jakub Kicinski
2020-03-26 6:08 ` Krzysztof Hałasa
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=20200113054421.55cd5ddc@cakuba \
--to=kubakici@wp.pl \
--cc=davem@davemloft.net \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=ms@dev.tdt.de \
--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