ip6_output.c (9d066a252786e1a18484a6283f82614d42a9f4ac) ip6_output.c (0d240e7811c4ec1965760ee4643b5bbc9cfacbb3)
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

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

363
364 /* ipv6 conntrack defrag sets max_frag_size + ignore_df */
365 if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu)
366 return true;
367
368 if (skb->ignore_df)
369 return false;
370
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

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

363
364 /* ipv6 conntrack defrag sets max_frag_size + ignore_df */
365 if (IP6CB(skb)->frag_max_size && IP6CB(skb)->frag_max_size > mtu)
366 return true;
367
368 if (skb->ignore_df)
369 return false;
370
371 if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
371 if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
372 return false;
373
374 return true;
375}
376
377int ip6_forward(struct sk_buff *skb)
378{
379 struct dst_entry *dst = skb_dst(skb);

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

905{
906#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
907 struct neighbour *n;
908 struct rt6_info *rt;
909#endif
910 int err;
911 int flags = 0;
912
372 return false;
373
374 return true;
375}
376
377int ip6_forward(struct sk_buff *skb)
378{
379 struct dst_entry *dst = skb_dst(skb);

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

905{
906#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
907 struct neighbour *n;
908 struct rt6_info *rt;
909#endif
910 int err;
911 int flags = 0;
912
913 if (ipv6_addr_any(&fl6->saddr) && fl6->flowi6_oif &&
914 (!*dst || !(*dst)->error)) {
915 err = l3mdev_get_saddr6(net, sk, fl6);
916 if (err)
917 goto out_err;
918 }
919
913 /* The correct way to handle this would be to do
914 * ip6_route_get_saddr, and then ip6_route_output; however,
915 * the route-specific preferred source forces the
916 * ip6_route_output call _before_ ip6_route_get_saddr.
917 *
918 * In source specific routing (no src=any default route),
919 * ip6_route_output will fail given src=any saddr, though, so
920 * that's why we try it again later.

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

994 goto out_err_release;
995 }
996 }
997#endif
998
999 return 0;
1000
1001out_err_release:
920 /* The correct way to handle this would be to do
921 * ip6_route_get_saddr, and then ip6_route_output; however,
922 * the route-specific preferred source forces the
923 * ip6_route_output call _before_ ip6_route_get_saddr.
924 *
925 * In source specific routing (no src=any default route),
926 * ip6_route_output will fail given src=any saddr, though, so
927 * that's why we try it again later.

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

1001 goto out_err_release;
1002 }
1003 }
1004#endif
1005
1006 return 0;
1007
1008out_err_release:
1002 if (err == -ENETUNREACH)
1003 IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
1004 dst_release(*dst);
1005 *dst = NULL;
1009 dst_release(*dst);
1010 *dst = NULL;
1011out_err:
1012 if (err == -ENETUNREACH)
1013 IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
1006 return err;
1007}
1008
1009/**
1010 * ip6_dst_lookup - perform route lookup on flow
1011 * @sk: socket which provides route info
1012 * @dst: pointer to dst_entry * for result
1013 * @fl6: flow to lookup

--- 772 unchanged lines hidden ---
1014 return err;
1015}
1016
1017/**
1018 * ip6_dst_lookup - perform route lookup on flow
1019 * @sk: socket which provides route info
1020 * @dst: pointer to dst_entry * for result
1021 * @fl6: flow to lookup

--- 772 unchanged lines hidden ---