diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:55:52 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:23 -0400 |
commit | d626f62b11e00c16e81e4308ab93d3f13551812a (patch) | |
tree | fac4af6ced853755e12fc709d55f0c2bec51265d /net/decnet/dn_nsp_in.c | |
parent | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (diff) |
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
To clearly state the intent of copying from linear sk_buffs, _offset being a
overly long variant but interesting for the sake of saving some bytes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/decnet/dn_nsp_in.c')
-rw-r--r-- | net/decnet/dn_nsp_in.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index d9498a165acf..4074a6e5d0de 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -362,7 +362,8 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
362 | u16 dlen = *skb->data; | 362 | u16 dlen = *skb->data; |
363 | if ((dlen <= 16) && (dlen <= skb->len)) { | 363 | if ((dlen <= 16) && (dlen <= skb->len)) { |
364 | scp->conndata_in.opt_optl = dn_htons(dlen); | 364 | scp->conndata_in.opt_optl = dn_htons(dlen); |
365 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); | 365 | skb_copy_from_linear_data_offset(skb, 1, |
366 | scp->conndata_in.opt_data, dlen); | ||
366 | } | 367 | } |
367 | } | 368 | } |
368 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); | 369 | dn_nsp_send_link(sk, DN_NOCHANGE, 0); |
@@ -406,7 +407,7 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) | |||
406 | u16 dlen = *skb->data; | 407 | u16 dlen = *skb->data; |
407 | if ((dlen <= 16) && (dlen <= skb->len)) { | 408 | if ((dlen <= 16) && (dlen <= skb->len)) { |
408 | scp->discdata_in.opt_optl = dn_htons(dlen); | 409 | scp->discdata_in.opt_optl = dn_htons(dlen); |
409 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); | 410 | skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen); |
410 | } | 411 | } |
411 | } | 412 | } |
412 | 413 | ||