aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-06-19 01:44:00 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-19 01:44:00 -0400
commitbf08867f91a43aa3ba2e4598c06c4769a6cdddf6 (patch)
tree316504b4756a32d802ea037815f2d9022ab88bfe /net/xfrm/xfrm_user.c
parent4f09f0bbc1cb3c74e8f2047ad4be201a059829ee (diff)
[IPSEC] Turn km_event.data into a union
This patch turns km_event.data into a union. This makes code that uses it clearer. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index bd8e6882c083..4d3237d08ffb 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -900,7 +900,7 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma
900 struct xfrm_usersa_flush *p = NLMSG_DATA(nlh); 900 struct xfrm_usersa_flush *p = NLMSG_DATA(nlh);
901 901
902 xfrm_state_flush(p->proto); 902 xfrm_state_flush(p->proto);
903 c.data = p->proto; 903 c.data.proto = p->proto;
904 c.event = XFRM_SAP_FLUSHED; 904 c.event = XFRM_SAP_FLUSHED;
905 c.seq = nlh->nlmsg_seq; 905 c.seq = nlh->nlmsg_seq;
906 c.pid = nlh->nlmsg_pid; 906 c.pid = nlh->nlmsg_pid;
@@ -1129,14 +1129,13 @@ nlmsg_failure:
1129static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) 1129static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
1130{ 1130{
1131 struct sk_buff *skb; 1131 struct sk_buff *skb;
1132 int hard = c ->data;
1133 1132
1134 /* fix to do alloc using NLM macros */ 1133 /* fix to do alloc using NLM macros */
1135 skb = alloc_skb(sizeof(struct xfrm_user_expire) + 16, GFP_ATOMIC); 1134 skb = alloc_skb(sizeof(struct xfrm_user_expire) + 16, GFP_ATOMIC);
1136 if (skb == NULL) 1135 if (skb == NULL)
1137 return -ENOMEM; 1136 return -ENOMEM;
1138 1137
1139 if (build_expire(skb, x, hard) < 0) 1138 if (build_expire(skb, x, c->data.hard) < 0)
1140 BUG(); 1139 BUG();
1141 1140
1142 NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE; 1141 NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE;
@@ -1162,7 +1161,7 @@ static int xfrm_notify_sa_flush(struct km_event *c)
1162 nlh->nlmsg_flags = 0; 1161 nlh->nlmsg_flags = 0;
1163 1162
1164 p = NLMSG_DATA(nlh); 1163 p = NLMSG_DATA(nlh);
1165 p->proto = c->data; 1164 p->proto = c->data.proto;
1166 1165
1167 nlh->nlmsg_len = skb->tail - b; 1166 nlh->nlmsg_len = skb->tail - b;
1168 1167
@@ -1404,7 +1403,7 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
1404 if (skb == NULL) 1403 if (skb == NULL)
1405 return -ENOMEM; 1404 return -ENOMEM;
1406 1405
1407 if (build_polexpire(skb, xp, dir, c->data) < 0) 1406 if (build_polexpire(skb, xp, dir, c->data.hard) < 0)
1408 BUG(); 1407 BUG();
1409 1408
1410 NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE; 1409 NETLINK_CB(skb).dst_groups = XFRMGRP_EXPIRE;