diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 305792076121..a6000fbad294 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -691,7 +691,8 @@ set_rcvbuf: | |||
691 | 691 | ||
692 | case SO_KEEPALIVE: | 692 | case SO_KEEPALIVE: |
693 | #ifdef CONFIG_INET | 693 | #ifdef CONFIG_INET |
694 | if (sk->sk_protocol == IPPROTO_TCP) | 694 | if (sk->sk_protocol == IPPROTO_TCP && |
695 | sk->sk_type == SOCK_STREAM) | ||
695 | tcp_set_keepalive(sk, valbool); | 696 | tcp_set_keepalive(sk, valbool); |
696 | #endif | 697 | #endif |
697 | sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool); | 698 | sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool); |