diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-06-19 01:44:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-19 01:44:00 -0400 |
commit | bf08867f91a43aa3ba2e4598c06c4769a6cdddf6 (patch) | |
tree | 316504b4756a32d802ea037815f2d9022ab88bfe /net/xfrm | |
parent | 4f09f0bbc1cb3c74e8f2047ad4be201a059829ee (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')
-rw-r--r-- | net/xfrm/xfrm_state.c | 5 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 9 |
2 files changed, 6 insertions, 8 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 94f7416a4ab..e068bd72105 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -835,7 +835,7 @@ static void km_state_expired(struct xfrm_state *x, int hard) | |||
835 | { | 835 | { |
836 | struct km_event c; | 836 | struct km_event c; |
837 | 837 | ||
838 | c.data = hard; | 838 | c.data.hard = hard; |
839 | c.event = XFRM_SAP_EXPIRED; | 839 | c.event = XFRM_SAP_EXPIRED; |
840 | km_state_notify(x, &c); | 840 | km_state_notify(x, &c); |
841 | 841 | ||
@@ -883,8 +883,7 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard) | |||
883 | { | 883 | { |
884 | struct km_event c; | 884 | struct km_event c; |
885 | 885 | ||
886 | c.data = hard; | 886 | c.data.hard = hard; |
887 | c.data = hard; | ||
888 | c.event = XFRM_SAP_EXPIRED; | 887 | c.event = XFRM_SAP_EXPIRED; |
889 | km_policy_notify(pol, dir, &c); | 888 | km_policy_notify(pol, dir, &c); |
890 | 889 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index bd8e6882c08..4d3237d08ff 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: | |||
1129 | static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) | 1129 | static 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; |