diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 7e4904b930041f8bf70c22b52bd6a5adf8af7267..060afc4ffd9581f558da4bff1f35798371c67bd2 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1424,7 +1424,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) ret = verify_policy_dir(p->dir); if (ret) return ret; - if (p->index && ((p->index & XFRM_POLICY_MAX) != p->dir)) + if (p->index && (xfrm_policy_id2dir(p->index) != p->dir)) return -EINVAL; return 0;