Skip to content

Commit 1cc5f24

Browse files
James MorrisDavid S. Miller
authored andcommitted
[IPVS]: IPVS needs checksum fixups.
Here's an additional patch for ipvs, which also mangles packets via netfilter and was previously depending on the checksum helper in nf_hook_slow(). Signed-of-by: James Morris <jmorris@redhat.com> Signed-of-by: David S. Miller <davem@redhat.com>
1 parent 62105cb commit 1cc5f24

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

net/ipv4/ipvs/ip_vs_core.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,13 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
735735
if (skb->nfcache & NFC_IPVS_PROPERTY)
736736
return NF_ACCEPT;
737737

738+
if (skb->ip_summed == CHECKSUM_HW) {
739+
if (skb_checksum_help(pskb, (out == NULL)))
740+
return NF_DROP;
741+
if (skb != *pskb)
742+
skb = *pskb;
743+
}
744+
738745
iph = skb->nh.iph;
739746
if (unlikely(iph->protocol == IPPROTO_ICMP)) {
740747
int related, verdict = ip_vs_out_icmp(pskb, &related);
@@ -974,6 +981,13 @@ ip_vs_in(unsigned int hooknum, struct sk_buff **pskb,
974981
return NF_ACCEPT;
975982
}
976983

984+
if (skb->ip_summed == CHECKSUM_HW) {
985+
if (skb_checksum_help(pskb, (out == NULL)))
986+
return NF_DROP;
987+
if (skb != *pskb)
988+
skb = *pskb;
989+
}
990+
977991
iph = skb->nh.iph;
978992
if (unlikely(iph->protocol == IPPROTO_ICMP)) {
979993
int related, verdict = ip_vs_in_icmp(pskb, &related);

0 commit comments

Comments
 (0)