]> err.no Git - linux-2.6/commitdiff
[XFRM]: Fix aevent structuring to be more complete.
authorJamal Hadi Salim <hadi@cyberus.ca>
Sun, 3 Dec 2006 06:22:25 +0000 (22:22 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Dec 2006 06:22:25 +0000 (22:22 -0800)
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>
Documentation/networking/xfrm_sync.txt
include/linux/xfrm.h
net/xfrm/xfrm_user.c

index 8be626f7c0b8f8bce9d0b129a546fc003d769c7f..d7aac9dedeb4266d970e8cc910726a027305a0b3 100644 (file)
@@ -47,10 +47,13 @@ aevent_id structure looks like:
 
    struct xfrm_aevent_id {
              struct xfrm_usersa_id           sa_id;
+             xfrm_address_t                  saddr;
              __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:
index 7907c42bd4e45e927e078d22f3ea0edc771247e7..088ba8113f7ea479997b77305c9ce91bfa7ed691 100644 (file)
@@ -289,7 +289,9 @@ struct xfrm_usersa_id {
 
 struct xfrm_aevent_id {
        struct xfrm_usersa_id           sa_id;
+       xfrm_address_t                  saddr;
        __u32                           flags;
+       __u32                           reqid;
 };
 
 struct xfrm_userspi_info {
index 055b72fb37bc632a9cc3f1d1e0a1ebfb9fb183a8..6f97665983d274f60509109450d441c2b602b953 100644 (file)
@@ -1281,10 +1281,12 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_eve
        id = NLMSG_DATA(nlh);
        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.family = x->props.family;
        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;
 
        RTA_PUT(skb, XFRMA_REPLAY_VAL, sizeof(x->replay), &x->replay);