projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ee5fa1
)
ipv4: flush route cache after change accept_local
author
Peter Pan(潘卫平)
<
[email protected]
>
Thu, 1 Dec 2011 15:47:06 +0000
(15:47 +0000)
committer
David S. Miller
<
[email protected]
>
Fri, 2 Dec 2011 02:46:12 +0000
(21:46 -0500)
After reset ipv4_devconf->data[IPV4_DEVCONF_ACCEPT_LOCAL] to 0,
we should flush route cache, or it will continue receive packets with local
source address, which should be dropped.
Signed-off-by: Weiping Pan <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv4/devinet.c
patch
|
blob
|
history
diff --git
a/net/ipv4/devinet.c
b/net/ipv4/devinet.c
index c6b5092f29a15511bb7c69f37a86dca2c538a164..65f01dc47565bcc26282d4472bbd9c3fb2d3712c 100644
(file)
--- a/
net/ipv4/devinet.c
+++ b/
net/ipv4/devinet.c
@@
-1490,7
+1490,9
@@
static int devinet_conf_proc(ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos)
{
+ int old_value = *(int *)ctl->data;
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ int new_value = *(int *)ctl->data;
if (write) {
struct ipv4_devconf *cnf = ctl->extra1;
@@
-1501,6
+1503,9
@@
static int devinet_conf_proc(ctl_table *ctl, int write,
if (cnf == net->ipv4.devconf_dflt)
devinet_copy_dflt_conf(net, i);
+ if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1)
+ if ((new_value == 0) && (old_value != 0))
+ rt_cache_flush(net, 0);
}
return ret;