X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Fcore%2Fskbuff.c;h=86e5682728be339c3930eca391739ba373d908fc;hb=419ae74ecc9494e58928a5c6652f4c072f3ca744;hp=a37127b5899cb58a6a9545a303c908781d17b7db;hpb=8d3308687f7f1eaa1bb5d202d14752d5f90068eb;p=linux-2.6-omap-h63xx.git diff --git a/net/core/skbuff.c b/net/core/skbuff.c index a37127b5899..86e5682728b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -931,6 +931,22 @@ unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) } EXPORT_SYMBOL(skb_pull); +/** + * skb_trim - remove end from a buffer + * @skb: buffer to alter + * @len: new length + * + * Cut the length of a buffer down by removing data from the tail. If + * the buffer is already under the length specified it is not modified. + * The skb must be linear. + */ +void skb_trim(struct sk_buff *skb, unsigned int len) +{ + if (skb->len > len) + __skb_trim(skb, len); +} +EXPORT_SYMBOL(skb_trim); + /* Trims skb to length len. It can change skb pointers. */