Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit babbdb1a authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: Fix timeout sysctls on big-endian 64bit architectures



The connection tracking timeout variables are unsigned long, but
proc_dointvec_jiffies is used with sizeof(unsigned int) in the sysctl
tables. Since there is no proc_doulongvec_jiffies function, change the
timeout variables to unsigned int.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9d28026b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,7 @@
#include <linux/netfilter.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>


unsigned long ip_ct_generic_timeout = 600*HZ;
unsigned int ip_ct_generic_timeout = 600*HZ;


static int generic_pkt_to_tuple(const struct sk_buff *skb,
static int generic_pkt_to_tuple(const struct sk_buff *skb,
				unsigned int dataoff,
				unsigned int dataoff,
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#include <linux/netfilter_ipv4/ip_conntrack_core.h>
#include <linux/netfilter_ipv4/ip_conntrack_core.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>


unsigned long ip_ct_icmp_timeout = 30*HZ;
unsigned int ip_ct_icmp_timeout = 30*HZ;


#if 0
#if 0
#define DEBUGP printk
#define DEBUGP printk
+9 −9
Original line number Original line Diff line number Diff line
@@ -58,15 +58,15 @@ static const char *sctp_conntrack_names[] = {
#define HOURS * 60 MINS
#define HOURS * 60 MINS
#define DAYS  * 24 HOURS
#define DAYS  * 24 HOURS


static unsigned long ip_ct_sctp_timeout_closed            =  10 SECS;
static unsigned int ip_ct_sctp_timeout_closed            =  10 SECS;
static unsigned long ip_ct_sctp_timeout_cookie_wait       =   3 SECS;
static unsigned int ip_ct_sctp_timeout_cookie_wait       =   3 SECS;
static unsigned long ip_ct_sctp_timeout_cookie_echoed     =   3 SECS;
static unsigned int ip_ct_sctp_timeout_cookie_echoed     =   3 SECS;
static unsigned long ip_ct_sctp_timeout_established       =   5 DAYS;
static unsigned int ip_ct_sctp_timeout_established       =   5 DAYS;
static unsigned long ip_ct_sctp_timeout_shutdown_sent     = 300 SECS / 1000;
static unsigned int ip_ct_sctp_timeout_shutdown_sent     = 300 SECS / 1000;
static unsigned long ip_ct_sctp_timeout_shutdown_recd     = 300 SECS / 1000;
static unsigned int ip_ct_sctp_timeout_shutdown_recd     = 300 SECS / 1000;
static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent =   3 SECS;
static unsigned int ip_ct_sctp_timeout_shutdown_ack_sent =   3 SECS;


static const unsigned long * sctp_timeouts[]
static const unsigned int * sctp_timeouts[]
= { NULL,                                  /* SCTP_CONNTRACK_NONE  */
= { NULL,                                  /* SCTP_CONNTRACK_NONE  */
    &ip_ct_sctp_timeout_closed,	           /* SCTP_CONNTRACK_CLOSED */
    &ip_ct_sctp_timeout_closed,	           /* SCTP_CONNTRACK_CLOSED */
    &ip_ct_sctp_timeout_cookie_wait,       /* SCTP_CONNTRACK_COOKIE_WAIT */
    &ip_ct_sctp_timeout_cookie_wait,       /* SCTP_CONNTRACK_COOKIE_WAIT */
+10 −10
Original line number Original line Diff line number Diff line
@@ -85,21 +85,21 @@ static const char *tcp_conntrack_names[] = {
#define HOURS * 60 MINS
#define HOURS * 60 MINS
#define DAYS * 24 HOURS
#define DAYS * 24 HOURS


unsigned long ip_ct_tcp_timeout_syn_sent =      2 MINS;
unsigned int ip_ct_tcp_timeout_syn_sent =      2 MINS;
unsigned long ip_ct_tcp_timeout_syn_recv =     60 SECS;
unsigned int ip_ct_tcp_timeout_syn_recv =     60 SECS;
unsigned long ip_ct_tcp_timeout_established =   5 DAYS;
unsigned int ip_ct_tcp_timeout_established =   5 DAYS;
unsigned long ip_ct_tcp_timeout_fin_wait =      2 MINS;
unsigned int ip_ct_tcp_timeout_fin_wait =      2 MINS;
unsigned long ip_ct_tcp_timeout_close_wait =   60 SECS;
unsigned int ip_ct_tcp_timeout_close_wait =   60 SECS;
unsigned long ip_ct_tcp_timeout_last_ack =     30 SECS;
unsigned int ip_ct_tcp_timeout_last_ack =     30 SECS;
unsigned long ip_ct_tcp_timeout_time_wait =     2 MINS;
unsigned int ip_ct_tcp_timeout_time_wait =     2 MINS;
unsigned long ip_ct_tcp_timeout_close =        10 SECS;
unsigned int ip_ct_tcp_timeout_close =        10 SECS;


/* RFC1122 says the R2 limit should be at least 100 seconds.
/* RFC1122 says the R2 limit should be at least 100 seconds.
   Linux uses 15 packets as limit, which corresponds 
   Linux uses 15 packets as limit, which corresponds 
   to ~13-30min depending on RTO. */
   to ~13-30min depending on RTO. */
unsigned long ip_ct_tcp_timeout_max_retrans =     5 MINS;
unsigned int ip_ct_tcp_timeout_max_retrans =     5 MINS;
 
 
static const unsigned long * tcp_timeouts[]
static const unsigned int * tcp_timeouts[]
= { NULL,                              /*      TCP_CONNTRACK_NONE */
= { NULL,                              /*      TCP_CONNTRACK_NONE */
    &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
    &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
    &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
    &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,8 +19,8 @@
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>


unsigned long ip_ct_udp_timeout = 30*HZ;
unsigned int ip_ct_udp_timeout = 30*HZ;
unsigned long ip_ct_udp_timeout_stream = 180*HZ;
unsigned int ip_ct_udp_timeout_stream = 180*HZ;


static int udp_pkt_to_tuple(const struct sk_buff *skb,
static int udp_pkt_to_tuple(const struct sk_buff *skb,
			     unsigned int dataoff,
			     unsigned int dataoff,
Loading