ip6_output.c (e8e6e6012d68c4967e8f26fdd39ac95c247d4789) | ip6_output.c (090f1166c6790e18c30f40690098829709e8dc68) |
---|---|
1/* 2 * IPv6 output functions 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on linux/net/ipv4/ip_output.c --- 353 unchanged lines hidden (view full) --- 362 struct ipv6hdr *hdr = ipv6_hdr(skb); 363 struct inet6_skb_parm *opt = IP6CB(skb); 364 struct net *net = dev_net(dst->dev); 365 u32 mtu; 366 367 if (net->ipv6.devconf_all->forwarding == 0) 368 goto error; 369 | 1/* 2 * IPv6 output functions 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Based on linux/net/ipv4/ip_output.c --- 353 unchanged lines hidden (view full) --- 362 struct ipv6hdr *hdr = ipv6_hdr(skb); 363 struct inet6_skb_parm *opt = IP6CB(skb); 364 struct net *net = dev_net(dst->dev); 365 u32 mtu; 366 367 if (net->ipv6.devconf_all->forwarding == 0) 368 goto error; 369 |
370 if (skb->pkt_type != PACKET_HOST) 371 goto drop; 372 |
|
370 if (skb_warn_if_lro(skb)) 371 goto drop; 372 373 if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) { 374 IP6_INC_STATS_BH(net, ip6_dst_idev(dst), 375 IPSTATS_MIB_INDISCARDS); 376 goto drop; 377 } 378 | 373 if (skb_warn_if_lro(skb)) 374 goto drop; 375 376 if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) { 377 IP6_INC_STATS_BH(net, ip6_dst_idev(dst), 378 IPSTATS_MIB_INDISCARDS); 379 goto drop; 380 } 381 |
379 if (skb->pkt_type != PACKET_HOST) 380 goto drop; 381 | |
382 skb_forward_csum(skb); 383 384 /* 385 * We DO NOT make any processing on 386 * RA packets, pushing them to user level AS IS 387 * without ane WARRANTY that application will be able 388 * to interpret them. The reason is that we 389 * cannot make anything clever here. --- 836 unchanged lines hidden (view full) --- 1226 unsigned int maxnonfragsize, headersize; 1227 1228 headersize = sizeof(struct ipv6hdr) + 1229 (opt ? opt->tot_len : 0) + 1230 (dst_allfrag(&rt->dst) ? 1231 sizeof(struct frag_hdr) : 0) + 1232 rt->rt6i_nfheader_len; 1233 | 382 skb_forward_csum(skb); 383 384 /* 385 * We DO NOT make any processing on 386 * RA packets, pushing them to user level AS IS 387 * without ane WARRANTY that application will be able 388 * to interpret them. The reason is that we 389 * cannot make anything clever here. --- 836 unchanged lines hidden (view full) --- 1226 unsigned int maxnonfragsize, headersize; 1227 1228 headersize = sizeof(struct ipv6hdr) + 1229 (opt ? opt->tot_len : 0) + 1230 (dst_allfrag(&rt->dst) ? 1231 sizeof(struct frag_hdr) : 0) + 1232 rt->rt6i_nfheader_len; 1233 |
1234 maxnonfragsize = (np->pmtudisc >= IPV6_PMTUDISC_DO) ? 1235 mtu : sizeof(struct ipv6hdr) + IPV6_MAXPLEN; | 1234 if (ip6_sk_local_df(sk)) 1235 maxnonfragsize = sizeof(struct ipv6hdr) + IPV6_MAXPLEN; 1236 else 1237 maxnonfragsize = mtu; |
1236 1237 /* dontfrag active */ 1238 if ((cork->length + length > mtu - headersize) && dontfrag && 1239 (sk->sk_protocol == IPPROTO_UDP || 1240 sk->sk_protocol == IPPROTO_RAW)) { 1241 ipv6_local_rxpmtu(sk, fl6, mtu - headersize + 1242 sizeof(struct ipv6hdr)); 1243 goto emsgsize; --- 291 unchanged lines hidden (view full) --- 1535 skb->len += tmp_skb->len; 1536 skb->data_len += tmp_skb->len; 1537 skb->truesize += tmp_skb->truesize; 1538 tmp_skb->destructor = NULL; 1539 tmp_skb->sk = NULL; 1540 } 1541 1542 /* Allow local fragmentation. */ | 1238 1239 /* dontfrag active */ 1240 if ((cork->length + length > mtu - headersize) && dontfrag && 1241 (sk->sk_protocol == IPPROTO_UDP || 1242 sk->sk_protocol == IPPROTO_RAW)) { 1243 ipv6_local_rxpmtu(sk, fl6, mtu - headersize + 1244 sizeof(struct ipv6hdr)); 1245 goto emsgsize; --- 291 unchanged lines hidden (view full) --- 1537 skb->len += tmp_skb->len; 1538 skb->data_len += tmp_skb->len; 1539 skb->truesize += tmp_skb->truesize; 1540 tmp_skb->destructor = NULL; 1541 tmp_skb->sk = NULL; 1542 } 1543 1544 /* Allow local fragmentation. */ |
1543 if (np->pmtudisc < IPV6_PMTUDISC_DO) 1544 skb->local_df = 1; | 1545 skb->local_df = ip6_sk_local_df(sk); |
1545 1546 *final_dst = fl6->daddr; 1547 __skb_pull(skb, skb_network_header_len(skb)); 1548 if (opt && opt->opt_flen) 1549 ipv6_push_frag_opts(skb, opt, &proto); 1550 if (opt && opt->opt_nflen) 1551 ipv6_push_nfrag_opts(skb, opt, &proto, &final_dst); 1552 --- 53 unchanged lines hidden --- | 1546 1547 *final_dst = fl6->daddr; 1548 __skb_pull(skb, skb_network_header_len(skb)); 1549 if (opt && opt->opt_flen) 1550 ipv6_push_frag_opts(skb, opt, &proto); 1551 if (opt && opt->opt_nflen) 1552 ipv6_push_nfrag_opts(skb, opt, &proto, &final_dst); 1553 --- 53 unchanged lines hidden --- |