提交 28b06c38 编写于 作者: S Simon Horman 提交者: David S. Miller

[IPVS]: Make sure ip_vs_ftp ports are valid: module_param_array approach

I'm not entirely sure what happens in the case of a valid port,
at best it'll be silently ignored. This patch ensures that
the port values are unsigned short values, and thus always valid.

This is a second take at fixing this problem, it is simpler
and arguably more correct than the previous approach
that was committed as 3f5af5b3.
Prior to this patch a patch that reverses
3f5af5b3 was sent.
Signed-off-by: NSimon Horman <horms@verge.net.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e44fd82c
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
* List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper
* First port is set to the default port. * First port is set to the default port.
*/ */
static int ports[IP_VS_APP_MAX_PORTS] = {21, 0}; static unsigned short ports[IP_VS_APP_MAX_PORTS] = {21, 0};
module_param_array(ports, int, NULL, 0); module_param_array(ports, ushort, NULL, 0);
MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands"); MODULE_PARM_DESC(ports, "Ports to monitor for FTP control commands");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册