Open mentalmap opened 9 years ago
ip_vs_proto_udp.c 397行 改为 } else if (!cp->app && (udph->check != 0)) {
ip_vs_proto_udp.c 397行 改为 } else if (!cp->app && (udph->check != 0)) {
397行是注释
ip_vs_proto_udp.c 397行 改为 } else if (!cp->app && (udph->check != 0)) {
397行是注释 @dhh123 我说的是v2分支,master udp不支持fullnat吧
ip_vs_proto_udp.c 397行 改为 } else if (!cp->app && (udph->check != 0)) {
397行是注释 @dhh123 我说的是v2分支,master udp不支持fullnat吧
fullnat我用的是兼容戴尔硬件的这个版本,不知道改动哪里能解决checksum的问题,请指教一下。https://jeffrycheng.com/2017/03/31/%E5%9C%A8R730%E4%B8%8A%E5%AE%89%E8%A3%85lvs-fullnat/ 。另外我是用了您的lvs-snat 同样不兼容硬件问题,我把您的代码迁移到了2.6.32.358版本,编译和测试也没发现什么问题。
ip_vs_proto_udp.c里找到udp_fnat_in_handler, udp_fnat_out_handler这2个函数,然后找到 / Adjust UDP checksums / if (skb->ip_summed == CHECKSUM_PARTIAL) { udp_partial_csum_reset(cp->af, (skb->len - udphoff), udph, &cp->vaddr, &cp->caddr); } else if (!cp->app) { #把这里改成 (!cp->app && (udph->check != 0)) / Only port and addr are changed, do fast csum update /
ip_vs_proto_udp.c里找到udp_fnat_in_handler, udp_fnat_outhandler这2个函数,然后找到 /* Adjust UDP checksums / if (skb->ip_summed == CHECKSUM_PARTIAL) { udp_partial_csumreset(cp->af, (skb->len - udphoff), udph, &cp->vaddr, &cp->caddr); } else if (!cp->app) { #把这里改成 (!cp->app && (udph->check != 0)) / Only port and addr are changed, do fast csum update */
/*
if (cp->af == AF_INET6)
udph->check = csum_ipv6_magic(&cp->caddr.in6,
&cp->daddr.in6,
skb->len - udphoff,
cp->protocol, skb->csum);
else
udph->check = csum_tcpudp_magic(cp->caddr.ip,
cp->daddr.ip,
skb->len - udphoff,
cp->protocol,
skb->csum);
if (udph->check == 0)
udph->check = CSUM_MANGLED_0;
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
keepalived.conf如下:
local_address_group laddr_g1 { XX.XX.XX.XX }
virtual_server XX.XX.XX.XX XXXX { delay_loop 30 lb_algo rr lb_kind FNAT protocol UDP laddr_group_name laddr_g1
}
修改proc参数: echo 0 > /proc/sys/net/ipv4/vs/defence_udp_drop
ethtool -k eth1
Features for eth1: rx-checksumming: on tx-checksumming: on scatter-gather: on tcp-segmentation-offload: on udp-fragmentation-offload: off generic-segmentation-offload: on generic-receive-offload: off large-receive-offload: off ntuple-filters: off receive-hashing: on
现象是RS上可以收到LVS转发过来的UDP包,但是checksum出错,RS的内核直接丢弃。