Commit 2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2

Authored by Jamal Hadi Salim
Committed by David S. Miller
1 parent 02dba025b0

[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>

Showing 3 changed files with 9 additions and 2 deletions Side-by-side Diff

Documentation/networking/xfrm_sync.txt
... ... @@ -47,10 +47,13 @@
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:
include/linux/xfrm.h
... ... @@ -289,7 +289,9 @@
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 {
net/xfrm/xfrm_user.c
... ... @@ -1281,10 +1281,12 @@
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);