summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
commitf969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch)
treeb3530d803df59d726afaabebc6626987dee1ca05 /net/ipv4
parenta10ce7ef2066b455d69187643ddf2073bfc4db24 (diff)
Merge with 2.3.27.
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c52
-rw-r--r--net/ipv4/arp.c21
-rw-r--r--net/ipv4/fib_frontend.c7
-rw-r--r--net/ipv4/ip_output.c16
-rw-r--r--net/ipv4/ipmr.c16
-rw-r--r--net/ipv4/route.c22
-rw-r--r--net/ipv4/tcp_input.c11
7 files changed, 26 insertions, 119 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 526dd4dd6..396cf38d8 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -948,45 +948,6 @@ struct net_proto_family inet_family_ops = {
};
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_raw = {
- PROC_NET_RAW, 3, "raw",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- raw_get_info
-};
-static struct proc_dir_entry proc_net_netstat = {
- PROC_NET_NETSTAT, 7, "netstat",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- netstat_get_info
-};
-static struct proc_dir_entry proc_net_snmp = {
- PROC_NET_SNMP, 4, "snmp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- snmp_get_info
-};
-static struct proc_dir_entry proc_net_sockstat = {
- PROC_NET_SOCKSTAT, 8, "sockstat",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- afinet_get_info
-};
-static struct proc_dir_entry proc_net_tcp = {
- PROC_NET_TCP, 3, "tcp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- tcp_get_info
-};
-static struct proc_dir_entry proc_net_udp = {
- PROC_NET_UDP, 3, "udp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- udp_get_info
-};
-#endif /* CONFIG_PROC_FS */
-
extern void tcp_init(void);
extern void tcp_v4_init(struct net_proto_family *);
@@ -1071,13 +1032,12 @@ void __init inet_proto_init(struct net_proto *pro)
/*
* Create all the /proc entries.
*/
-
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_raw);
- proc_net_register(&proc_net_snmp);
- proc_net_register(&proc_net_netstat);
- proc_net_register(&proc_net_sockstat);
- proc_net_register(&proc_net_tcp);
- proc_net_register(&proc_net_udp);
+ proc_net_create ("raw", 0, raw_get_info);
+ proc_net_create ("netstat", 0, netstat_get_info);
+ proc_net_create ("snmp", 0, snmp_get_info);
+ proc_net_create ("sockstat", 0, afinet_get_info);
+ proc_net_create ("tcp", 0, tcp_get_info);
+ proc_net_create ("udp", 0, udp_get_info);
#endif /* CONFIG_PROC_FS */
}
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 0b1ee6387..263cd36e0 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -980,11 +980,12 @@ out:
/*
* Write the contents of the ARP cache to a PROCfs file.
*/
-#ifdef CONFIG_PROC_FS
-
+#ifndef CONFIG_PROC_FS
+static int arp_get_info(char *buffer, char **start, off_t offset, int length, int dummy) { return 0; }
+#else
#define HBUFFERLEN 30
-int arp_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
+static int arp_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
{
int len=0;
off_t pos=0;
@@ -1116,24 +1117,14 @@ static struct packet_type arp_packet_type =
NULL
};
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_arp = {
- PROC_NET_ARP, 3, "arp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- arp_get_info
-};
-#endif
-
void __init arp_init (void)
{
neigh_table_init(&arp_tbl);
dev_add_pack(&arp_packet_type);
-#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_arp);
-#endif
+ proc_net_create ("arp", 0, arp_get_info);
+
#ifdef CONFIG_SYSCTL
neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, NET_IPV4_NEIGH, "ipv4");
#endif
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 656acf2c9..47cc41a92 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -648,12 +648,7 @@ struct notifier_block fib_netdev_notifier = {
void __init ip_fib_init(void)
{
#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_ROUTE, 5, "route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- fib_get_procinfo
- });
+ proc_net_create("route",0,fib_get_procinfo);
#endif /* CONFIG_PROC_FS */
#ifndef CONFIG_IP_MULTIPLE_TABLES
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 5e6b50ea7..fa464f24c 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1006,18 +1006,6 @@ static struct packet_type ip_packet_type =
};
-
-#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_IP_MULTICAST
-static struct proc_dir_entry proc_net_igmp = {
- PROC_NET_IGMP, 4, "igmp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ip_mc_procinfo
-};
-#endif
-#endif
-
/*
* IP registers the packet type and then calls the subprotocol initialisers
*/
@@ -1028,10 +1016,8 @@ void __init ip_init(void)
ip_rt_init();
-#ifdef CONFIG_PROC_FS
#ifdef CONFIG_IP_MULTICAST
- proc_net_register(&proc_net_igmp);
+ proc_net_create("igmp", S_IFREG | S_IRUGO, ip_mc_procinfo);
#endif
-#endif
}
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 6bb331fcd..b65d6f405 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1703,18 +1703,6 @@ done:
}
#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_ipmr_vif = {
- PROC_NET_IPMR_VIF, 9 ,"ip_mr_vif",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ipmr_vif_info
-};
-static struct proc_dir_entry proc_net_ipmr_mfc = {
- PROC_NET_IPMR_MFC, 11 ,"ip_mr_cache",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ipmr_mfc_info
-};
#endif
#ifdef CONFIG_IP_PIMSM_V2
@@ -1746,7 +1734,7 @@ void __init ip_mr_init(void)
ipmr_expire_timer.function=ipmr_expire_process;
register_netdevice_notifier(&ip_mr_notifier);
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_ipmr_vif);
- proc_net_register(&proc_net_ipmr_mfc);
+ proc_net_create("ip_mr_vif",0,ipmr_vif_info);
+ proc_net_create("ip_mr_cache",0,ipmr_mfc_info);
#endif
}
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 72bb07336..2fe7e0fdb 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -201,8 +201,9 @@ static __inline__ unsigned rt_hash_code(u32 daddr, u32 saddr, u8 tos)
return (hash^(hash>>8)) & 0xFF;
}
-#ifdef CONFIG_PROC_FS
-
+#ifndef CONFIG_PROC_FS
+static int rt_cache_get_info(char *buffer, char **start, off_t offset, int length, int dummy) { return 0; }
+#else
static int rt_cache_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
{
int len=0;
@@ -2147,11 +2148,6 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
void __init ip_rt_init(void)
{
-#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_NET_CLS_ROUTE
- struct proc_dir_entry *ent;
-#endif
-#endif
ipv4_dst_ops.kmem_cachep = kmem_cache_create("ip_dst_cache",
sizeof(struct rtable),
0, SLAB_HWCACHE_ALIGN,
@@ -2167,16 +2163,8 @@ void __init ip_rt_init(void)
+ ip_rt_gc_interval;
add_timer(&rt_periodic_timer);
-#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_RTCACHE, 8, "rt_cache",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rt_cache_get_info
- });
+ proc_net_create ("rt_cache", 0, rt_cache_get_info);
#ifdef CONFIG_NET_CLS_ROUTE
- ent = create_proc_entry("net/rt_acct", 0, 0);
- ent->read_proc = ip_rt_acct_read;
-#endif
+ create_proc_read_entry("net/rt_acct", 0, 0, ip_rt_acct_read, NULL);
#endif
}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2f6bd37c9..0472ba4f8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1401,11 +1401,6 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th)
tcp_send_ack(sk);
- if (!sk->dead) {
- wake_up_interruptible(sk->sleep);
- sock_wake_async(sk->socket, 1, POLL_HUP);
- }
-
switch(sk->state) {
case TCP_SYN_RECV:
case TCP_ESTABLISHED:
@@ -1440,7 +1435,11 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th)
*/
printk("tcp_fin: Impossible, sk->state=%d\n", sk->state);
break;
- };
+ }
+ if (!sk->dead) {
+ wake_up_interruptible(sk->sleep);
+ sock_wake_async(sk->socket, 1, POLL_HUP);
+ }
}
/* These routines update the SACK block as out-of-order packets arrive or