policy-sleep-2.6.16.5-v1.patch
来自「HIP:Host Identity Protocol」· PATCH 代码 · 共 41 行
PATCH
41 行
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 + =
减小字号Ctrl + -
显示快捷键?