mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 06:50:58 +07:00
[IPVS]: More endianness fixed.
- make sure port in FTP data is in network order (in fact it was looking buggy for big endian boxes before Viro's changes) - htonl -> htons for port Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
da413908d5
commit
bb831eb202
@ -200,7 +200,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
|
||||
from = n_cp->vaddr;
|
||||
port = n_cp->vport;
|
||||
sprintf(buf,"%d,%d,%d,%d,%d,%d", NIPQUAD(from),
|
||||
ntohs(port)&255, (ntohs(port)>>8)&255);
|
||||
(ntohs(port)>>8)&255, ntohs(port)&255);
|
||||
buf_len = strlen(buf);
|
||||
|
||||
/*
|
||||
|
@ -117,7 +117,7 @@ tcp_fast_csum_update(struct tcphdr *tcph, __be32 oldip, __be32 newip,
|
||||
{
|
||||
tcph->check =
|
||||
ip_vs_check_diff(~oldip, newip,
|
||||
ip_vs_check_diff(oldport ^ htonl(0xFFFF),
|
||||
ip_vs_check_diff(oldport ^ htons(0xFFFF),
|
||||
newport, tcph->check));
|
||||
}
|
||||
|
||||
|
@ -122,10 +122,10 @@ udp_fast_csum_update(struct udphdr *uhdr, __be32 oldip, __be32 newip,
|
||||
{
|
||||
uhdr->check =
|
||||
ip_vs_check_diff(~oldip, newip,
|
||||
ip_vs_check_diff(oldport ^ htonl(0xFFFF),
|
||||
ip_vs_check_diff(oldport ^ htons(0xFFFF),
|
||||
newport, uhdr->check));
|
||||
if (!uhdr->check)
|
||||
uhdr->check = htonl(0xFFFF);
|
||||
uhdr->check = -1;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -173,7 +173,7 @@ udp_snat_handler(struct sk_buff **pskb,
|
||||
cp->protocol,
|
||||
(*pskb)->csum);
|
||||
if (udph->check == 0)
|
||||
udph->check = htonl(0xFFFF);
|
||||
udph->check = -1;
|
||||
IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
|
||||
pp->name, udph->check,
|
||||
(char*)&(udph->check) - (char*)udph);
|
||||
@ -228,7 +228,7 @@ udp_dnat_handler(struct sk_buff **pskb,
|
||||
cp->protocol,
|
||||
(*pskb)->csum);
|
||||
if (udph->check == 0)
|
||||
udph->check = 0xFFFF;
|
||||
udph->check = -1;
|
||||
(*pskb)->ip_summed = CHECKSUM_UNNECESSARY;
|
||||
}
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user