ip6_output.c (f92ce7618f0cb0ced87ea1cfe994d2e8473c61b4) ip6_output.c (b72a2b01b686f242028038f630555513c9e4de38)
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

--- 14 unchanged lines hidden (view full) ---

23 * Imran Patel : frag id should be in NBO
24 * Kazunori MIYAZAWA @USAGI
25 * : add ip6_append_data and related functions
26 * for datagram xmit
27 */
28
29#include <linux/errno.h>
30#include <linux/kernel.h>
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

--- 14 unchanged lines hidden (view full) ---

23 * Imran Patel : frag id should be in NBO
24 * Kazunori MIYAZAWA @USAGI
25 * : add ip6_append_data and related functions
26 * for datagram xmit
27 */
28
29#include <linux/errno.h>
30#include <linux/kernel.h>
31#include <linux/overflow-arith.h>
31#include <linux/string.h>
32#include <linux/socket.h>
33#include <linux/net.h>
34#include <linux/netdevice.h>
35#include <linux/if_arp.h>
36#include <linux/in6.h>
37#include <linux/tcp.h>
38#include <linux/route.h>

--- 332 unchanged lines hidden (view full) ---

371 u32 mtu;
372
373 if (net->ipv6.devconf_all->forwarding == 0)
374 goto error;
375
376 if (skb->pkt_type != PACKET_HOST)
377 goto drop;
378
32#include <linux/string.h>
33#include <linux/socket.h>
34#include <linux/net.h>
35#include <linux/netdevice.h>
36#include <linux/if_arp.h>
37#include <linux/in6.h>
38#include <linux/tcp.h>
39#include <linux/route.h>

--- 332 unchanged lines hidden (view full) ---

372 u32 mtu;
373
374 if (net->ipv6.devconf_all->forwarding == 0)
375 goto error;
376
377 if (skb->pkt_type != PACKET_HOST)
378 goto drop;
379
380 if (unlikely(skb->sk))
381 goto drop;
382
379 if (skb_warn_if_lro(skb))
380 goto drop;
381
382 if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
383 IP6_INC_STATS_BH(net, ip6_dst_idev(dst),
384 IPSTATS_MIB_INDISCARDS);
385 goto drop;
386 }

--- 189 unchanged lines hidden (view full) ---

576 if (mtu < IPV6_MIN_MTU)
577 mtu = IPV6_MIN_MTU;
578 }
579
580 if (np && np->frag_size < mtu) {
581 if (np->frag_size)
582 mtu = np->frag_size;
583 }
383 if (skb_warn_if_lro(skb))
384 goto drop;
385
386 if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
387 IP6_INC_STATS_BH(net, ip6_dst_idev(dst),
388 IPSTATS_MIB_INDISCARDS);
389 goto drop;
390 }

--- 189 unchanged lines hidden (view full) ---

580 if (mtu < IPV6_MIN_MTU)
581 mtu = IPV6_MIN_MTU;
582 }
583
584 if (np && np->frag_size < mtu) {
585 if (np->frag_size)
586 mtu = np->frag_size;
587 }
584 mtu -= hlen + sizeof(struct frag_hdr);
585
588
589 if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) ||
590 mtu <= 7)
591 goto fail_toobig;
592
586 frag_id = ipv6_select_ident(net, &ipv6_hdr(skb)->daddr,
587 &ipv6_hdr(skb)->saddr);
588
589 hroom = LL_RESERVED_SPACE(rt->dst.dev);
590 if (skb_has_frag_list(skb)) {
591 int first_len = skb_pagelen(skb);
592 struct sk_buff *frag2;
593

--- 275 unchanged lines hidden (view full) ---

869 * so that the last trick works only on connected
870 * sockets.
871 * 2. oif also should be the same.
872 */
873 if (ip6_rt_check(&rt->rt6i_dst, &fl6->daddr, np->daddr_cache) ||
874#ifdef CONFIG_IPV6_SUBTREES
875 ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
876#endif
593 frag_id = ipv6_select_ident(net, &ipv6_hdr(skb)->daddr,
594 &ipv6_hdr(skb)->saddr);
595
596 hroom = LL_RESERVED_SPACE(rt->dst.dev);
597 if (skb_has_frag_list(skb)) {
598 int first_len = skb_pagelen(skb);
599 struct sk_buff *frag2;
600

--- 275 unchanged lines hidden (view full) ---

876 * so that the last trick works only on connected
877 * sockets.
878 * 2. oif also should be the same.
879 */
880 if (ip6_rt_check(&rt->rt6i_dst, &fl6->daddr, np->daddr_cache) ||
881#ifdef CONFIG_IPV6_SUBTREES
882 ip6_rt_check(&rt->rt6i_src, &fl6->saddr, np->saddr_cache) ||
883#endif
877 (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex)) {
884 (!(fl6->flowi6_flags & FLOWI_FLAG_SKIP_NH_OIF) &&
885 (fl6->flowi6_oif && fl6->flowi6_oif != dst->dev->ifindex))) {
878 dst_release(dst);
879 dst = NULL;
880 }
881
882out:
883 return dst;
884}
885

--- 887 unchanged lines hidden ---
886 dst_release(dst);
887 dst = NULL;
888 }
889
890out:
891 return dst;
892}
893

--- 887 unchanged lines hidden ---