Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b5f6dcc authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by David S. Miller
Browse files

[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: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02dba025
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -47,10 +47,13 @@ aevent_id structure looks like:


   struct xfrm_aevent_id {
   struct xfrm_aevent_id {
             struct xfrm_usersa_id           sa_id;
             struct xfrm_usersa_id           sa_id;
             xfrm_address_t                  saddr;
             __u32                           flags;
             __u32                           flags;
             __u32                           reqid;
   };
   };


xfrm_usersa_id in this message layout identifies the SA.
The unique SA is identified by the combination of xfrm_usersa_id,
reqid and saddr.


flags are used to indicate different things. The possible
flags are used to indicate different things. The possible
flags are:
flags are:
+2 −0
Original line number Original line Diff line number Diff line
@@ -289,7 +289,9 @@ struct xfrm_usersa_id {


struct xfrm_aevent_id {
struct xfrm_aevent_id {
	struct xfrm_usersa_id		sa_id;
	struct xfrm_usersa_id		sa_id;
	xfrm_address_t			saddr;
	__u32				flags;
	__u32				flags;
	__u32				reqid;
};
};


struct xfrm_userspi_info {
struct xfrm_userspi_info {
+3 −1
Original line number Original line Diff line number Diff line
@@ -1281,10 +1281,12 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_eve
	id = NLMSG_DATA(nlh);
	id = NLMSG_DATA(nlh);
	nlh->nlmsg_flags = 0;
	nlh->nlmsg_flags = 0;


	id->sa_id.daddr = x->id.daddr;
	memcpy(&id->sa_id.daddr, &x->id.daddr,sizeof(x->id.daddr));
	id->sa_id.spi = x->id.spi;
	id->sa_id.spi = x->id.spi;
	id->sa_id.family = x->props.family;
	id->sa_id.family = x->props.family;
	id->sa_id.proto = x->id.proto;
	id->sa_id.proto = x->id.proto;
	memcpy(&id->saddr, &x->props.saddr,sizeof(x->props.saddr));
	id->reqid = x->props.reqid;
	id->flags = c->data.aevent;
	id->flags = c->data.aevent;


	RTA_PUT(skb, XFRMA_REPLAY_VAL, sizeof(x->replay), &x->replay);
	RTA_PUT(skb, XFRMA_REPLAY_VAL, sizeof(x->replay), &x->replay);