From cb3e274835e22432c0ef1917358ff58572d951d6 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 2 Mar 2003 09:07:05 -0800 Subject: [PATCH] [NET]: Remove 2.0/2.2 compat code from netfilter, approved by Rusty. --- net/ipv4/netfilter/ipchains_core.c | 13 +----- net/ipv4/netfilter/ipfwadm_core.c | 67 ++++-------------------------- 2 files changed, 10 insertions(+), 70 deletions(-) diff --git a/net/ipv4/netfilter/ipchains_core.c b/net/ipv4/netfilter/ipchains_core.c index 2294c73db6bfb..290f9e5547dad 100644 --- a/net/ipv4/netfilter/ipchains_core.c +++ b/net/ipv4/netfilter/ipchains_core.c @@ -1566,16 +1566,8 @@ static int dump_rule(char *buffer, /* File offset is actually in records, not bytes. */ static int ip_chain_procinfo(char *buffer, char **start, - off_t offset, int length -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29) - , int reset -#endif - ) + off_t offset, int length) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29) - /* FIXME: No more `atomic' read and reset. Wonderful 8-( --RR */ - int reset = 0; -#endif struct ip_chain *i; struct ip_fwkernel *j = ip_fw_chains->chain; unsigned long flags; @@ -1612,9 +1604,6 @@ static int ip_chain_procinfo(char *buffer, char **start, len = last_len; goto outside; } - else if (reset) - memset(j->counters, 0, - sizeof(struct ip_counters)*NUM_SLOTS); } } outside: diff --git a/net/ipv4/netfilter/ipfwadm_core.c b/net/ipv4/netfilter/ipfwadm_core.c index 82ea93cfef690..fe270f2070268 100644 --- a/net/ipv4/netfilter/ipfwadm_core.c +++ b/net/ipv4/netfilter/ipfwadm_core.c @@ -1113,9 +1113,8 @@ int ip_fw_ctl(int stage, void *m, int len) #endif /* CONFIG_IP_FIREWALL */ #if defined(CONFIG_IP_FIREWALL) || defined(CONFIG_IP_ACCT) - static int ip_chain_procinfo(int stage, char *buffer, char **start, - off_t offset, int length, int reset) + off_t offset, int length) { off_t pos=0, begin=0; struct ip_fw *i; @@ -1184,15 +1183,6 @@ static int ip_chain_procinfo(int stage, char *buffer, char **start, len = last_len; break; } -/* Not possible in 2.3.29+, also allowing read lock instead of write -- JM */ -#if 0 - else if(reset) - { - /* This needs to be done at this specific place! */ - i->fw_pcnt=0L; - i->fw_bcnt=0L; - } -#endif last_len = len; i=i->fw_next; } @@ -1206,69 +1196,30 @@ static int ip_chain_procinfo(int stage, char *buffer, char **start, #endif #ifdef CONFIG_IP_ACCT - static int ip_acct_procinfo(char *buffer, char **start, off_t offset, - int length -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29) - , int reset -#endif - ) + int length) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29) - /* FIXME: No more `atomic' read and reset. Wonderful 8-( --RR */ - int reset = 0; -#endif - return ip_chain_procinfo(IP_FW_ACCT, buffer,start, offset,length, - reset); + return ip_chain_procinfo(IP_FW_ACCT, buffer,start, offset,length); } - #endif #ifdef CONFIG_IP_FIREWALL - static int ip_fw_in_procinfo(char *buffer, char **start, off_t offset, - int length -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29) - , int reset -#endif - ) + int length) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29) - /* FIXME: No more `atomic' read and reset. Wonderful 8-( --RR */ - int reset = 0; -#endif - return ip_chain_procinfo(IP_FW_IN, buffer,start,offset,length, - reset); + return ip_chain_procinfo(IP_FW_IN, buffer,start,offset,length); } static int ip_fw_out_procinfo(char *buffer, char **start, off_t offset, - int length -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29) - , int reset -#endif - ) + int length) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29) - /* FIXME: No more `atomic' read and reset. Wonderful 8-( --RR */ - int reset = 0; -#endif - return ip_chain_procinfo(IP_FW_OUT, buffer,start,offset,length, - reset); + return ip_chain_procinfo(IP_FW_OUT, buffer,start,offset,length); } static int ip_fw_fwd_procinfo(char *buffer, char **start, off_t offset, - int length -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,29) - , int reset -#endif - ) + int length) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,29) - /* FIXME: No more `atomic' read and reset. Wonderful 8-( --RR */ - int reset = 0; -#endif - return ip_chain_procinfo(IP_FW_FWD, buffer,start,offset,length, - reset); + return ip_chain_procinfo(IP_FW_FWD, buffer,start,offset,length); } #endif -- 2.53.0