Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[linux-2.6.git] / net / core / sock.c
index 1fb21b5..9be6d0d 100644 (file)
@@ -793,6 +793,17 @@ set_rcvbuf:
                sock_valbool_flag(sk, SOCK_WIFI_STATUS, valbool);
                break;
 
+       case SO_PEEK_OFF:
+               if (sock->ops->set_peek_off)
+                       sock->ops->set_peek_off(sk, val);
+               else
+                       ret = -EOPNOTSUPP;
+               break;
+
+       case SO_NOFCS:
+               sock_valbool_flag(sk, SOCK_NOFCS, valbool);
+               break;
+
        default:
                ret = -ENOPROTOOPT;
                break;
@@ -1018,6 +1029,15 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
                v.val = !!sock_flag(sk, SOCK_WIFI_STATUS);
                break;
 
+       case SO_PEEK_OFF:
+               if (!sock->ops->set_peek_off)
+                       return -EOPNOTSUPP;
+
+               v.val = sk->sk_peek_off;
+               break;
+       case SO_NOFCS:
+               v.val = !!sock_flag(sk, SOCK_NOFCS);
+               break;
        default:
                return -ENOPROTOOPT;
        }
@@ -2092,6 +2112,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 
        sk->sk_sndmsg_page      =       NULL;
        sk->sk_sndmsg_off       =       0;
+       sk->sk_peek_off         =       -1;
 
        sk->sk_peer_pid         =       NULL;
        sk->sk_peer_cred        =       NULL;