diff options
author | James Morris <james.l.morris@oracle.com> | 2014-11-19 05:32:12 -0500 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2014-11-19 05:32:12 -0500 |
commit | b10778a00d40b3d9fdaaf5891e802794781ff71c (patch) | |
tree | 6ba4cbac86eecedc3f30650e7f764ecf00c83898 /net/ipv6/ip6_output.c | |
parent | 594081ee7145cc30a3977cb4e218f81213b63dc5 (diff) | |
parent | bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9 (diff) |
Merge commit 'v3.17' into next
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 45702b8cd141..0a3448b2888f 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -205,7 +205,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, | |||
205 | if (hlimit < 0) | 205 | if (hlimit < 0) |
206 | hlimit = ip6_dst_hoplimit(dst); | 206 | hlimit = ip6_dst_hoplimit(dst); |
207 | 207 | ||
208 | ip6_flow_hdr(hdr, tclass, fl6->flowlabel); | 208 | ip6_flow_hdr(hdr, tclass, ip6_make_flowlabel(net, skb, fl6->flowlabel, |
209 | np->autoflowlabel)); | ||
209 | 210 | ||
210 | hdr->payload_len = htons(seg_len); | 211 | hdr->payload_len = htons(seg_len); |
211 | hdr->nexthdr = proto; | 212 | hdr->nexthdr = proto; |
@@ -802,8 +803,8 @@ slow_path: | |||
802 | /* | 803 | /* |
803 | * Copy a block of the IP datagram. | 804 | * Copy a block of the IP datagram. |
804 | */ | 805 | */ |
805 | if (skb_copy_bits(skb, ptr, skb_transport_header(frag), len)) | 806 | BUG_ON(skb_copy_bits(skb, ptr, skb_transport_header(frag), |
806 | BUG(); | 807 | len)); |
807 | left -= len; | 808 | left -= len; |
808 | 809 | ||
809 | fh->frag_off = htons(offset); | 810 | fh->frag_off = htons(offset); |
@@ -1008,7 +1009,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
1008 | if (final_dst) | 1009 | if (final_dst) |
1009 | fl6->daddr = *final_dst; | 1010 | fl6->daddr = *final_dst; |
1010 | 1011 | ||
1011 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 1012 | return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
1012 | } | 1013 | } |
1013 | EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); | 1014 | EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow); |
1014 | 1015 | ||
@@ -1040,7 +1041,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
1040 | if (final_dst) | 1041 | if (final_dst) |
1041 | fl6->daddr = *final_dst; | 1042 | fl6->daddr = *final_dst; |
1042 | 1043 | ||
1043 | return xfrm_lookup(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); | 1044 | return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0); |
1044 | } | 1045 | } |
1045 | EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow); | 1046 | EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup_flow); |
1046 | 1047 | ||
@@ -1156,6 +1157,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
1156 | int err; | 1157 | int err; |
1157 | int offset = 0; | 1158 | int offset = 0; |
1158 | __u8 tx_flags = 0; | 1159 | __u8 tx_flags = 0; |
1160 | u32 tskey = 0; | ||
1159 | 1161 | ||
1160 | if (flags&MSG_PROBE) | 1162 | if (flags&MSG_PROBE) |
1161 | return 0; | 1163 | return 0; |
@@ -1271,9 +1273,12 @@ emsgsize: | |||
1271 | } | 1273 | } |
1272 | } | 1274 | } |
1273 | 1275 | ||
1274 | /* For UDP, check if TX timestamp is enabled */ | 1276 | if (sk->sk_type == SOCK_DGRAM || sk->sk_type == SOCK_RAW) { |
1275 | if (sk->sk_type == SOCK_DGRAM) | ||
1276 | sock_tx_timestamp(sk, &tx_flags); | 1277 | sock_tx_timestamp(sk, &tx_flags); |
1278 | if (tx_flags & SKBTX_ANY_SW_TSTAMP && | ||
1279 | sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID) | ||
1280 | tskey = sk->sk_tskey++; | ||
1281 | } | ||
1277 | 1282 | ||
1278 | /* | 1283 | /* |
1279 | * Let's try using as much space as possible. | 1284 | * Let's try using as much space as possible. |
@@ -1381,12 +1386,6 @@ alloc_new_skb: | |||
1381 | sk->sk_allocation); | 1386 | sk->sk_allocation); |
1382 | if (unlikely(skb == NULL)) | 1387 | if (unlikely(skb == NULL)) |
1383 | err = -ENOBUFS; | 1388 | err = -ENOBUFS; |
1384 | else { | ||
1385 | /* Only the initial fragment | ||
1386 | * is time stamped. | ||
1387 | */ | ||
1388 | tx_flags = 0; | ||
1389 | } | ||
1390 | } | 1389 | } |
1391 | if (skb == NULL) | 1390 | if (skb == NULL) |
1392 | goto error; | 1391 | goto error; |
@@ -1400,8 +1399,11 @@ alloc_new_skb: | |||
1400 | skb_reserve(skb, hh_len + sizeof(struct frag_hdr) + | 1399 | skb_reserve(skb, hh_len + sizeof(struct frag_hdr) + |
1401 | dst_exthdrlen); | 1400 | dst_exthdrlen); |
1402 | 1401 | ||
1403 | if (sk->sk_type == SOCK_DGRAM) | 1402 | /* Only the initial fragment is time stamped */ |
1404 | skb_shinfo(skb)->tx_flags = tx_flags; | 1403 | skb_shinfo(skb)->tx_flags = tx_flags; |
1404 | tx_flags = 0; | ||
1405 | skb_shinfo(skb)->tskey = tskey; | ||
1406 | tskey = 0; | ||
1405 | 1407 | ||
1406 | /* | 1408 | /* |
1407 | * Find where to start putting bytes | 1409 | * Find where to start putting bytes |
@@ -1571,7 +1573,9 @@ int ip6_push_pending_frames(struct sock *sk) | |||
1571 | skb_reset_network_header(skb); | 1573 | skb_reset_network_header(skb); |
1572 | hdr = ipv6_hdr(skb); | 1574 | hdr = ipv6_hdr(skb); |
1573 | 1575 | ||
1574 | ip6_flow_hdr(hdr, np->cork.tclass, fl6->flowlabel); | 1576 | ip6_flow_hdr(hdr, np->cork.tclass, |
1577 | ip6_make_flowlabel(net, skb, fl6->flowlabel, | ||
1578 | np->autoflowlabel)); | ||
1575 | hdr->hop_limit = np->cork.hop_limit; | 1579 | hdr->hop_limit = np->cork.hop_limit; |
1576 | hdr->nexthdr = proto; | 1580 | hdr->nexthdr = proto; |
1577 | hdr->saddr = fl6->saddr; | 1581 | hdr->saddr = fl6->saddr; |