📄 policy-sleep-2.6.16.5-v1.patch
字号:
diff -urN linux-2.6.16.5/include/linux/xfrm.h linux-2.6.16.5-sleep/include/linux/xfrm.h--- linux-2.6.16.5/include/linux/xfrm.h 2006-04-12 23:27:57.000000000 +0300+++ linux-2.6.16.5-sleep/include/linux/xfrm.h 2006-04-14 19:46:19.000000000 +0300@@ -43,6 +43,12 @@ #define XFRM_SC_ALG_RESERVED 0 #define XFRM_SC_ALG_SELINUX 1 +/* Transport layer flag passed to xfrm_lookup. If set, the userspace+ process sleeps in a waitqueue until key management daemon has + finished setting up security associations. This workaround exists + until we have queues for outgoing IPsec packets. */+#define XFRM_LOOKUP_DEFAULT_FLAGS (!in_atomic() && !in_softirq())+ /* Selector, used as selector both on policy rules (SPD) and SAs. */ struct xfrm_selectordiff -urN linux-2.6.16.5/include/net/xfrm.h linux-2.6.16.5-sleep/include/net/xfrm.h--- linux-2.6.16.5/include/net/xfrm.h 2006-04-12 23:27:57.000000000 +0300+++ linux-2.6.16.5-sleep/include/net/xfrm.h 2006-04-14 19:48:19.000000000 +0300@@ -200,7 +200,7 @@ extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); extern void km_state_notify(struct xfrm_state *x, struct km_event *c); -#define XFRM_ACQ_EXPIRES 30+#define XFRM_ACQ_EXPIRES 3 struct xfrm_tmpl; struct xfrm_state_afinfo {diff -urN linux-2.6.16.5/net/xfrm/xfrm_policy.c linux-2.6.16.5-sleep/net/xfrm/xfrm_policy.c--- linux-2.6.16.5/net/xfrm/xfrm_policy.c 2006-04-12 23:27:57.000000000 +0300+++ linux-2.6.16.5-sleep/net/xfrm/xfrm_policy.c 2006-04-14 19:47:52.000000000 +0300@@ -837,7 +837,7 @@ if (unlikely(nx<0)) { err = nx;- if (err == -EAGAIN && flags) {+ if (err == -EAGAIN && (flags || XFRM_LOOKUP_DEFAULT_FLAGS)) { DECLARE_WAITQUEUE(wait, current); add_wait_queue(&km_waitq, &wait);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -