[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <65b1f53cc97c4052e2b0bdaa374267eeb9ec3ed2.1381923854.git.mathias.krause@secunet.com>
Date: Tue, 5 Nov 2013 14:54:10 +0100
From: Mathias Krause <mathias.krause@...unet.com>
To: "David S. Miller" <davem@...emloft.net>,
Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@...kless.no>,
netdev@...r.kernel.org,
Mathias Krause <mathias.krause@...unet.com>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH net-next 2/3] caif: use pskb_put() instead of reimplementing its functionality
Also remove the warning for fragmented packets -- skb_cow_data() will
linearize the buffer, removing all fragments.
Signed-off-by: Mathias Krause <mathias.krause@...unet.com>
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@...kless.no>
Cc: "David S. Miller" <davem@...emloft.net>
---
net/caif/cfpkt_skbuff.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c
index 6493351..1be0b52 100644
--- a/net/caif/cfpkt_skbuff.c
+++ b/net/caif/cfpkt_skbuff.c
@@ -203,20 +203,10 @@ int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len)
PKT_ERROR(pkt, "cow failed\n");
return -EPROTO;
}
- /*
- * Is the SKB non-linear after skb_cow_data()? If so, we are
- * going to add data to the last SKB, so we need to adjust
- * lengths of the top SKB.
- */
- if (lastskb != skb) {
- pr_warn("Packet is non-linear\n");
- skb->len += len;
- skb->data_len += len;
- }
}
/* All set to put the last SKB and optionally write data there. */
- to = skb_put(lastskb, len);
+ to = pskb_put(skb, lastskb, len);
if (likely(data))
memcpy(to, data, len);
return 0;
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists