Commit d64a850d authored by James Morris's avatar James Morris Committed by David S. Miller

[NET]: Nuke SO_BSDCOMPAT.

parent 89865dbb
...@@ -1107,38 +1107,16 @@ asmlinkage int sunos_send(int fd, void * buff, int len, unsigned flags) ...@@ -1107,38 +1107,16 @@ asmlinkage int sunos_send(int fd, void * buff, int len, unsigned flags)
return ret; return ret;
} }
extern asmlinkage int sys_setsockopt(int fd, int level, int optname,
char *optval, int optlen);
asmlinkage int sunos_socket(int family, int type, int protocol)
{
int ret, one = 1;
ret = sys_socket(family, type, protocol);
if (ret < 0)
goto out;
sys_setsockopt(ret, SOL_SOCKET, SO_BSDCOMPAT,
(char *)&one, sizeof(one));
out:
return ret;
}
asmlinkage int sunos_accept(int fd, struct sockaddr *sa, int *addrlen) asmlinkage int sunos_accept(int fd, struct sockaddr *sa, int *addrlen)
{ {
int ret, one = 1; int ret;
while (1) { while (1) {
ret = check_nonblock(sys_accept(fd,sa,addrlen),fd); ret = check_nonblock(sys_accept(fd,sa,addrlen),fd);
if (ret != -ENETUNREACH && ret != -EHOSTUNREACH) if (ret != -ENETUNREACH && ret != -EHOSTUNREACH)
break; break;
} }
if (ret < 0)
goto out;
sys_setsockopt(ret, SOL_SOCKET, SO_BSDCOMPAT,
(char *)&one, sizeof(one));
out:
return ret; return ret;
} }
......
...@@ -110,7 +110,7 @@ sunos_sys_table: ...@@ -110,7 +110,7 @@ sunos_sys_table:
.long sys_getitimer, sys_gethostname, sys_sethostname .long sys_getitimer, sys_gethostname, sys_sethostname
.long sunos_getdtablesize, sys_dup2, sunos_nop .long sunos_getdtablesize, sys_dup2, sunos_nop
.long sys_fcntl, sunos_select, sunos_nop .long sys_fcntl, sunos_select, sunos_nop
.long sys_fsync, sys_setpriority, sunos_socket .long sys_fsync, sys_setpriority, sys_socket
.long sys_connect, sunos_accept .long sys_connect, sunos_accept
/*100*/ .long sys_getpriority, sunos_send, sunos_recv /*100*/ .long sys_getpriority, sunos_send, sunos_recv
.long sunos_nosys, sys_bind, sunos_setsockopt .long sunos_nosys, sys_bind, sunos_setsockopt
......
...@@ -1254,26 +1254,9 @@ asmlinkage int sunos_send(int fd, u32 buff, int len, unsigned flags) ...@@ -1254,26 +1254,9 @@ asmlinkage int sunos_send(int fd, u32 buff, int len, unsigned flags)
return ret; return ret;
} }
extern asmlinkage int sys_setsockopt(int fd, int level, int optname,
char *optval, int optlen);
asmlinkage int sunos_socket(int family, int type, int protocol)
{
int ret, one = 1;
ret = sys_socket(family, type, protocol);
if (ret < 0)
goto out;
sys_setsockopt(ret, SOL_SOCKET, SO_BSDCOMPAT,
(char *)&one, sizeof(one));
out:
return ret;
}
asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen) asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen)
{ {
int ret, one = 1; int ret;
while (1) { while (1) {
ret = check_nonblock(sys_accept(fd, (struct sockaddr *)A(sa), ret = check_nonblock(sys_accept(fd, (struct sockaddr *)A(sa),
...@@ -1281,12 +1264,6 @@ asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen) ...@@ -1281,12 +1264,6 @@ asmlinkage int sunos_accept(int fd, u32 sa, u32 addrlen)
if (ret != -ENETUNREACH && ret != -EHOSTUNREACH) if (ret != -ENETUNREACH && ret != -EHOSTUNREACH)
break; break;
} }
if (ret < 0)
goto out;
sys_setsockopt(ret, SOL_SOCKET, SO_BSDCOMPAT,
(char *)&one, sizeof(one));
out:
return ret; return ret;
} }
......
...@@ -173,7 +173,7 @@ sunos_sys_table: ...@@ -173,7 +173,7 @@ sunos_sys_table:
.word compat_sys_getitimer, sys_gethostname, sys_sethostname .word compat_sys_getitimer, sys_gethostname, sys_sethostname
.word sunos_getdtablesize, sys_dup2, sunos_nop .word sunos_getdtablesize, sys_dup2, sunos_nop
.word sys32_fcntl, sunos_select, sunos_nop .word sys32_fcntl, sunos_select, sunos_nop
.word sys_fsync, sys_setpriority32, sunos_socket .word sys_fsync, sys_setpriority32, sys_socket
.word sys_connect, sunos_accept .word sys_connect, sunos_accept
/*100*/ .word sys_getpriority, sunos_send, sunos_recv /*100*/ .word sys_getpriority, sunos_send, sunos_recv
.word sunos_nosys, sys_bind, sunos_setsockopt .word sunos_nosys, sys_bind, sunos_setsockopt
......
...@@ -70,7 +70,6 @@ enum { ...@@ -70,7 +70,6 @@ enum {
SOCK_LINGER, SOCK_LINGER,
SOCK_DESTROY, SOCK_DESTROY,
SOCK_BROADCAST, SOCK_BROADCAST,
SOCK_BSDISM,
}; };
/* Define this to get the sk->debug debugging facility. */ /* Define this to get the sk->debug debugging facility. */
......
...@@ -153,6 +153,12 @@ static int sock_set_timeout(long *timeo_p, char *optval, int optlen) ...@@ -153,6 +153,12 @@ static int sock_set_timeout(long *timeo_p, char *optval, int optlen)
return 0; return 0;
} }
static void sock_warn_obsolete_bsdism(const char *name)
{
printk(KERN_WARNING "process `%s' is using obsolete "
"%s SO_BSDCOMPAT\n", current->comm, name);
}
/* /*
* This is meant for all protocols to use and covers goings on * This is meant for all protocols to use and covers goings on
* at the socket level. Everything here is generic. * at the socket level. Everything here is generic.
...@@ -303,7 +309,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -303,7 +309,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
break; break;
case SO_BSDCOMPAT: case SO_BSDCOMPAT:
sock_valbool_flag(sk, SOCK_BSDISM, valbool); sock_warn_obsolete_bsdism("setsockopt");
break; break;
case SO_PASSCRED: case SO_PASSCRED:
...@@ -491,7 +497,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, ...@@ -491,7 +497,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
break; break;
case SO_BSDCOMPAT: case SO_BSDCOMPAT:
v.val = test_bit(SOCK_BSDISM, &sk->flags); sock_warn_obsolete_bsdism("getsockopt");
break; break;
case SO_TIMESTAMP: case SO_TIMESTAMP:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment