aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-17 05:40:05 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-17 20:08:05 -0400
commitdda9192851dcf904b4d1095480834f2a4f814ae3 (patch)
tree1dddcb3dc1458a2499aea40d9bfcac2379078926 /net/sctp/socket.c
parent939cfa75a0cea97aa60cb88e3722baefdceb4e72 (diff)
net: sctp: remove SCTP_STATIC macro
SCTP_STATIC is just another define for the static keyword. It's use is inconsistent in the SCTP code anyway and it was introduced in the initial implementation of SCTP in 2.5. We have a regression suite in lksctp-tools, but this is for user space only, so noone makes use of this macro anymore. The kernel test suite for 2.5 is incompatible with the current SCTP code anyway. So simply Remove it, to be more consistent with the rest of the kernel code. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c78
1 files changed, 36 insertions, 42 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 510dc79a32a1..75fe92ac2e9c 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -84,11 +84,6 @@
84#include <net/sctp/sctp.h> 84#include <net/sctp/sctp.h>
85#include <net/sctp/sm.h> 85#include <net/sctp/sm.h>
86 86
87/* WARNING: Please do not remove the SCTP_STATIC attribute to
88 * any of the functions below as they are used to export functions
89 * used by a project regression testsuite.
90 */
91
92/* Forward declarations for internal helper functions. */ 87/* Forward declarations for internal helper functions. */
93static int sctp_writeable(struct sock *sk); 88static int sctp_writeable(struct sock *sk);
94static void sctp_wfree(struct sk_buff *skb); 89static void sctp_wfree(struct sk_buff *skb);
@@ -279,7 +274,7 @@ static struct sctp_transport *sctp_addr_id2transport(struct sock *sk,
279 * sockaddr_in6 [RFC 2553]), 274 * sockaddr_in6 [RFC 2553]),
280 * addr_len - the size of the address structure. 275 * addr_len - the size of the address structure.
281 */ 276 */
282SCTP_STATIC int sctp_bind(struct sock *sk, struct sockaddr *addr, int addr_len) 277static int sctp_bind(struct sock *sk, struct sockaddr *addr, int addr_len)
283{ 278{
284 int retval = 0; 279 int retval = 0;
285 280
@@ -333,7 +328,7 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
333} 328}
334 329
335/* Bind a local address either to an endpoint or to an association. */ 330/* Bind a local address either to an endpoint or to an association. */
336SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) 331static int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
337{ 332{
338 struct net *net = sock_net(sk); 333 struct net *net = sock_net(sk);
339 struct sctp_sock *sp = sctp_sk(sk); 334 struct sctp_sock *sp = sctp_sk(sk);
@@ -964,9 +959,9 @@ int sctp_asconf_mgmt(struct sctp_sock *sp, struct sctp_sockaddr_entry *addrw)
964 * 959 *
965 * Returns 0 if ok, <0 errno code on error. 960 * Returns 0 if ok, <0 errno code on error.
966 */ 961 */
967SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, 962static int sctp_setsockopt_bindx(struct sock* sk,
968 struct sockaddr __user *addrs, 963 struct sockaddr __user *addrs,
969 int addrs_size, int op) 964 int addrs_size, int op)
970{ 965{
971 struct sockaddr *kaddrs; 966 struct sockaddr *kaddrs;
972 int err; 967 int err;
@@ -1312,7 +1307,7 @@ out_free:
1312 * 1307 *
1313 * Returns >=0 if ok, <0 errno code on error. 1308 * Returns >=0 if ok, <0 errno code on error.
1314 */ 1309 */
1315SCTP_STATIC int __sctp_setsockopt_connectx(struct sock* sk, 1310static int __sctp_setsockopt_connectx(struct sock* sk,
1316 struct sockaddr __user *addrs, 1311 struct sockaddr __user *addrs,
1317 int addrs_size, 1312 int addrs_size,
1318 sctp_assoc_t *assoc_id) 1313 sctp_assoc_t *assoc_id)
@@ -1350,9 +1345,9 @@ SCTP_STATIC int __sctp_setsockopt_connectx(struct sock* sk,
1350 * This is an older interface. It's kept for backward compatibility 1345 * This is an older interface. It's kept for backward compatibility
1351 * to the option that doesn't provide association id. 1346 * to the option that doesn't provide association id.
1352 */ 1347 */
1353SCTP_STATIC int sctp_setsockopt_connectx_old(struct sock* sk, 1348static int sctp_setsockopt_connectx_old(struct sock* sk,
1354 struct sockaddr __user *addrs, 1349 struct sockaddr __user *addrs,
1355 int addrs_size) 1350 int addrs_size)
1356{ 1351{
1357 return __sctp_setsockopt_connectx(sk, addrs, addrs_size, NULL); 1352 return __sctp_setsockopt_connectx(sk, addrs, addrs_size, NULL);
1358} 1353}
@@ -1363,9 +1358,9 @@ SCTP_STATIC int sctp_setsockopt_connectx_old(struct sock* sk,
1363 * indication to the call. Error is always negative and association id is 1358 * indication to the call. Error is always negative and association id is
1364 * always positive. 1359 * always positive.
1365 */ 1360 */
1366SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk, 1361static int sctp_setsockopt_connectx(struct sock* sk,
1367 struct sockaddr __user *addrs, 1362 struct sockaddr __user *addrs,
1368 int addrs_size) 1363 int addrs_size)
1369{ 1364{
1370 sctp_assoc_t assoc_id = 0; 1365 sctp_assoc_t assoc_id = 0;
1371 int err = 0; 1366 int err = 0;
@@ -1386,9 +1381,9 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk,
1386 * addrs_num structure member. That way we can re-use the existing 1381 * addrs_num structure member. That way we can re-use the existing
1387 * code. 1382 * code.
1388 */ 1383 */
1389SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len, 1384static int sctp_getsockopt_connectx3(struct sock* sk, int len,
1390 char __user *optval, 1385 char __user *optval,
1391 int __user *optlen) 1386 int __user *optlen)
1392{ 1387{
1393 struct sctp_getaddrs_old param; 1388 struct sctp_getaddrs_old param;
1394 sctp_assoc_t assoc_id = 0; 1389 sctp_assoc_t assoc_id = 0;
@@ -1464,7 +1459,7 @@ SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len,
1464 * shutdown phase does not finish during this period, close() will 1459 * shutdown phase does not finish during this period, close() will
1465 * return but the graceful shutdown phase continues in the system. 1460 * return but the graceful shutdown phase continues in the system.
1466 */ 1461 */
1467SCTP_STATIC void sctp_close(struct sock *sk, long timeout) 1462static void sctp_close(struct sock *sk, long timeout)
1468{ 1463{
1469 struct net *net = sock_net(sk); 1464 struct net *net = sock_net(sk);
1470 struct sctp_endpoint *ep; 1465 struct sctp_endpoint *ep;
@@ -1573,10 +1568,10 @@ static int sctp_error(struct sock *sk, int flags, int err)
1573 */ 1568 */
1574/* BUG: We do not implement the equivalent of sk_stream_wait_memory(). */ 1569/* BUG: We do not implement the equivalent of sk_stream_wait_memory(). */
1575 1570
1576SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *); 1571static int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *);
1577 1572
1578SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, 1573static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1579 struct msghdr *msg, size_t msg_len) 1574 struct msghdr *msg, size_t msg_len)
1580{ 1575{
1581 struct net *net = sock_net(sk); 1576 struct net *net = sock_net(sk);
1582 struct sctp_sock *sp; 1577 struct sctp_sock *sp;
@@ -2034,9 +2029,9 @@ static int sctp_skb_pull(struct sk_buff *skb, int len)
2034 */ 2029 */
2035static struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *); 2030static struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *);
2036 2031
2037SCTP_STATIC int sctp_recvmsg(struct kiocb *iocb, struct sock *sk, 2032static int sctp_recvmsg(struct kiocb *iocb, struct sock *sk,
2038 struct msghdr *msg, size_t len, int noblock, 2033 struct msghdr *msg, size_t len, int noblock,
2039 int flags, int *addr_len) 2034 int flags, int *addr_len)
2040{ 2035{
2041 struct sctp_ulpevent *event = NULL; 2036 struct sctp_ulpevent *event = NULL;
2042 struct sctp_sock *sp = sctp_sk(sk); 2037 struct sctp_sock *sp = sctp_sk(sk);
@@ -3565,8 +3560,8 @@ static int sctp_setsockopt_paddr_thresholds(struct sock *sk,
3565 * optval - the buffer to store the value of the option. 3560 * optval - the buffer to store the value of the option.
3566 * optlen - the size of the buffer. 3561 * optlen - the size of the buffer.
3567 */ 3562 */
3568SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname, 3563static int sctp_setsockopt(struct sock *sk, int level, int optname,
3569 char __user *optval, unsigned int optlen) 3564 char __user *optval, unsigned int optlen)
3570{ 3565{
3571 int retval = 0; 3566 int retval = 0;
3572 3567
@@ -3725,8 +3720,8 @@ out_nounlock:
3725 * 3720 *
3726 * len: the size of the address. 3721 * len: the size of the address.
3727 */ 3722 */
3728SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *addr, 3723static int sctp_connect(struct sock *sk, struct sockaddr *addr,
3729 int addr_len) 3724 int addr_len)
3730{ 3725{
3731 int err = 0; 3726 int err = 0;
3732 struct sctp_af *af; 3727 struct sctp_af *af;
@@ -3752,7 +3747,7 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *addr,
3752} 3747}
3753 3748
3754/* FIXME: Write comments. */ 3749/* FIXME: Write comments. */
3755SCTP_STATIC int sctp_disconnect(struct sock *sk, int flags) 3750static int sctp_disconnect(struct sock *sk, int flags)
3756{ 3751{
3757 return -EOPNOTSUPP; /* STUB */ 3752 return -EOPNOTSUPP; /* STUB */
3758} 3753}
@@ -3764,7 +3759,7 @@ SCTP_STATIC int sctp_disconnect(struct sock *sk, int flags)
3764 * descriptor will be returned from accept() to represent the newly 3759 * descriptor will be returned from accept() to represent the newly
3765 * formed association. 3760 * formed association.
3766 */ 3761 */
3767SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err) 3762static struct sock *sctp_accept(struct sock *sk, int flags, int *err)
3768{ 3763{
3769 struct sctp_sock *sp; 3764 struct sctp_sock *sp;
3770 struct sctp_endpoint *ep; 3765 struct sctp_endpoint *ep;
@@ -3817,7 +3812,7 @@ out:
3817} 3812}
3818 3813
3819/* The SCTP ioctl handler. */ 3814/* The SCTP ioctl handler. */
3820SCTP_STATIC int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg) 3815static int sctp_ioctl(struct sock *sk, int cmd, unsigned long arg)
3821{ 3816{
3822 int rc = -ENOTCONN; 3817 int rc = -ENOTCONN;
3823 3818
@@ -3859,7 +3854,7 @@ out:
3859 * initialized the SCTP-specific portion of the sock. 3854 * initialized the SCTP-specific portion of the sock.
3860 * The sock structure should already be zero-filled memory. 3855 * The sock structure should already be zero-filled memory.
3861 */ 3856 */
3862SCTP_STATIC int sctp_init_sock(struct sock *sk) 3857static int sctp_init_sock(struct sock *sk)
3863{ 3858{
3864 struct net *net = sock_net(sk); 3859 struct net *net = sock_net(sk);
3865 struct sctp_sock *sp; 3860 struct sctp_sock *sp;
@@ -3993,7 +3988,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3993} 3988}
3994 3989
3995/* Cleanup any SCTP per socket resources. */ 3990/* Cleanup any SCTP per socket resources. */
3996SCTP_STATIC void sctp_destroy_sock(struct sock *sk) 3991static void sctp_destroy_sock(struct sock *sk)
3997{ 3992{
3998 struct sctp_sock *sp; 3993 struct sctp_sock *sp;
3999 3994
@@ -4028,7 +4023,7 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk)
4028 * Disables further send and receive operations 4023 * Disables further send and receive operations
4029 * and initiates the SCTP shutdown sequence. 4024 * and initiates the SCTP shutdown sequence.
4030 */ 4025 */
4031SCTP_STATIC void sctp_shutdown(struct sock *sk, int how) 4026static void sctp_shutdown(struct sock *sk, int how)
4032{ 4027{
4033 struct net *net = sock_net(sk); 4028 struct net *net = sock_net(sk);
4034 struct sctp_endpoint *ep; 4029 struct sctp_endpoint *ep;
@@ -5700,8 +5695,8 @@ static int sctp_getsockopt_assoc_stats(struct sock *sk, int len,
5700 return 0; 5695 return 0;
5701} 5696}
5702 5697
5703SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, 5698static int sctp_getsockopt(struct sock *sk, int level, int optname,
5704 char __user *optval, int __user *optlen) 5699 char __user *optval, int __user *optlen)
5705{ 5700{
5706 int retval = 0; 5701 int retval = 0;
5707 int len; 5702 int len;
@@ -6046,7 +6041,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum)
6046/* 6041/*
6047 * Move a socket to LISTENING state. 6042 * Move a socket to LISTENING state.
6048 */ 6043 */
6049SCTP_STATIC int sctp_listen_start(struct sock *sk, int backlog) 6044static int sctp_listen_start(struct sock *sk, int backlog)
6050{ 6045{
6051 struct sctp_sock *sp = sctp_sk(sk); 6046 struct sctp_sock *sp = sctp_sk(sk);
6052 struct sctp_endpoint *ep = sp->ep; 6047 struct sctp_endpoint *ep = sp->ep;
@@ -6333,8 +6328,7 @@ static int sctp_autobind(struct sock *sk)
6333 * msg_control 6328 * msg_control
6334 * points here 6329 * points here
6335 */ 6330 */
6336SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *msg, 6331static int sctp_msghdr_parse(const struct msghdr *msg, sctp_cmsgs_t *cmsgs)
6337 sctp_cmsgs_t *cmsgs)
6338{ 6332{
6339 struct cmsghdr *cmsg; 6333 struct cmsghdr *cmsg;
6340 struct msghdr *my_msg = (struct msghdr *)msg; 6334 struct msghdr *my_msg = (struct msghdr *)msg;