Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[XFRM]: Fix aevent structuring to be more complete.

aevents can not uniquely identify an SA. We break the ABI with this
patch, but consensus is that since it is not yet utilized by any
(known) application then it is fine (better do it now than later).

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jamal Hadi Salim and committed by
David S. Miller
2b5f6dcc 02dba025

+9 -2
+4 -1
Documentation/networking/xfrm_sync.txt
··· 47 47 48 48 struct xfrm_aevent_id { 49 49 struct xfrm_usersa_id sa_id; 50 + xfrm_address_t saddr; 50 51 __u32 flags; 52 + __u32 reqid; 51 53 }; 52 54 53 - xfrm_usersa_id in this message layout identifies the SA. 55 + The unique SA is identified by the combination of xfrm_usersa_id, 56 + reqid and saddr. 54 57 55 58 flags are used to indicate different things. The possible 56 59 flags are:
+2
include/linux/xfrm.h
··· 289 289 290 290 struct xfrm_aevent_id { 291 291 struct xfrm_usersa_id sa_id; 292 + xfrm_address_t saddr; 292 293 __u32 flags; 294 + __u32 reqid; 293 295 }; 294 296 295 297 struct xfrm_userspi_info {
+3 -1
net/xfrm/xfrm_user.c
··· 1281 1281 id = NLMSG_DATA(nlh); 1282 1282 nlh->nlmsg_flags = 0; 1283 1283 1284 - id->sa_id.daddr = x->id.daddr; 1284 + memcpy(&id->sa_id.daddr, &x->id.daddr,sizeof(x->id.daddr)); 1285 1285 id->sa_id.spi = x->id.spi; 1286 1286 id->sa_id.family = x->props.family; 1287 1287 id->sa_id.proto = x->id.proto; 1288 + memcpy(&id->saddr, &x->props.saddr,sizeof(x->props.saddr)); 1289 + id->reqid = x->props.reqid; 1288 1290 id->flags = c->data.aevent; 1289 1291 1290 1292 RTA_PUT(skb, XFRMA_REPLAY_VAL, sizeof(x->replay), &x->replay);