diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 73a8018029a..043bdc05d21 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -979,6 +979,21 @@ out: | |||
979 | 979 | ||
980 | EXPORT_SYMBOL_GPL(sk_clone); | 980 | EXPORT_SYMBOL_GPL(sk_clone); |
981 | 981 | ||
982 | void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | ||
983 | { | ||
984 | __sk_dst_set(sk, dst); | ||
985 | sk->sk_route_caps = dst->dev->features; | ||
986 | if (sk->sk_route_caps & NETIF_F_GSO) | ||
987 | sk->sk_route_caps |= NETIF_F_GSO_MASK; | ||
988 | if (sk_can_gso(sk)) { | ||
989 | if (dst->header_len) | ||
990 | sk->sk_route_caps &= ~NETIF_F_GSO_MASK; | ||
991 | else | ||
992 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; | ||
993 | } | ||
994 | } | ||
995 | EXPORT_SYMBOL_GPL(sk_setup_caps); | ||
996 | |||
982 | void __init sk_init(void) | 997 | void __init sk_init(void) |
983 | { | 998 | { |
984 | if (num_physpages <= 4096) { | 999 | if (num_physpages <= 4096) { |