diff options
| author | Simon Horman <horms@verge.net.au> | 2009-12-15 11:01:25 -0500 |
|---|---|---|
| committer | Patrick McHardy <kaber@trash.net> | 2009-12-15 11:01:25 -0500 |
| commit | 258c889362aa95d0ab534b38ce8c15d3009705b1 (patch) | |
| tree | 227a7a3df0dfd8d094edfd2ff350011605c202a3 | |
| parent | 8fa9ff6849bb86c59cc2ea9faadf3cb2d5223497 (diff) | |
ipvs: zero usvc and udest
Make sure that any otherwise uninitialised fields of usvc are zero.
This has been obvserved to cause a problem whereby the port of
fwmark services may end up as a non-zero value which causes
scheduling of a destination server to fail for persisitent services.
As observed by Deon van der Merwe <dvdm@truteq.co.za>.
This fix suggested by Julian Anastasov <ja@ssi.bg>.
For good measure also zero udest.
Cc: Deon van der Merwe <dvdm@truteq.co.za>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index e55a6861d26f..6bde12da2fe0 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
| @@ -2714,6 +2714,8 @@ static int ip_vs_genl_parse_service(struct ip_vs_service_user_kern *usvc, | |||
| 2714 | if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr)))) | 2714 | if (!(nla_af && (nla_fwmark || (nla_port && nla_protocol && nla_addr)))) |
| 2715 | return -EINVAL; | 2715 | return -EINVAL; |
| 2716 | 2716 | ||
| 2717 | memset(usvc, 0, sizeof(*usvc)); | ||
| 2718 | |||
| 2717 | usvc->af = nla_get_u16(nla_af); | 2719 | usvc->af = nla_get_u16(nla_af); |
| 2718 | #ifdef CONFIG_IP_VS_IPV6 | 2720 | #ifdef CONFIG_IP_VS_IPV6 |
| 2719 | if (usvc->af != AF_INET && usvc->af != AF_INET6) | 2721 | if (usvc->af != AF_INET && usvc->af != AF_INET6) |
| @@ -2901,6 +2903,8 @@ static int ip_vs_genl_parse_dest(struct ip_vs_dest_user_kern *udest, | |||
| 2901 | if (!(nla_addr && nla_port)) | 2903 | if (!(nla_addr && nla_port)) |
| 2902 | return -EINVAL; | 2904 | return -EINVAL; |
| 2903 | 2905 | ||
| 2906 | memset(udest, 0, sizeof(*udest)); | ||
| 2907 | |||
| 2904 | nla_memcpy(&udest->addr, nla_addr, sizeof(udest->addr)); | 2908 | nla_memcpy(&udest->addr, nla_addr, sizeof(udest->addr)); |
| 2905 | udest->port = nla_get_u16(nla_port); | 2909 | udest->port = nla_get_u16(nla_port); |
| 2906 | 2910 | ||
