diff options
-rw-r--r-- | net/xfrm/xfrm_user.c | 75 |
1 files changed, 26 insertions, 49 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ec480b69510b..2c74db0c9233 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -583,7 +583,6 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr) | |||
583 | struct sk_buff *skb = sp->out_skb; | 583 | struct sk_buff *skb = sp->out_skb; |
584 | struct xfrm_usersa_info *p; | 584 | struct xfrm_usersa_info *p; |
585 | struct nlmsghdr *nlh; | 585 | struct nlmsghdr *nlh; |
586 | unsigned char *b = skb_tail_pointer(skb); | ||
587 | 586 | ||
588 | if (sp->this_idx < sp->start_idx) | 587 | if (sp->this_idx < sp->start_idx) |
589 | goto out; | 588 | goto out; |
@@ -628,14 +627,14 @@ static int dump_one_state(struct xfrm_state *x, int count, void *ptr) | |||
628 | if (x->lastused) | 627 | if (x->lastused) |
629 | RTA_PUT(skb, XFRMA_LASTUSED, sizeof(x->lastused), &x->lastused); | 628 | RTA_PUT(skb, XFRMA_LASTUSED, sizeof(x->lastused), &x->lastused); |
630 | 629 | ||
631 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 630 | nlmsg_end(skb, nlh); |
632 | out: | 631 | out: |
633 | sp->this_idx++; | 632 | sp->this_idx++; |
634 | return 0; | 633 | return 0; |
635 | 634 | ||
636 | rtattr_failure: | 635 | rtattr_failure: |
637 | nlmsg_trim(skb, b); | 636 | nlmsg_cancel(skb, nlh); |
638 | return -1; | 637 | return -EMSGSIZE; |
639 | } | 638 | } |
640 | 639 | ||
641 | static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | 640 | static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) |
@@ -1270,7 +1269,6 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr | |||
1270 | struct sk_buff *in_skb = sp->in_skb; | 1269 | struct sk_buff *in_skb = sp->in_skb; |
1271 | struct sk_buff *skb = sp->out_skb; | 1270 | struct sk_buff *skb = sp->out_skb; |
1272 | struct nlmsghdr *nlh; | 1271 | struct nlmsghdr *nlh; |
1273 | unsigned char *b = skb_tail_pointer(skb); | ||
1274 | 1272 | ||
1275 | if (sp->this_idx < sp->start_idx) | 1273 | if (sp->this_idx < sp->start_idx) |
1276 | goto out; | 1274 | goto out; |
@@ -1289,14 +1287,14 @@ static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr | |||
1289 | if (copy_to_user_policy_type(xp->type, skb) < 0) | 1287 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
1290 | goto nlmsg_failure; | 1288 | goto nlmsg_failure; |
1291 | 1289 | ||
1292 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 1290 | nlmsg_end(skb, nlh); |
1293 | out: | 1291 | out: |
1294 | sp->this_idx++; | 1292 | sp->this_idx++; |
1295 | return 0; | 1293 | return 0; |
1296 | 1294 | ||
1297 | nlmsg_failure: | 1295 | nlmsg_failure: |
1298 | nlmsg_trim(skb, b); | 1296 | nlmsg_cancel(skb, nlh); |
1299 | return -1; | 1297 | return -EMSGSIZE; |
1300 | } | 1298 | } |
1301 | 1299 | ||
1302 | static int xfrm_dump_policy(struct sk_buff *skb, struct netlink_callback *cb) | 1300 | static int xfrm_dump_policy(struct sk_buff *skb, struct netlink_callback *cb) |
@@ -1446,7 +1444,6 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
1446 | struct xfrm_aevent_id *id; | 1444 | struct xfrm_aevent_id *id; |
1447 | struct nlmsghdr *nlh; | 1445 | struct nlmsghdr *nlh; |
1448 | struct xfrm_lifetime_cur ltime; | 1446 | struct xfrm_lifetime_cur ltime; |
1449 | unsigned char *b = skb_tail_pointer(skb); | ||
1450 | 1447 | ||
1451 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); | 1448 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); |
1452 | if (nlh == NULL) | 1449 | if (nlh == NULL) |
@@ -1479,12 +1476,11 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
1479 | RTA_PUT(skb,XFRMA_ETIMER_THRESH,sizeof(u32),&etimer); | 1476 | RTA_PUT(skb,XFRMA_ETIMER_THRESH,sizeof(u32),&etimer); |
1480 | } | 1477 | } |
1481 | 1478 | ||
1482 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 1479 | return nlmsg_end(skb, nlh); |
1483 | return skb->len; | ||
1484 | 1480 | ||
1485 | rtattr_failure: | 1481 | rtattr_failure: |
1486 | nlmsg_trim(skb, b); | 1482 | nlmsg_cancel(skb, nlh); |
1487 | return -1; | 1483 | return -EMSGSIZE; |
1488 | } | 1484 | } |
1489 | 1485 | ||
1490 | static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | 1486 | static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, |
@@ -1862,7 +1858,6 @@ static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m, | |||
1862 | struct xfrm_migrate *mp; | 1858 | struct xfrm_migrate *mp; |
1863 | struct xfrm_userpolicy_id *pol_id; | 1859 | struct xfrm_userpolicy_id *pol_id; |
1864 | struct nlmsghdr *nlh; | 1860 | struct nlmsghdr *nlh; |
1865 | unsigned char *b = skb_tail_pointer(skb); | ||
1866 | int i; | 1861 | int i; |
1867 | 1862 | ||
1868 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); | 1863 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); |
@@ -1883,11 +1878,10 @@ static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m, | |||
1883 | goto nlmsg_failure; | 1878 | goto nlmsg_failure; |
1884 | } | 1879 | } |
1885 | 1880 | ||
1886 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 1881 | return nlmsg_end(skb, nlh); |
1887 | return skb->len; | ||
1888 | nlmsg_failure: | 1882 | nlmsg_failure: |
1889 | nlmsg_trim(skb, b); | 1883 | nlmsg_cancel(skb, nlh); |
1890 | return -1; | 1884 | return -EMSGSIZE; |
1891 | } | 1885 | } |
1892 | 1886 | ||
1893 | static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | 1887 | static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type, |
@@ -2043,7 +2037,6 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
2043 | { | 2037 | { |
2044 | struct xfrm_user_expire *ue; | 2038 | struct xfrm_user_expire *ue; |
2045 | struct nlmsghdr *nlh; | 2039 | struct nlmsghdr *nlh; |
2046 | unsigned char *b = skb_tail_pointer(skb); | ||
2047 | 2040 | ||
2048 | nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); | 2041 | nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); |
2049 | if (nlh == NULL) | 2042 | if (nlh == NULL) |
@@ -2053,8 +2046,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, struct km_eve | |||
2053 | copy_to_user_state(x, &ue->state); | 2046 | copy_to_user_state(x, &ue->state); |
2054 | ue->hard = (c->data.hard != 0) ? 1 : 0; | 2047 | ue->hard = (c->data.hard != 0) ? 1 : 0; |
2055 | 2048 | ||
2056 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 2049 | return nlmsg_end(skb, nlh); |
2057 | return skb->len; | ||
2058 | } | 2050 | } |
2059 | 2051 | ||
2060 | static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) | 2052 | static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c) |
@@ -2096,13 +2088,11 @@ static int xfrm_notify_sa_flush(struct km_event *c) | |||
2096 | struct xfrm_usersa_flush *p; | 2088 | struct xfrm_usersa_flush *p; |
2097 | struct nlmsghdr *nlh; | 2089 | struct nlmsghdr *nlh; |
2098 | struct sk_buff *skb; | 2090 | struct sk_buff *skb; |
2099 | sk_buff_data_t b; | ||
2100 | int len = NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)); | 2091 | int len = NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)); |
2101 | 2092 | ||
2102 | skb = alloc_skb(len, GFP_ATOMIC); | 2093 | skb = alloc_skb(len, GFP_ATOMIC); |
2103 | if (skb == NULL) | 2094 | if (skb == NULL) |
2104 | return -ENOMEM; | 2095 | return -ENOMEM; |
2105 | b = skb->tail; | ||
2106 | 2096 | ||
2107 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); | 2097 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); |
2108 | if (nlh == NULL) { | 2098 | if (nlh == NULL) { |
@@ -2113,7 +2103,7 @@ static int xfrm_notify_sa_flush(struct km_event *c) | |||
2113 | p = NLMSG_DATA(nlh); | 2103 | p = NLMSG_DATA(nlh); |
2114 | p->proto = c->data.proto; | 2104 | p->proto = c->data.proto; |
2115 | 2105 | ||
2116 | nlh->nlmsg_len = skb->tail - b; | 2106 | nlmsg_end(skb, nlh); |
2117 | 2107 | ||
2118 | NETLINK_CB(skb).dst_group = XFRMNLGRP_SA; | 2108 | NETLINK_CB(skb).dst_group = XFRMNLGRP_SA; |
2119 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC); | 2109 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC); |
@@ -2140,7 +2130,6 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c) | |||
2140 | struct xfrm_usersa_id *id; | 2130 | struct xfrm_usersa_id *id; |
2141 | struct nlmsghdr *nlh; | 2131 | struct nlmsghdr *nlh; |
2142 | struct sk_buff *skb; | 2132 | struct sk_buff *skb; |
2143 | sk_buff_data_t b; | ||
2144 | int len = xfrm_sa_len(x); | 2133 | int len = xfrm_sa_len(x); |
2145 | int headlen; | 2134 | int headlen; |
2146 | 2135 | ||
@@ -2154,7 +2143,6 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c) | |||
2154 | skb = alloc_skb(len, GFP_ATOMIC); | 2143 | skb = alloc_skb(len, GFP_ATOMIC); |
2155 | if (skb == NULL) | 2144 | if (skb == NULL) |
2156 | return -ENOMEM; | 2145 | return -ENOMEM; |
2157 | b = skb->tail; | ||
2158 | 2146 | ||
2159 | nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); | 2147 | nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); |
2160 | if (nlh == NULL) | 2148 | if (nlh == NULL) |
@@ -2185,7 +2173,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c) | |||
2185 | if (x->encap) | 2173 | if (x->encap) |
2186 | RTA_PUT(skb, XFRMA_ENCAP, sizeof(*x->encap), x->encap); | 2174 | RTA_PUT(skb, XFRMA_ENCAP, sizeof(*x->encap), x->encap); |
2187 | 2175 | ||
2188 | nlh->nlmsg_len = skb->tail - b; | 2176 | nlmsg_end(skb, nlh); |
2189 | 2177 | ||
2190 | NETLINK_CB(skb).dst_group = XFRMNLGRP_SA; | 2178 | NETLINK_CB(skb).dst_group = XFRMNLGRP_SA; |
2191 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC); | 2179 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_SA, GFP_ATOMIC); |
@@ -2225,7 +2213,6 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, | |||
2225 | { | 2213 | { |
2226 | struct xfrm_user_acquire *ua; | 2214 | struct xfrm_user_acquire *ua; |
2227 | struct nlmsghdr *nlh; | 2215 | struct nlmsghdr *nlh; |
2228 | unsigned char *b = skb_tail_pointer(skb); | ||
2229 | __u32 seq = xfrm_get_acqseq(); | 2216 | __u32 seq = xfrm_get_acqseq(); |
2230 | 2217 | ||
2231 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); | 2218 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); |
@@ -2249,12 +2236,11 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, | |||
2249 | if (copy_to_user_policy_type(xp->type, skb) < 0) | 2236 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
2250 | goto nlmsg_failure; | 2237 | goto nlmsg_failure; |
2251 | 2238 | ||
2252 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 2239 | return nlmsg_end(skb, nlh); |
2253 | return skb->len; | ||
2254 | 2240 | ||
2255 | nlmsg_failure: | 2241 | nlmsg_failure: |
2256 | nlmsg_trim(skb, b); | 2242 | nlmsg_cancel(skb, nlh); |
2257 | return -1; | 2243 | return -EMSGSIZE; |
2258 | } | 2244 | } |
2259 | 2245 | ||
2260 | static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, | 2246 | static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, |
@@ -2345,7 +2331,6 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, | |||
2345 | struct xfrm_user_polexpire *upe; | 2331 | struct xfrm_user_polexpire *upe; |
2346 | struct nlmsghdr *nlh; | 2332 | struct nlmsghdr *nlh; |
2347 | int hard = c->data.hard; | 2333 | int hard = c->data.hard; |
2348 | unsigned char *b = skb_tail_pointer(skb); | ||
2349 | 2334 | ||
2350 | nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); | 2335 | nlh = nlmsg_put(skb, c->pid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); |
2351 | if (nlh == NULL) | 2336 | if (nlh == NULL) |
@@ -2361,12 +2346,11 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, | |||
2361 | goto nlmsg_failure; | 2346 | goto nlmsg_failure; |
2362 | upe->hard = !!hard; | 2347 | upe->hard = !!hard; |
2363 | 2348 | ||
2364 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 2349 | return nlmsg_end(skb, nlh); |
2365 | return skb->len; | ||
2366 | 2350 | ||
2367 | nlmsg_failure: | 2351 | nlmsg_failure: |
2368 | nlmsg_trim(skb, b); | 2352 | nlmsg_cancel(skb, nlh); |
2369 | return -1; | 2353 | return -EMSGSIZE; |
2370 | } | 2354 | } |
2371 | 2355 | ||
2372 | static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) | 2356 | static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c) |
@@ -2397,7 +2381,6 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * | |||
2397 | struct xfrm_userpolicy_id *id; | 2381 | struct xfrm_userpolicy_id *id; |
2398 | struct nlmsghdr *nlh; | 2382 | struct nlmsghdr *nlh; |
2399 | struct sk_buff *skb; | 2383 | struct sk_buff *skb; |
2400 | sk_buff_data_t b; | ||
2401 | int len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); | 2384 | int len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); |
2402 | int headlen; | 2385 | int headlen; |
2403 | 2386 | ||
@@ -2414,7 +2397,6 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * | |||
2414 | skb = alloc_skb(len, GFP_ATOMIC); | 2397 | skb = alloc_skb(len, GFP_ATOMIC); |
2415 | if (skb == NULL) | 2398 | if (skb == NULL) |
2416 | return -ENOMEM; | 2399 | return -ENOMEM; |
2417 | b = skb->tail; | ||
2418 | 2400 | ||
2419 | nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); | 2401 | nlh = nlmsg_put(skb, c->pid, c->seq, c->event, headlen, 0); |
2420 | if (nlh == NULL) | 2402 | if (nlh == NULL) |
@@ -2439,7 +2421,7 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event * | |||
2439 | if (copy_to_user_policy_type(xp->type, skb) < 0) | 2421 | if (copy_to_user_policy_type(xp->type, skb) < 0) |
2440 | goto nlmsg_failure; | 2422 | goto nlmsg_failure; |
2441 | 2423 | ||
2442 | nlh->nlmsg_len = skb->tail - b; | 2424 | nlmsg_end(skb, nlh); |
2443 | 2425 | ||
2444 | NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY; | 2426 | NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY; |
2445 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC); | 2427 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC); |
@@ -2454,7 +2436,6 @@ static int xfrm_notify_policy_flush(struct km_event *c) | |||
2454 | { | 2436 | { |
2455 | struct nlmsghdr *nlh; | 2437 | struct nlmsghdr *nlh; |
2456 | struct sk_buff *skb; | 2438 | struct sk_buff *skb; |
2457 | sk_buff_data_t b; | ||
2458 | int len = 0; | 2439 | int len = 0; |
2459 | #ifdef CONFIG_XFRM_SUB_POLICY | 2440 | #ifdef CONFIG_XFRM_SUB_POLICY |
2460 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); | 2441 | len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type)); |
@@ -2464,8 +2445,6 @@ static int xfrm_notify_policy_flush(struct km_event *c) | |||
2464 | skb = alloc_skb(len, GFP_ATOMIC); | 2445 | skb = alloc_skb(len, GFP_ATOMIC); |
2465 | if (skb == NULL) | 2446 | if (skb == NULL) |
2466 | return -ENOMEM; | 2447 | return -ENOMEM; |
2467 | b = skb->tail; | ||
2468 | |||
2469 | 2448 | ||
2470 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); | 2449 | nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); |
2471 | if (nlh == NULL) | 2450 | if (nlh == NULL) |
@@ -2473,7 +2452,7 @@ static int xfrm_notify_policy_flush(struct km_event *c) | |||
2473 | if (copy_to_user_policy_type(c->data.type, skb) < 0) | 2452 | if (copy_to_user_policy_type(c->data.type, skb) < 0) |
2474 | goto nlmsg_failure; | 2453 | goto nlmsg_failure; |
2475 | 2454 | ||
2476 | nlh->nlmsg_len = skb->tail - b; | 2455 | nlmsg_end(skb, nlh); |
2477 | 2456 | ||
2478 | NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY; | 2457 | NETLINK_CB(skb).dst_group = XFRMNLGRP_POLICY; |
2479 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC); | 2458 | return netlink_broadcast(xfrm_nl, skb, 0, XFRMNLGRP_POLICY, GFP_ATOMIC); |
@@ -2508,7 +2487,6 @@ static int build_report(struct sk_buff *skb, u8 proto, | |||
2508 | { | 2487 | { |
2509 | struct xfrm_user_report *ur; | 2488 | struct xfrm_user_report *ur; |
2510 | struct nlmsghdr *nlh; | 2489 | struct nlmsghdr *nlh; |
2511 | unsigned char *b = skb_tail_pointer(skb); | ||
2512 | 2490 | ||
2513 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); | 2491 | nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); |
2514 | if (nlh == NULL) | 2492 | if (nlh == NULL) |
@@ -2521,12 +2499,11 @@ static int build_report(struct sk_buff *skb, u8 proto, | |||
2521 | if (addr) | 2499 | if (addr) |
2522 | RTA_PUT(skb, XFRMA_COADDR, sizeof(*addr), addr); | 2500 | RTA_PUT(skb, XFRMA_COADDR, sizeof(*addr), addr); |
2523 | 2501 | ||
2524 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 2502 | return nlmsg_end(skb, nlh); |
2525 | return skb->len; | ||
2526 | 2503 | ||
2527 | rtattr_failure: | 2504 | rtattr_failure: |
2528 | nlmsg_trim(skb, b); | 2505 | nlmsg_cancel(skb, nlh); |
2529 | return -1; | 2506 | return -EMSGSIZE; |
2530 | } | 2507 | } |
2531 | 2508 | ||
2532 | static int xfrm_send_report(u8 proto, struct xfrm_selector *sel, | 2509 | static int xfrm_send_report(u8 proto, struct xfrm_selector *sel, |