Merge branch 'for-viro' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[deliverable/linux.git] / net / ipv6 / ip6_output.c
index 635b8d340cdbbbce62a173ed4016b6c5c81fc6b9..1dfc402d9ad1ebbf70aa8af6c613bff7fd632c66 100644 (file)
@@ -368,7 +368,7 @@ static bool ip6_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
        if (skb->ignore_df)
                return false;
 
-       if (skb_is_gso(skb) && skb_gso_network_seglen(skb) <= mtu)
+       if (skb_is_gso(skb) && skb_gso_validate_mtu(skb, mtu))
                return false;
 
        return true;
@@ -910,6 +910,13 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
        int err;
        int flags = 0;
 
+       if (ipv6_addr_any(&fl6->saddr) && fl6->flowi6_oif &&
+           (!*dst || !(*dst)->error)) {
+               err = l3mdev_get_saddr6(net, sk, fl6);
+               if (err)
+                       goto out_err;
+       }
+
        /* The correct way to handle this would be to do
         * ip6_route_get_saddr, and then ip6_route_output; however,
         * the route-specific preferred source forces the
@@ -999,10 +1006,11 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
        return 0;
 
 out_err_release:
-       if (err == -ENETUNREACH)
-               IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
        dst_release(*dst);
        *dst = NULL;
+out_err:
+       if (err == -ENETUNREACH)
+               IP6_INC_STATS(net, NULL, IPSTATS_MIB_OUTNOROUTES);
        return err;
 }
 
This page took 0.110435 seconds and 5 git commands to generate.