Thread (9 messages) flat view 9 messages, 4 authors, 2022-03-18

Re: [PATCH net-next] xfrm: rework default policy structure

From: Leon Romanovsky <leon@kernel.org>
Date: 2021-11-21 14:07:24

On Fri, Nov 19, 2021 at 06:31:18PM +0100, Nicolas Dichtel wrote:
Le 19/11/2021 à 16:41, Leon Romanovsky a écrit :
[snip]
quoted
quoted
What about:

static inline bool __xfrm_check_nopolicy(struct net *net, struct sk_buff *skb,
                                         int dir)
{
        if (!net->xfrm.policy_count[dir] && !secpath_exists(skb))
                return net->xfrm.policy_default[dir] == XFRM_USERPOLICY_ACCEPT;

        return false;
}
It is much better, just extra "!" is not in place.
Ok, I will send a v2 with that.
quoted
if (!net->xfrm.policy_count[dir] ... -> if (net->xfrm.policy_count[dir] ...
Hmm, are you sure?
Not sure at all, maybe wrong.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help