diff options
| author | Tony Luck <tony.luck@intel.com> | 2005-08-22 17:31:36 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2005-08-22 17:31:36 -0400 |
| commit | 729c80c6ffd7633210a09d4b55fdfab3c8d1866b (patch) | |
| tree | a8fe47dfa3da91b9902e61c55a811d3a66614fc8 /net/ipv4 | |
| parent | 4eaefb39528b3a78fb6a784162200b198d3e16ee (diff) | |
| parent | f6fdd7d9c273bb2a20ab467cb57067494f932fa3 (diff) | |
Auto-update from upstream
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/icmp.c | 12 | ||||
| -rw-r--r-- | net/ipv4/ipcomp.c | 2 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ipt_ECN.c | 17 | ||||
| -rw-r--r-- | net/ipv4/netfilter/ipt_TCPMSS.c | 7 |
4 files changed, 20 insertions, 18 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 3d78464f64ea..badfc5849973 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
| @@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, | |||
| 349 | { | 349 | { |
| 350 | struct sk_buff *skb; | 350 | struct sk_buff *skb; |
| 351 | 351 | ||
| 352 | ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, | 352 | if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, |
| 353 | icmp_param->data_len+icmp_param->head_len, | 353 | icmp_param->data_len+icmp_param->head_len, |
| 354 | icmp_param->head_len, | 354 | icmp_param->head_len, |
| 355 | ipc, rt, MSG_DONTWAIT); | 355 | ipc, rt, MSG_DONTWAIT) < 0) |
| 356 | 356 | ip_flush_pending_frames(icmp_socket->sk); | |
| 357 | if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { | 357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { |
| 358 | struct icmphdr *icmph = skb->h.icmph; | 358 | struct icmphdr *icmph = skb->h.icmph; |
| 359 | unsigned int csum = 0; | 359 | unsigned int csum = 0; |
| 360 | struct sk_buff *skb1; | 360 | struct sk_buff *skb1; |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 2065944fd9e5..7ded6e60f43a 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
| @@ -358,7 +358,7 @@ static struct crypto_tfm **ipcomp_alloc_tfms(const char *alg_name) | |||
| 358 | int cpu; | 358 | int cpu; |
| 359 | 359 | ||
| 360 | /* This can be any valid CPU ID so we don't need locking. */ | 360 | /* This can be any valid CPU ID so we don't need locking. */ |
| 361 | cpu = smp_processor_id(); | 361 | cpu = raw_smp_processor_id(); |
| 362 | 362 | ||
| 363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { | 363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { |
| 364 | struct crypto_tfm *tfm; | 364 | struct crypto_tfm *tfm; |
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index ada9911118e9..94a0ce1c1c9d 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c | |||
| @@ -61,16 +61,20 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
| 61 | if (!tcph) | 61 | if (!tcph) |
| 62 | return 0; | 62 | return 0; |
| 63 | 63 | ||
| 64 | if (!(einfo->operation & IPT_ECN_OP_SET_ECE | 64 | if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) || |
| 65 | || tcph->ece == einfo->proto.tcp.ece) | 65 | tcph->ece == einfo->proto.tcp.ece) && |
| 66 | && (!(einfo->operation & IPT_ECN_OP_SET_CWR | 66 | ((!(einfo->operation & IPT_ECN_OP_SET_CWR) || |
| 67 | || tcph->cwr == einfo->proto.tcp.cwr))) | 67 | tcph->cwr == einfo->proto.tcp.cwr))) |
| 68 | return 1; | 68 | return 1; |
| 69 | 69 | ||
| 70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) | 70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) |
| 71 | return 0; | 71 | return 0; |
| 72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; | 72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; |
| 73 | 73 | ||
| 74 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
| 75 | skb_checksum_help(*pskb, inward)) | ||
| 76 | return 0; | ||
| 77 | |||
| 74 | diffs[0] = ((u_int16_t *)tcph)[6]; | 78 | diffs[0] = ((u_int16_t *)tcph)[6]; |
| 75 | if (einfo->operation & IPT_ECN_OP_SET_ECE) | 79 | if (einfo->operation & IPT_ECN_OP_SET_ECE) |
| 76 | tcph->ece = einfo->proto.tcp.ece; | 80 | tcph->ece = einfo->proto.tcp.ece; |
| @@ -79,13 +83,10 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
| 79 | diffs[1] = ((u_int16_t *)tcph)[6]; | 83 | diffs[1] = ((u_int16_t *)tcph)[6]; |
| 80 | diffs[0] = diffs[0] ^ 0xFFFF; | 84 | diffs[0] = diffs[0] ^ 0xFFFF; |
| 81 | 85 | ||
| 82 | if ((*pskb)->ip_summed != CHECKSUM_HW) | 86 | if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY) |
| 83 | tcph->check = csum_fold(csum_partial((char *)diffs, | 87 | tcph->check = csum_fold(csum_partial((char *)diffs, |
| 84 | sizeof(diffs), | 88 | sizeof(diffs), |
| 85 | tcph->check^0xFFFF)); | 89 | tcph->check^0xFFFF)); |
| 86 | else | ||
| 87 | if (skb_checksum_help(*pskb, inward)) | ||
| 88 | return 0; | ||
| 89 | (*pskb)->nfcache |= NFC_ALTERED; | 90 | (*pskb)->nfcache |= NFC_ALTERED; |
| 90 | return 1; | 91 | return 1; |
| 91 | } | 92 | } |
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c index 1049050b2bfb..7b84a254440e 100644 --- a/net/ipv4/netfilter/ipt_TCPMSS.c +++ b/net/ipv4/netfilter/ipt_TCPMSS.c | |||
| @@ -61,6 +61,10 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
| 61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) | 61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) |
| 62 | return NF_DROP; | 62 | return NF_DROP; |
| 63 | 63 | ||
| 64 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
| 65 | skb_checksum_help(*pskb, out == NULL)) | ||
| 66 | return NF_DROP; | ||
| 67 | |||
| 64 | iph = (*pskb)->nh.iph; | 68 | iph = (*pskb)->nh.iph; |
| 65 | tcplen = (*pskb)->len - iph->ihl*4; | 69 | tcplen = (*pskb)->len - iph->ihl*4; |
| 66 | 70 | ||
| @@ -186,9 +190,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
| 186 | newmss); | 190 | newmss); |
| 187 | 191 | ||
| 188 | retmodified: | 192 | retmodified: |
| 189 | /* We never hw checksum SYN packets. */ | ||
| 190 | BUG_ON((*pskb)->ip_summed == CHECKSUM_HW); | ||
| 191 | |||
| 192 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; | 193 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; |
| 193 | return IPT_CONTINUE; | 194 | return IPT_CONTINUE; |
| 194 | } | 195 | } |
