diff options
author | David S. Miller <davem@davemloft.net> | 2014-01-14 02:14:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-14 02:14:25 -0500 |
commit | aef2b45fe459428d1861a74b08f3f57e87411f56 (patch) | |
tree | c2a4438c1b65afd6f805efe274817b9f04270dae /net/xfrm | |
parent | 2afe02eed1ac565e5ba90254706e67f670ae41a2 (diff) | |
parent | 6bae919003602729d6f5920315bf71ca78bd9e48 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Conflicts:
net/xfrm/xfrm_policy.c
Steffen Klassert says:
====================
This pull request has a merge conflict between commits be7928d20bab
("net: xfrm: xfrm_policy: fix inline not at beginning of declaration") and
da7c224b1baa ("net: xfrm: xfrm_policy: silence compiler warning") from
the net-next tree and commit 2f3ea9a95c58 ("xfrm: checkpatch erros with
inline keyword position") from the ipsec-next tree.
The version from net-next can be used, like it is done in linux-next.
1) Checkpatch cleanups, from Weilong Chen.
2) Fix lockdep complaints when pktgen is used with IPsec,
from Fan Du.
3) Update pktgen to allow any combination of IPsec transport/tunnel mode
and AH/ESP/IPcomp type, from Fan Du.
4) Make pktgen_dst_metrics static, Fengguang Wu.
5) Compile fix for pktgen when CONFIG_XFRM is not set,
from Fan Du.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_input.c | 6 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 32 | ||||
-rw-r--r-- | net/xfrm/xfrm_proc.c | 2 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 44 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 6 |
5 files changed, 56 insertions, 34 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 88843996f935..6c7ac016ce3a 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -67,7 +67,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq) | |||
67 | case IPPROTO_COMP: | 67 | case IPPROTO_COMP: |
68 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) | 68 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) |
69 | return -EINVAL; | 69 | return -EINVAL; |
70 | *spi = htonl(ntohs(*(__be16*)(skb_transport_header(skb) + 2))); | 70 | *spi = htonl(ntohs(*(__be16 *)(skb_transport_header(skb) + 2))); |
71 | *seq = 0; | 71 | *seq = 0; |
72 | return 0; | 72 | return 0; |
73 | default: | 73 | default: |
@@ -77,8 +77,8 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq) | |||
77 | if (!pskb_may_pull(skb, hlen)) | 77 | if (!pskb_may_pull(skb, hlen)) |
78 | return -EINVAL; | 78 | return -EINVAL; |
79 | 79 | ||
80 | *spi = *(__be32*)(skb_transport_header(skb) + offset); | 80 | *spi = *(__be32 *)(skb_transport_header(skb) + offset); |
81 | *seq = *(__be32*)(skb_transport_header(skb) + offset_seq); | 81 | *seq = *(__be32 *)(skb_transport_header(skb) + offset_seq); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index e205c4b56afb..01770826a15a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -171,7 +171,7 @@ static inline unsigned long make_jiffies(long secs) | |||
171 | 171 | ||
172 | static void xfrm_policy_timer(unsigned long data) | 172 | static void xfrm_policy_timer(unsigned long data) |
173 | { | 173 | { |
174 | struct xfrm_policy *xp = (struct xfrm_policy*)data; | 174 | struct xfrm_policy *xp = (struct xfrm_policy *)data; |
175 | unsigned long now = get_seconds(); | 175 | unsigned long now = get_seconds(); |
176 | long next = LONG_MAX; | 176 | long next = LONG_MAX; |
177 | int warn = 0; | 177 | int warn = 0; |
@@ -1286,7 +1286,7 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, | |||
1286 | xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); | 1286 | xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); |
1287 | xfrm_address_t tmp; | 1287 | xfrm_address_t tmp; |
1288 | 1288 | ||
1289 | for (nx=0, i = 0; i < policy->xfrm_nr; i++) { | 1289 | for (nx = 0, i = 0; i < policy->xfrm_nr; i++) { |
1290 | struct xfrm_state *x; | 1290 | struct xfrm_state *x; |
1291 | xfrm_address_t *remote = daddr; | 1291 | xfrm_address_t *remote = daddr; |
1292 | xfrm_address_t *local = saddr; | 1292 | xfrm_address_t *local = saddr; |
@@ -1316,9 +1316,9 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, | |||
1316 | error = (x->km.state == XFRM_STATE_ERROR ? | 1316 | error = (x->km.state == XFRM_STATE_ERROR ? |
1317 | -EINVAL : -EAGAIN); | 1317 | -EINVAL : -EAGAIN); |
1318 | xfrm_state_put(x); | 1318 | xfrm_state_put(x); |
1319 | } | 1319 | } else if (error == -ESRCH) { |
1320 | else if (error == -ESRCH) | ||
1321 | error = -EAGAIN; | 1320 | error = -EAGAIN; |
1321 | } | ||
1322 | 1322 | ||
1323 | if (!tmpl->optional) | 1323 | if (!tmpl->optional) |
1324 | goto fail; | 1324 | goto fail; |
@@ -1326,7 +1326,7 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, | |||
1326 | return nx; | 1326 | return nx; |
1327 | 1327 | ||
1328 | fail: | 1328 | fail: |
1329 | for (nx--; nx>=0; nx--) | 1329 | for (nx--; nx >= 0; nx--) |
1330 | xfrm_state_put(xfrm[nx]); | 1330 | xfrm_state_put(xfrm[nx]); |
1331 | return error; | 1331 | return error; |
1332 | } | 1332 | } |
@@ -1363,7 +1363,7 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl, | |||
1363 | return cnx; | 1363 | return cnx; |
1364 | 1364 | ||
1365 | fail: | 1365 | fail: |
1366 | for (cnx--; cnx>=0; cnx--) | 1366 | for (cnx--; cnx >= 0; cnx--) |
1367 | xfrm_state_put(tpp[cnx]); | 1367 | xfrm_state_put(tpp[cnx]); |
1368 | return error; | 1368 | return error; |
1369 | 1369 | ||
@@ -1706,7 +1706,7 @@ static int xfrm_expand_policies(const struct flowi *fl, u16 family, | |||
1706 | xfrm_pols_put(pols, *num_pols); | 1706 | xfrm_pols_put(pols, *num_pols); |
1707 | return PTR_ERR(pols[1]); | 1707 | return PTR_ERR(pols[1]); |
1708 | } | 1708 | } |
1709 | (*num_pols) ++; | 1709 | (*num_pols)++; |
1710 | (*num_xfrms) += pols[1]->xfrm_nr; | 1710 | (*num_xfrms) += pols[1]->xfrm_nr; |
1711 | } | 1711 | } |
1712 | } | 1712 | } |
@@ -1760,7 +1760,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, | |||
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | xdst->num_pols = num_pols; | 1762 | xdst->num_pols = num_pols; |
1763 | memcpy(xdst->pols, pols, sizeof(struct xfrm_policy*) * num_pols); | 1763 | memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); |
1764 | xdst->policy_genid = atomic_read(&pols[0]->genid); | 1764 | xdst->policy_genid = atomic_read(&pols[0]->genid); |
1765 | 1765 | ||
1766 | return xdst; | 1766 | return xdst; |
@@ -2029,7 +2029,7 @@ make_dummy_bundle: | |||
2029 | } | 2029 | } |
2030 | xdst->num_pols = num_pols; | 2030 | xdst->num_pols = num_pols; |
2031 | xdst->num_xfrms = num_xfrms; | 2031 | xdst->num_xfrms = num_xfrms; |
2032 | memcpy(xdst->pols, pols, sizeof(struct xfrm_policy*) * num_pols); | 2032 | memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols); |
2033 | 2033 | ||
2034 | dst_hold(&xdst->u.dst); | 2034 | dst_hold(&xdst->u.dst); |
2035 | return &xdst->flo; | 2035 | return &xdst->flo; |
@@ -2138,7 +2138,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | |||
2138 | 2138 | ||
2139 | num_pols = xdst->num_pols; | 2139 | num_pols = xdst->num_pols; |
2140 | num_xfrms = xdst->num_xfrms; | 2140 | num_xfrms = xdst->num_xfrms; |
2141 | memcpy(pols, xdst->pols, sizeof(struct xfrm_policy*) * num_pols); | 2141 | memcpy(pols, xdst->pols, sizeof(struct xfrm_policy *) * num_pols); |
2142 | route = xdst->route; | 2142 | route = xdst->route; |
2143 | } | 2143 | } |
2144 | 2144 | ||
@@ -2334,7 +2334,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
2334 | if (skb->sp) { | 2334 | if (skb->sp) { |
2335 | int i; | 2335 | int i; |
2336 | 2336 | ||
2337 | for (i=skb->sp->len-1; i>=0; i--) { | 2337 | for (i = skb->sp->len-1; i >= 0; i--) { |
2338 | struct xfrm_state *x = skb->sp->xvec[i]; | 2338 | struct xfrm_state *x = skb->sp->xvec[i]; |
2339 | if (!xfrm_selector_match(&x->sel, &fl, family)) { | 2339 | if (!xfrm_selector_match(&x->sel, &fl, family)) { |
2340 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMISMATCH); | 2340 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMISMATCH); |
@@ -2380,7 +2380,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
2380 | pol->curlft.use_time = get_seconds(); | 2380 | pol->curlft.use_time = get_seconds(); |
2381 | 2381 | ||
2382 | pols[0] = pol; | 2382 | pols[0] = pol; |
2383 | npols ++; | 2383 | npols++; |
2384 | #ifdef CONFIG_XFRM_SUB_POLICY | 2384 | #ifdef CONFIG_XFRM_SUB_POLICY |
2385 | if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { | 2385 | if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { |
2386 | pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, | 2386 | pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, |
@@ -2392,7 +2392,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, | |||
2392 | return 0; | 2392 | return 0; |
2393 | } | 2393 | } |
2394 | pols[1]->curlft.use_time = get_seconds(); | 2394 | pols[1]->curlft.use_time = get_seconds(); |
2395 | npols ++; | 2395 | npols++; |
2396 | } | 2396 | } |
2397 | } | 2397 | } |
2398 | #endif | 2398 | #endif |
@@ -2989,7 +2989,7 @@ static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp, | |||
2989 | audit_log_format(audit_buf, " sec_alg=%u sec_doi=%u sec_obj=%s", | 2989 | audit_log_format(audit_buf, " sec_alg=%u sec_doi=%u sec_obj=%s", |
2990 | ctx->ctx_alg, ctx->ctx_doi, ctx->ctx_str); | 2990 | ctx->ctx_alg, ctx->ctx_doi, ctx->ctx_str); |
2991 | 2991 | ||
2992 | switch(sel->family) { | 2992 | switch (sel->family) { |
2993 | case AF_INET: | 2993 | case AF_INET: |
2994 | audit_log_format(audit_buf, " src=%pI4", &sel->saddr.a4); | 2994 | audit_log_format(audit_buf, " src=%pI4", &sel->saddr.a4); |
2995 | if (sel->prefixlen_s != 32) | 2995 | if (sel->prefixlen_s != 32) |
@@ -3066,8 +3066,8 @@ static bool xfrm_migrate_selector_match(const struct xfrm_selector *sel_cmp, | |||
3066 | return false; | 3066 | return false; |
3067 | } | 3067 | } |
3068 | 3068 | ||
3069 | static struct xfrm_policy * xfrm_migrate_policy_find(const struct xfrm_selector *sel, | 3069 | static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *sel, |
3070 | u8 dir, u8 type, struct net *net) | 3070 | u8 dir, u8 type, struct net *net) |
3071 | { | 3071 | { |
3072 | struct xfrm_policy *pol, *ret = NULL; | 3072 | struct xfrm_policy *pol, *ret = NULL; |
3073 | struct hlist_head *chain; | 3073 | struct hlist_head *chain; |
diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c index 80cd1e55b834..fc5abd0b456f 100644 --- a/net/xfrm/xfrm_proc.c +++ b/net/xfrm/xfrm_proc.c | |||
@@ -52,7 +52,7 @@ static int xfrm_statistics_seq_show(struct seq_file *seq, void *v) | |||
52 | { | 52 | { |
53 | struct net *net = seq->private; | 53 | struct net *net = seq->private; |
54 | int i; | 54 | int i; |
55 | for (i=0; xfrm_mib_list[i].name; i++) | 55 | for (i = 0; xfrm_mib_list[i].name; i++) |
56 | seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name, | 56 | seq_printf(seq, "%-24s\t%lu\n", xfrm_mib_list[i].name, |
57 | snmp_fold_field((void __percpu **) | 57 | snmp_fold_field((void __percpu **) |
58 | net->mib.xfrm_statistics, | 58 | net->mib.xfrm_statistics, |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index a62c25ea3631..62181486ead8 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -382,7 +382,7 @@ static inline unsigned long make_jiffies(long secs) | |||
382 | return secs*HZ; | 382 | return secs*HZ; |
383 | } | 383 | } |
384 | 384 | ||
385 | static enum hrtimer_restart xfrm_timer_handler(struct hrtimer * me) | 385 | static enum hrtimer_restart xfrm_timer_handler(struct hrtimer *me) |
386 | { | 386 | { |
387 | struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer); | 387 | struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer); |
388 | struct xfrm_state *x = container_of(thr, struct xfrm_state, mtimer); | 388 | struct xfrm_state *x = container_of(thr, struct xfrm_state, mtimer); |
@@ -448,7 +448,7 @@ static enum hrtimer_restart xfrm_timer_handler(struct hrtimer * me) | |||
448 | if (warn) | 448 | if (warn) |
449 | km_state_expired(x, 0, 0); | 449 | km_state_expired(x, 0, 0); |
450 | resched: | 450 | resched: |
451 | if (next != LONG_MAX){ | 451 | if (next != LONG_MAX) { |
452 | tasklet_hrtimer_start(&x->mtimer, ktime_set(next, 0), HRTIMER_MODE_REL); | 452 | tasklet_hrtimer_start(&x->mtimer, ktime_set(next, 0), HRTIMER_MODE_REL); |
453 | } | 453 | } |
454 | 454 | ||
@@ -890,7 +890,7 @@ xfrm_stateonly_find(struct net *net, u32 mark, | |||
890 | unsigned int h; | 890 | unsigned int h; |
891 | struct xfrm_state *rx = NULL, *x = NULL; | 891 | struct xfrm_state *rx = NULL, *x = NULL; |
892 | 892 | ||
893 | spin_lock(&net->xfrm.xfrm_state_lock); | 893 | spin_lock_bh(&net->xfrm.xfrm_state_lock); |
894 | h = xfrm_dst_hash(net, daddr, saddr, reqid, family); | 894 | h = xfrm_dst_hash(net, daddr, saddr, reqid, family); |
895 | hlist_for_each_entry(x, net->xfrm.state_bydst+h, bydst) { | 895 | hlist_for_each_entry(x, net->xfrm.state_bydst+h, bydst) { |
896 | if (x->props.family == family && | 896 | if (x->props.family == family && |
@@ -908,13 +908,35 @@ xfrm_stateonly_find(struct net *net, u32 mark, | |||
908 | 908 | ||
909 | if (rx) | 909 | if (rx) |
910 | xfrm_state_hold(rx); | 910 | xfrm_state_hold(rx); |
911 | spin_unlock(&net->xfrm.xfrm_state_lock); | 911 | spin_unlock_bh(&net->xfrm.xfrm_state_lock); |
912 | 912 | ||
913 | 913 | ||
914 | return rx; | 914 | return rx; |
915 | } | 915 | } |
916 | EXPORT_SYMBOL(xfrm_stateonly_find); | 916 | EXPORT_SYMBOL(xfrm_stateonly_find); |
917 | 917 | ||
918 | struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi, | ||
919 | unsigned short family) | ||
920 | { | ||
921 | struct xfrm_state *x; | ||
922 | struct xfrm_state_walk *w; | ||
923 | |||
924 | spin_lock_bh(&net->xfrm.xfrm_state_lock); | ||
925 | list_for_each_entry(w, &net->xfrm.state_all, all) { | ||
926 | x = container_of(w, struct xfrm_state, km); | ||
927 | if (x->props.family != family || | ||
928 | x->id.spi != spi) | ||
929 | continue; | ||
930 | |||
931 | spin_unlock_bh(&net->xfrm.xfrm_state_lock); | ||
932 | xfrm_state_hold(x); | ||
933 | return x; | ||
934 | } | ||
935 | spin_unlock_bh(&net->xfrm.xfrm_state_lock); | ||
936 | return NULL; | ||
937 | } | ||
938 | EXPORT_SYMBOL(xfrm_state_lookup_byspi); | ||
939 | |||
918 | static void __xfrm_state_insert(struct xfrm_state *x) | 940 | static void __xfrm_state_insert(struct xfrm_state *x) |
919 | { | 941 | { |
920 | struct net *net = xs_net(x); | 942 | struct net *net = xs_net(x); |
@@ -1237,8 +1259,8 @@ struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *n | |||
1237 | } | 1259 | } |
1238 | EXPORT_SYMBOL(xfrm_migrate_state_find); | 1260 | EXPORT_SYMBOL(xfrm_migrate_state_find); |
1239 | 1261 | ||
1240 | struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | 1262 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, |
1241 | struct xfrm_migrate *m) | 1263 | struct xfrm_migrate *m) |
1242 | { | 1264 | { |
1243 | struct xfrm_state *xc; | 1265 | struct xfrm_state *xc; |
1244 | int err; | 1266 | int err; |
@@ -1348,7 +1370,7 @@ int xfrm_state_check_expire(struct xfrm_state *x) | |||
1348 | if (x->curlft.bytes >= x->lft.hard_byte_limit || | 1370 | if (x->curlft.bytes >= x->lft.hard_byte_limit || |
1349 | x->curlft.packets >= x->lft.hard_packet_limit) { | 1371 | x->curlft.packets >= x->lft.hard_packet_limit) { |
1350 | x->km.state = XFRM_STATE_EXPIRED; | 1372 | x->km.state = XFRM_STATE_EXPIRED; |
1351 | tasklet_hrtimer_start(&x->mtimer, ktime_set(0,0), HRTIMER_MODE_REL); | 1373 | tasklet_hrtimer_start(&x->mtimer, ktime_set(0, 0), HRTIMER_MODE_REL); |
1352 | return -EINVAL; | 1374 | return -EINVAL; |
1353 | } | 1375 | } |
1354 | 1376 | ||
@@ -1542,7 +1564,7 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high) | |||
1542 | x->id.spi = minspi; | 1564 | x->id.spi = minspi; |
1543 | } else { | 1565 | } else { |
1544 | u32 spi = 0; | 1566 | u32 spi = 0; |
1545 | for (h=0; h<high-low+1; h++) { | 1567 | for (h = 0; h < high-low+1; h++) { |
1546 | spi = low + net_random()%(high-low+1); | 1568 | spi = low + net_random()%(high-low+1); |
1547 | x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family); | 1569 | x0 = xfrm_state_lookup(net, mark, &x->id.daddr, htonl(spi), x->id.proto, x->props.family); |
1548 | if (x0 == NULL) { | 1570 | if (x0 == NULL) { |
@@ -1630,7 +1652,7 @@ EXPORT_SYMBOL(xfrm_state_walk_done); | |||
1630 | 1652 | ||
1631 | static void xfrm_replay_timer_handler(unsigned long data) | 1653 | static void xfrm_replay_timer_handler(unsigned long data) |
1632 | { | 1654 | { |
1633 | struct xfrm_state *x = (struct xfrm_state*)data; | 1655 | struct xfrm_state *x = (struct xfrm_state *)data; |
1634 | 1656 | ||
1635 | spin_lock(&x->lock); | 1657 | spin_lock(&x->lock); |
1636 | 1658 | ||
@@ -2079,7 +2101,7 @@ static void xfrm_audit_helper_sainfo(struct xfrm_state *x, | |||
2079 | audit_log_format(audit_buf, " sec_alg=%u sec_doi=%u sec_obj=%s", | 2101 | audit_log_format(audit_buf, " sec_alg=%u sec_doi=%u sec_obj=%s", |
2080 | ctx->ctx_alg, ctx->ctx_doi, ctx->ctx_str); | 2102 | ctx->ctx_alg, ctx->ctx_doi, ctx->ctx_str); |
2081 | 2103 | ||
2082 | switch(x->props.family) { | 2104 | switch (x->props.family) { |
2083 | case AF_INET: | 2105 | case AF_INET: |
2084 | audit_log_format(audit_buf, " src=%pI4 dst=%pI4", | 2106 | audit_log_format(audit_buf, " src=%pI4 dst=%pI4", |
2085 | &x->props.saddr.a4, &x->id.daddr.a4); | 2107 | &x->props.saddr.a4, &x->id.daddr.a4); |
@@ -2109,7 +2131,7 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family, | |||
2109 | iph6 = ipv6_hdr(skb); | 2131 | iph6 = ipv6_hdr(skb); |
2110 | audit_log_format(audit_buf, | 2132 | audit_log_format(audit_buf, |
2111 | " src=%pI6 dst=%pI6 flowlbl=0x%x%02x%02x", | 2133 | " src=%pI6 dst=%pI6 flowlbl=0x%x%02x%02x", |
2112 | &iph6->saddr,&iph6->daddr, | 2134 | &iph6->saddr, &iph6->daddr, |
2113 | iph6->flow_lbl[0] & 0x0f, | 2135 | iph6->flow_lbl[0] & 0x0f, |
2114 | iph6->flow_lbl[1], | 2136 | iph6->flow_lbl[1], |
2115 | iph6->flow_lbl[2]); | 2137 | iph6->flow_lbl[2]); |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 97681a390402..334856689b0d 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1731,11 +1731,11 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct | |||
1731 | return -EMSGSIZE; | 1731 | return -EMSGSIZE; |
1732 | 1732 | ||
1733 | id = nlmsg_data(nlh); | 1733 | id = nlmsg_data(nlh); |
1734 | memcpy(&id->sa_id.daddr, &x->id.daddr,sizeof(x->id.daddr)); | 1734 | memcpy(&id->sa_id.daddr, &x->id.daddr, sizeof(x->id.daddr)); |
1735 | id->sa_id.spi = x->id.spi; | 1735 | id->sa_id.spi = x->id.spi; |
1736 | id->sa_id.family = x->props.family; | 1736 | id->sa_id.family = x->props.family; |
1737 | id->sa_id.proto = x->id.proto; | 1737 | id->sa_id.proto = x->id.proto; |
1738 | memcpy(&id->saddr, &x->props.saddr,sizeof(x->props.saddr)); | 1738 | memcpy(&id->saddr, &x->props.saddr, sizeof(x->props.saddr)); |
1739 | id->reqid = x->props.reqid; | 1739 | id->reqid = x->props.reqid; |
1740 | id->flags = c->data.aevent; | 1740 | id->flags = c->data.aevent; |
1741 | 1741 | ||
@@ -1824,7 +1824,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1824 | struct net *net = sock_net(skb->sk); | 1824 | struct net *net = sock_net(skb->sk); |
1825 | struct xfrm_state *x; | 1825 | struct xfrm_state *x; |
1826 | struct km_event c; | 1826 | struct km_event c; |
1827 | int err = - EINVAL; | 1827 | int err = -EINVAL; |
1828 | u32 mark = 0; | 1828 | u32 mark = 0; |
1829 | struct xfrm_mark m; | 1829 | struct xfrm_mark m; |
1830 | struct xfrm_aevent_id *p = nlmsg_data(nlh); | 1830 | struct xfrm_aevent_id *p = nlmsg_data(nlh); |