sysctl控制项-请教
时间:2010-08-23
来源:互联网
我想在/proc/sys/net/ipv4下建立一个专用的目录sina,然后来存放一些自己设定的一些参数。但是奇怪的是,一些在/proc/sys/net/ipv4目录下的icmp_echo*的东西被复制过来了。闹了半天还是没有头绪。现象如下:
[root@localhost linux-2.6.30]# ll /proc/sys/net/ipv4/icmp_*
icmp_echo_ignore_all icmp_errors_use_inbound_ifaddr icmp_ratelimit
icmp_echo_ignore_broadcasts icmp_ignore_bogus_error_responses icmp_ratemask
[root@localhost linux-2.6.30]# ll /proc/sys/net/ipv4/sina/
icmp_echo_ignore_all icmp_ignore_bogus_error_responses rt_cache_rebuild_count tcp_passive_threshold
icmp_echo_ignore_broadcasts icmp_ratelimit tcp_active_threshold tcp_rtt_threshold
icmp_errors_use_inbound_ifaddr icmp_ratemask tcp_est_threshold
在sina目录下一些icmp_*的东西被从 ipv4目录 下复制过来了,而且文件的创建时间也相同。下面是对应的内核代码部分,我修改的用红色标出来了。
net/ipv4/sysctl_net_ipv4.c
....
static struct ctl_table private_table[] = {
{
.ctl_name = NET_IPV4_TCP_RTT_THRESHOLD,
.procname = "tcp_rtt_threshold",
.data = &sysctl_tcp_rtt_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_EST_THRESHOLD,
.procname = "tcp_est_threshold",
.data = &sysctl_tcp_est_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_PASSIVE_THRESHOLD,
.procname = "tcp_passive_threshold",
.data = &sysctl_tcp_passive_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_ACTIVE_THRESHOLD,
.procname = "tcp_active_threshold",
.data = &sysctl_tcp_active_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
}
};
...
struct ctl_path net_ipv4_sina_ctl_path[] = {
{.procname = "net",.ctl_name = CTL_NET,},
{.procname = "ipv4",.ctl_name = NET_IPV4,},
{.procname = "sina",.ctl_name = IPV4_SINA,},
{},
};
....
static __init int sysctl_ipv4_init(void)
{
struct ctl_table_header *hdr;
struct ctl_table_header *hdr_ex;
hdr = register_sysctl_paths(net_ipv4_ctl_path, ipv4_table);
hdr_ex = register_sysctl_paths(net_ipv4_sina_ctl_path, private_table);
if((hdr == NULL) && (hdr_ex == NULL))
return -ENOMEM;
if (register_pernet_subsys(&ipv4_sysctl_ops)) {
unregister_sysctl_table(hdr_ex);
unregister_sysctl_table(hdr);
return -ENOMEM;
}
return 0;
}
请高手帮看看,是什么原因导致icmp_**的东西被闹到sina目录下。。。谢谢了。。。
[root@localhost linux-2.6.30]# ll /proc/sys/net/ipv4/icmp_*
icmp_echo_ignore_all icmp_errors_use_inbound_ifaddr icmp_ratelimit
icmp_echo_ignore_broadcasts icmp_ignore_bogus_error_responses icmp_ratemask
[root@localhost linux-2.6.30]# ll /proc/sys/net/ipv4/sina/
icmp_echo_ignore_all icmp_ignore_bogus_error_responses rt_cache_rebuild_count tcp_passive_threshold
icmp_echo_ignore_broadcasts icmp_ratelimit tcp_active_threshold tcp_rtt_threshold
icmp_errors_use_inbound_ifaddr icmp_ratemask tcp_est_threshold
在sina目录下一些icmp_*的东西被从 ipv4目录 下复制过来了,而且文件的创建时间也相同。下面是对应的内核代码部分,我修改的用红色标出来了。
net/ipv4/sysctl_net_ipv4.c
....
static struct ctl_table private_table[] = {
{
.ctl_name = NET_IPV4_TCP_RTT_THRESHOLD,
.procname = "tcp_rtt_threshold",
.data = &sysctl_tcp_rtt_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_EST_THRESHOLD,
.procname = "tcp_est_threshold",
.data = &sysctl_tcp_est_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_PASSIVE_THRESHOLD,
.procname = "tcp_passive_threshold",
.data = &sysctl_tcp_passive_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.ctl_name = NET_IPV4_TCP_ACTIVE_THRESHOLD,
.procname = "tcp_active_threshold",
.data = &sysctl_tcp_active_threshold,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
}
};
...
struct ctl_path net_ipv4_sina_ctl_path[] = {
{.procname = "net",.ctl_name = CTL_NET,},
{.procname = "ipv4",.ctl_name = NET_IPV4,},
{.procname = "sina",.ctl_name = IPV4_SINA,},
{},
};
....
static __init int sysctl_ipv4_init(void)
{
struct ctl_table_header *hdr;
struct ctl_table_header *hdr_ex;
hdr = register_sysctl_paths(net_ipv4_ctl_path, ipv4_table);
hdr_ex = register_sysctl_paths(net_ipv4_sina_ctl_path, private_table);
if((hdr == NULL) && (hdr_ex == NULL))
return -ENOMEM;
if (register_pernet_subsys(&ipv4_sysctl_ops)) {
unregister_sysctl_table(hdr_ex);
unregister_sysctl_table(hdr);
return -ENOMEM;
}
return 0;
}
请高手帮看看,是什么原因导致icmp_**的东西被闹到sina目录下。。。谢谢了。。。
作者: peking_A_Liang 发布时间: 2010-08-23
额,看看进程?
作者: vermouth 发布时间: 2010-08-23
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28