skb_copy_and_csum_bits(): don't bother with the last argument
it's always 0 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9123e3a74e
commit
8d5930dfb7
@ -1168,7 +1168,7 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)
|
|||||||
*(__sum16 *)(skb->data + offset) = 0;
|
*(__sum16 *)(skb->data + offset) = 0;
|
||||||
csum = skb_copy_and_csum_bits(skb, start,
|
csum = skb_copy_and_csum_bits(skb, start,
|
||||||
nskb->data + start,
|
nskb->data + start,
|
||||||
skb->len - start, 0);
|
skb->len - start);
|
||||||
|
|
||||||
/* add in the header checksums */
|
/* add in the header checksums */
|
||||||
if (skb->protocol == htons(ETH_P_IP)) {
|
if (skb->protocol == htons(ETH_P_IP)) {
|
||||||
|
@ -3535,7 +3535,7 @@ int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags);
|
|||||||
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
|
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
|
||||||
int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
|
int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
|
||||||
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
|
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
|
||||||
int len, __wsum csum);
|
int len);
|
||||||
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
|
int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
|
||||||
struct pipe_inode_info *pipe, unsigned int len,
|
struct pipe_inode_info *pipe, unsigned int len,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
@ -2723,19 +2723,20 @@ EXPORT_SYMBOL(skb_checksum);
|
|||||||
/* Both of above in one bottle. */
|
/* Both of above in one bottle. */
|
||||||
|
|
||||||
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
|
__wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
|
||||||
u8 *to, int len, __wsum csum)
|
u8 *to, int len)
|
||||||
{
|
{
|
||||||
int start = skb_headlen(skb);
|
int start = skb_headlen(skb);
|
||||||
int i, copy = start - offset;
|
int i, copy = start - offset;
|
||||||
struct sk_buff *frag_iter;
|
struct sk_buff *frag_iter;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
__wsum csum = 0;
|
||||||
|
|
||||||
/* Copy header. */
|
/* Copy header. */
|
||||||
if (copy > 0) {
|
if (copy > 0) {
|
||||||
if (copy > len)
|
if (copy > len)
|
||||||
copy = len;
|
copy = len;
|
||||||
csum = csum_partial_copy_nocheck(skb->data + offset, to,
|
csum = csum_partial_copy_nocheck(skb->data + offset, to,
|
||||||
copy, csum);
|
copy, 0);
|
||||||
if ((len -= copy) == 0)
|
if ((len -= copy) == 0)
|
||||||
return csum;
|
return csum;
|
||||||
offset += copy;
|
offset += copy;
|
||||||
@ -2791,7 +2792,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
|
|||||||
copy = len;
|
copy = len;
|
||||||
csum2 = skb_copy_and_csum_bits(frag_iter,
|
csum2 = skb_copy_and_csum_bits(frag_iter,
|
||||||
offset - start,
|
offset - start,
|
||||||
to, copy, 0);
|
to, copy);
|
||||||
csum = csum_block_add(csum, csum2, pos);
|
csum = csum_block_add(csum, csum2, pos);
|
||||||
if ((len -= copy) == 0)
|
if ((len -= copy) == 0)
|
||||||
return csum;
|
return csum;
|
||||||
@ -3011,7 +3012,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
|
|||||||
csum = 0;
|
csum = 0;
|
||||||
if (csstart != skb->len)
|
if (csstart != skb->len)
|
||||||
csum = skb_copy_and_csum_bits(skb, csstart, to + csstart,
|
csum = skb_copy_and_csum_bits(skb, csstart, to + csstart,
|
||||||
skb->len - csstart, 0);
|
skb->len - csstart);
|
||||||
|
|
||||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||||
long csstuff = csstart + skb->csum_offset;
|
long csstuff = csstart + skb->csum_offset;
|
||||||
@ -3932,7 +3933,7 @@ normal:
|
|||||||
skb_copy_and_csum_bits(head_skb, offset,
|
skb_copy_and_csum_bits(head_skb, offset,
|
||||||
skb_put(nskb,
|
skb_put(nskb,
|
||||||
len),
|
len),
|
||||||
len, 0);
|
len);
|
||||||
SKB_GSO_CB(nskb)->csum_start =
|
SKB_GSO_CB(nskb)->csum_start =
|
||||||
skb_headroom(nskb) + doffset;
|
skb_headroom(nskb) + doffset;
|
||||||
} else {
|
} else {
|
||||||
|
@ -352,7 +352,7 @@ static int icmp_glue_bits(void *from, char *to, int offset, int len, int odd,
|
|||||||
|
|
||||||
csum = skb_copy_and_csum_bits(icmp_param->skb,
|
csum = skb_copy_and_csum_bits(icmp_param->skb,
|
||||||
icmp_param->offset + offset,
|
icmp_param->offset + offset,
|
||||||
to, len, 0);
|
to, len);
|
||||||
|
|
||||||
skb->csum = csum_block_add(skb->csum, csum, odd);
|
skb->csum = csum_block_add(skb->csum, csum, odd);
|
||||||
if (icmp_pointers[icmp_param->data.icmph.type].error)
|
if (icmp_pointers[icmp_param->data.icmph.type].error)
|
||||||
|
@ -1126,7 +1126,7 @@ alloc_new_skb:
|
|||||||
if (fraggap) {
|
if (fraggap) {
|
||||||
skb->csum = skb_copy_and_csum_bits(
|
skb->csum = skb_copy_and_csum_bits(
|
||||||
skb_prev, maxfraglen,
|
skb_prev, maxfraglen,
|
||||||
data + transhdrlen, fraggap, 0);
|
data + transhdrlen, fraggap);
|
||||||
skb_prev->csum = csum_sub(skb_prev->csum,
|
skb_prev->csum = csum_sub(skb_prev->csum,
|
||||||
skb->csum);
|
skb->csum);
|
||||||
data += fraggap;
|
data += fraggap;
|
||||||
@ -1411,7 +1411,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
|
|||||||
skb->csum = skb_copy_and_csum_bits(skb_prev,
|
skb->csum = skb_copy_and_csum_bits(skb_prev,
|
||||||
maxfraglen,
|
maxfraglen,
|
||||||
skb_transport_header(skb),
|
skb_transport_header(skb),
|
||||||
fraggap, 0);
|
fraggap);
|
||||||
skb_prev->csum = csum_sub(skb_prev->csum,
|
skb_prev->csum = csum_sub(skb_prev->csum,
|
||||||
skb->csum);
|
skb->csum);
|
||||||
pskb_trim_unique(skb_prev, maxfraglen);
|
pskb_trim_unique(skb_prev, maxfraglen);
|
||||||
|
@ -314,10 +314,10 @@ static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, st
|
|||||||
{
|
{
|
||||||
struct icmpv6_msg *msg = (struct icmpv6_msg *) from;
|
struct icmpv6_msg *msg = (struct icmpv6_msg *) from;
|
||||||
struct sk_buff *org_skb = msg->skb;
|
struct sk_buff *org_skb = msg->skb;
|
||||||
__wsum csum = 0;
|
__wsum csum;
|
||||||
|
|
||||||
csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset,
|
csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset,
|
||||||
to, len, csum);
|
to, len);
|
||||||
skb->csum = csum_block_add(skb->csum, csum, odd);
|
skb->csum = csum_block_add(skb->csum, csum, odd);
|
||||||
if (!(msg->type & ICMPV6_INFOMSG_MASK))
|
if (!(msg->type & ICMPV6_INFOMSG_MASK))
|
||||||
nf_ct_attach(skb, org_skb);
|
nf_ct_attach(skb, org_skb);
|
||||||
|
@ -1615,7 +1615,7 @@ alloc_new_skb:
|
|||||||
if (fraggap) {
|
if (fraggap) {
|
||||||
skb->csum = skb_copy_and_csum_bits(
|
skb->csum = skb_copy_and_csum_bits(
|
||||||
skb_prev, maxfraglen,
|
skb_prev, maxfraglen,
|
||||||
data + transhdrlen, fraggap, 0);
|
data + transhdrlen, fraggap);
|
||||||
skb_prev->csum = csum_sub(skb_prev->csum,
|
skb_prev->csum = csum_sub(skb_prev->csum,
|
||||||
skb->csum);
|
skb->csum);
|
||||||
data += fraggap;
|
data += fraggap;
|
||||||
|
@ -70,7 +70,7 @@ static size_t xdr_skb_read_and_csum_bits(struct xdr_skb_reader *desc, void *to,
|
|||||||
if (len > desc->count)
|
if (len > desc->count)
|
||||||
len = desc->count;
|
len = desc->count;
|
||||||
pos = desc->offset;
|
pos = desc->offset;
|
||||||
csum2 = skb_copy_and_csum_bits(desc->skb, pos, to, len, 0);
|
csum2 = skb_copy_and_csum_bits(desc->skb, pos, to, len);
|
||||||
desc->csum = csum_block_add(desc->csum, csum2, pos);
|
desc->csum = csum_block_add(desc->csum, csum2, pos);
|
||||||
desc->count -= len;
|
desc->count -= len;
|
||||||
desc->offset += len;
|
desc->offset += len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user