sock.c (989a4222c13a3e148772730d362fceb0727852f5) sock.c (b5947e5d1e710c35ea281247bd27e6975250285c)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic socket support routines. Memory allocators, socket lock/release
7 * handler for protocols to use and generic option handler.
8 *

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

562 rcu_read_unlock();
563 ret = -ENODEV;
564 if (!dev)
565 goto out;
566 }
567
568 lock_sock(sk);
569 sk->sk_bound_dev_if = index;
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Generic socket support routines. Memory allocators, socket lock/release
7 * handler for protocols to use and generic option handler.
8 *

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

562 rcu_read_unlock();
563 ret = -ENODEV;
564 if (!dev)
565 goto out;
566 }
567
568 lock_sock(sk);
569 sk->sk_bound_dev_if = index;
570 if (sk->sk_prot->rehash)
571 sk->sk_prot->rehash(sk);
570 sk_dst_reset(sk);
571 release_sock(sk);
572
573 ret = 0;
574
575out:
576#endif
577

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

945
946 case SO_PASSSEC:
947 if (valbool)
948 set_bit(SOCK_PASSSEC, &sock->flags);
949 else
950 clear_bit(SOCK_PASSSEC, &sock->flags);
951 break;
952 case SO_MARK:
572 sk_dst_reset(sk);
573 release_sock(sk);
574
575 ret = 0;
576
577out:
578#endif
579

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

947
948 case SO_PASSSEC:
949 if (valbool)
950 set_bit(SOCK_PASSSEC, &sock->flags);
951 else
952 clear_bit(SOCK_PASSSEC, &sock->flags);
953 break;
954 case SO_MARK:
953 if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
955 if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
954 ret = -EPERM;
956 ret = -EPERM;
955 else
957 } else if (val != sk->sk_mark) {
956 sk->sk_mark = val;
958 sk->sk_mark = val;
959 sk_dst_reset(sk);
960 }
957 break;
958
959 case SO_RXQ_OVFL:
960 sock_valbool_flag(sk, SOCK_RXQ_OVFL, valbool);
961 break;
962
963 case SO_WIFI_STATUS:
964 sock_valbool_flag(sk, SOCK_WIFI_STATUS, valbool);

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

1009
1010 case SO_CNX_ADVICE:
1011 if (val == 1)
1012 dst_negative_advice(sk);
1013 break;
1014
1015 case SO_ZEROCOPY:
1016 if (sk->sk_family == PF_INET || sk->sk_family == PF_INET6) {
961 break;
962
963 case SO_RXQ_OVFL:
964 sock_valbool_flag(sk, SOCK_RXQ_OVFL, valbool);
965 break;
966
967 case SO_WIFI_STATUS:
968 sock_valbool_flag(sk, SOCK_WIFI_STATUS, valbool);

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

1013
1014 case SO_CNX_ADVICE:
1015 if (val == 1)
1016 dst_negative_advice(sk);
1017 break;
1018
1019 case SO_ZEROCOPY:
1020 if (sk->sk_family == PF_INET || sk->sk_family == PF_INET6) {
1017 if (sk->sk_protocol != IPPROTO_TCP)
1021 if (!((sk->sk_type == SOCK_STREAM &&
1022 sk->sk_protocol == IPPROTO_TCP) ||
1023 (sk->sk_type == SOCK_DGRAM &&
1024 sk->sk_protocol == IPPROTO_UDP)))
1018 ret = -ENOTSUPP;
1019 } else if (sk->sk_family != PF_RDS) {
1020 ret = -ENOTSUPP;
1021 }
1022 if (!ret) {
1023 if (val < 0 || val > 1)
1024 ret = -EINVAL;
1025 else

--- 2398 unchanged lines hidden ---
1025 ret = -ENOTSUPP;
1026 } else if (sk->sk_family != PF_RDS) {
1027 ret = -ENOTSUPP;
1028 }
1029 if (!ret) {
1030 if (val < 0 || val > 1)
1031 ret = -EINVAL;
1032 else

--- 2398 unchanged lines hidden ---