diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-24 21:17:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-24 21:17:54 -0400 |
commit | 14e50e57aedb2a89cf79b77782879769794cab7b (patch) | |
tree | 46cbdab9c8007cea0821294c9d397214b38ea4c8 /net/core | |
parent | 04efb8787e4d8a7b21a61aeb723de33154311256 (diff) |
[XFRM]: Allow packet drops during larval state resolution.
The current IPSEC rule resolution behavior we have does not work for a
lot of people, even though technically it's an improvement from the
-EAGAIN buisness we had before.
Right now we'll block until the key manager resolves the route. That
works for simple cases, but many folks would rather packets get
silently dropped until the key manager resolves the IPSEC rules.
We can't tell these folks to "set the socket non-blocking" because
they don't have control over the non-block setting of things like the
sockets used to resolve DNS deep inside of the resolver libraries in
libc.
With that in mind I coded up the patch below with some help from
Herbert Xu which provides packet-drop behavior during larval state
resolution, controllable via sysctl and off by default.
This lays the framework to either:
1) Make this default at some point or...
2) Move this logic into xfrm{4,6}_policy.c and implement the
ARP-like resolution queue we've all been dreaming of.
The idea would be to queue packets to the policy, then
once the larval state is resolved by the key manager we
re-resolve the route and push the packets out. The
packets would timeout if the rule didn't get resolved
in a certain amount of time.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sysctl_net_core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index b29712033dd4..f34aca041a25 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -24,6 +24,7 @@ extern int sysctl_core_destroy_delay; | |||
24 | #ifdef CONFIG_XFRM | 24 | #ifdef CONFIG_XFRM |
25 | extern u32 sysctl_xfrm_aevent_etime; | 25 | extern u32 sysctl_xfrm_aevent_etime; |
26 | extern u32 sysctl_xfrm_aevent_rseqth; | 26 | extern u32 sysctl_xfrm_aevent_rseqth; |
27 | extern int sysctl_xfrm_larval_drop; | ||
27 | #endif | 28 | #endif |
28 | 29 | ||
29 | ctl_table core_table[] = { | 30 | ctl_table core_table[] = { |
@@ -118,6 +119,14 @@ ctl_table core_table[] = { | |||
118 | .mode = 0644, | 119 | .mode = 0644, |
119 | .proc_handler = &proc_dointvec | 120 | .proc_handler = &proc_dointvec |
120 | }, | 121 | }, |
122 | { | ||
123 | .ctl_name = CTL_UNNUMBERED, | ||
124 | .procname = "xfrm_larval_drop", | ||
125 | .data = &sysctl_xfrm_larval_drop, | ||
126 | .maxlen = sizeof(int), | ||
127 | .mode = 0644, | ||
128 | .proc_handler = &proc_dointvec | ||
129 | }, | ||
121 | #endif /* CONFIG_XFRM */ | 130 | #endif /* CONFIG_XFRM */ |
122 | #endif /* CONFIG_NET */ | 131 | #endif /* CONFIG_NET */ |
123 | { | 132 | { |