X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Fkey%2Faf_key.c;h=911ef03bf8fbf1716672fb503f39de7fe13746d9;hb=c224b76b560f3c65f0d10fbb59d3f00379eb0aaf;hp=9d585370c5b4d6a1e60728df4dad6c79ca196ee3;hpb=be5090da4abb68caa69ac62ae5253ac540aa829a;p=karo-tx-linux.git diff --git a/net/key/af_key.c b/net/key/af_key.c index 9d585370c5b4..911ef03bf8fb 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1098,7 +1098,8 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, x->id.proto = proto; x->id.spi = sa->sadb_sa_spi; - x->props.replay_window = sa->sadb_sa_replay; + x->props.replay_window = min_t(unsigned int, sa->sadb_sa_replay, + (sizeof(x->replay.bitmap) * 8)); if (sa->sadb_sa_flags & SADB_SAFLAGS_NOECN) x->props.flags |= XFRM_STATE_NOECN; if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP)