Commit 1d8c72f0 authored by David S. Miller's avatar David S. Miller

[IPV4]: Flush routing cache on sysctl_ip_default_ttl changes.

parent 8324c812
...@@ -298,4 +298,15 @@ extern void ip_local_error(struct sock *sk, int err, u32 daddr, u16 dport, ...@@ -298,4 +298,15 @@ extern void ip_local_error(struct sock *sk, int err, u32 daddr, u16 dport,
extern int ip_seq_release(struct inode *inode, struct file *file); extern int ip_seq_release(struct inode *inode, struct file *file);
extern int ipv4_proc_init(void); extern int ipv4_proc_init(void);
/* sysctl helpers - any sysctl which holds a value that ends up being
* fed into the routing cache should use these handlers.
*/
int ipv4_doint_and_flush(ctl_table *ctl, int write,
struct file* filp, void *buffer,
size_t *lenp);
int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen,
void **context);
#endif /* _IP_H */ #endif /* _IP_H */
...@@ -1065,9 +1065,9 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, ...@@ -1065,9 +1065,9 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
return ret; return ret;
} }
static int ipv4_doint_and_flush(ctl_table *ctl, int write, int ipv4_doint_and_flush(ctl_table *ctl, int write,
struct file* filp, void *buffer, struct file* filp, void *buffer,
size_t *lenp) size_t *lenp)
{ {
int *valp = ctl->data; int *valp = ctl->data;
int val = *valp; int val = *valp;
...@@ -1079,10 +1079,10 @@ static int ipv4_doint_and_flush(ctl_table *ctl, int write, ...@@ -1079,10 +1079,10 @@ static int ipv4_doint_and_flush(ctl_table *ctl, int write,
return ret; return ret;
} }
static int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen, int ipv4_doint_and_flush_strategy(ctl_table *table, int *name, int nlen,
void *oldval, size_t *oldlenp, void *oldval, size_t *oldlenp,
void *newval, size_t newlen, void *newval, size_t newlen,
void **context) void **context)
{ {
int *valp = table->data; int *valp = table->data;
int new; int new;
......
...@@ -160,7 +160,8 @@ ctl_table ipv4_table[] = { ...@@ -160,7 +160,8 @@ ctl_table ipv4_table[] = {
.data = &sysctl_ip_default_ttl, .data = &sysctl_ip_default_ttl,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = &ipv4_doint_and_flush,
.strategy = &ipv4_doint_and_flush_strategy,
}, },
{ {
.ctl_name = NET_IPV4_AUTOCONFIG, .ctl_name = NET_IPV4_AUTOCONFIG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment