kernel-pfkey: Add support for new policy priority class

This commit is contained in:
Tobias Brunner 2014-05-13 12:19:41 +02:00
parent f1675e4e29
commit 77b6a145a0

View File

@ -135,8 +135,8 @@
#define SOL_UDP IPPROTO_UDP #define SOL_UDP IPPROTO_UDP
#endif #endif
/** default priority of installed policies */ /** base priority for installed policies */
#define PRIO_BASE 512 #define PRIO_BASE 384
#ifdef __APPLE__ #ifdef __APPLE__
/** from xnu/bsd/net/pfkeyv2.h */ /** from xnu/bsd/net/pfkeyv2.h */
@ -583,6 +583,9 @@ static inline u_int32_t get_priority(policy_entry_t *policy,
priority <<= 1; priority <<= 1;
/* fall-through */ /* fall-through */
case POLICY_PRIORITY_DEFAULT: case POLICY_PRIORITY_DEFAULT:
priority <<= 1;
/* fall-trough */
case POLICY_PRIORITY_PASS:
break; break;
} }
/* calculate priority based on selector size, small size = high prio */ /* calculate priority based on selector size, small size = high prio */