[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG48ez3CWxvHataMKwQ5oAJ=cMo0ykuGo4zEAPrHnx=Cs+JaQw@mail.gmail.com>
Date: Thu, 14 Feb 2019 23:00:59 +0100
From: Jann Horn <jannh@...gle.com>
To: "David S. Miller" <davem@...emloft.net>,
Jann Horn <jannh@...gle.com>, abi.dmitryt@...il.com
Cc: Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: caif: use skb helpers instead of
open-coding them
On Thu, Feb 14, 2019 at 10:35 PM Jann Horn <jannh@...gle.com> wrote:
> Use existing skb_put_data() and skb_trim() instead of open-coding them,
> with the skb_put_data() first so that logically, `skb` still contains the
> data to be copied in its data..tail area when skb_put_data() reads it.
> This change on its own is a cleanup, and it is also necessary for potential
> future integration of skbuffs with things like KASAN.
The maintainer's email address (dmitry.tarnyagin@...kless.no) bounces
with a "553 5.3.0 <dmitry.tarnyagin@...kless.no>... No such user
here". His second address that shows up in the git log,
dmitry.tarnyagin@...ricsson.com, also doesn't exist:
$ dig +short stericsson.com MX
10 mxb-00178001.gslb.pphosted.com.
10 mxa-00178001.gslb.pphosted.com.
$ nc -vC mxa-00178001.gslb.pphosted.com 25
Connection to mxa-00178001.gslb.pphosted.com 25 port [tcp/smtp] succeeded!
220 mx07-00178001.pphosted.com ESMTP mfa-m0046668
HELO thejh.net
250 mx07-00178001.pphosted.com Hello {...} (may be forged), pleased to meet you
MAIL FROM: <test@...jh.net>
250 2.1.0 Sender ok
RCPT TO: <dmitry.tarnyagin@...ricsson.com>
550 5.1.1 User Unknown
But his third address from a commit he made in 2011,
abi.dmitryt@...il.com, does exist, so I'm CC'ing that now.
@Dmitry Tarnyagin: Do you still consider yourself to be the maintainer
of the CAIF subsystem? MAINTAINERS currently lists it as "Supported"
by you, which is defined as "Someone is actually paid to look after
this".
> Signed-off-by: Jann Horn <jannh@...gle.com>
> ---
> net/caif/cfpkt_skbuff.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c
> index 38c2b7a890dd..37ac5ca0ffdf 100644
> --- a/net/caif/cfpkt_skbuff.c
> +++ b/net/caif/cfpkt_skbuff.c
> @@ -319,16 +319,12 @@ struct cfpkt *cfpkt_append(struct cfpkt *dstpkt,
> if (tmppkt == NULL)
> return NULL;
> tmp = pkt_to_skb(tmppkt);
> - skb_set_tail_pointer(tmp, dstlen);
> - tmp->len = dstlen;
> - memcpy(tmp->data, dst->data, dstlen);
> + skb_put_data(tmp, dst->data, dstlen);
> cfpkt_destroy(dstpkt);
> dst = tmp;
> }
> - memcpy(skb_tail_pointer(dst), add->data, skb_headlen(add));
> + skb_put_data(dst, add->data, skb_headlen(add));
> cfpkt_destroy(addpkt);
> - dst->tail += addlen;
> - dst->len += addlen;
> return skb_to_pkt(dst);
> }
>
> @@ -359,13 +355,11 @@ struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos)
> if (skb2 == NULL)
> return NULL;
>
> + skb_put_data(skb2, split, len2nd);
> +
> /* Reduce the length of the original packet */
> - skb_set_tail_pointer(skb, pos);
> - skb->len = pos;
> + skb_trim(skb, pos);
>
> - memcpy(skb2->data, split, len2nd);
> - skb2->tail += len2nd;
> - skb2->len += len2nd;
> skb2->priority = skb->priority;
> return skb_to_pkt(skb2);
> }
> --
> 2.21.0.rc0.258.g878e2cd30e-goog
>
Powered by blists - more mailing lists