[SCTP] Remove sk_xxx macros to be consistent with the rest of networking

Linux Kernel Mailing List <[email protected]>
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1530.1.19, 2004/12/29 15:57:37-08:00, [email protected]

	[SCTP] Remove sk_xxx macros to be consistent with the rest of networking
	code and to avoid backporting issues.
	
	Signed-off-by: Sridhar Samudrala <[email protected]>



 include/net/sctp/compat.h |   31 ----------
 include/net/sctp/sctp.h   |    2 
 net/sctp/associola.c      |   12 ++--
 net/sctp/endpointola.c    |    8 +-
 net/sctp/input.c          |    6 +-
 net/sctp/ipv6.c           |   42 +++++++-------
 net/sctp/output.c         |    2 
 net/sctp/outqueue.c       |    2 
 net/sctp/proc.c           |    4 -
 net/sctp/protocol.c       |   26 ++++----
 net/sctp/sm_make_chunk.c  |    2 
 net/sctp/sm_sideeffect.c  |   20 +++---
 net/sctp/sm_statefuns.c   |    2 
 net/sctp/socket.c         |  134 +++++++++++++++++++++++-----------------------
 net/sctp/ulpevent.c       |    2 
 net/sctp/ulpqueue.c       |   18 +++---
 16 files changed, 141 insertions(+), 172 deletions(-)


diff -Nru a/include/net/sctp/compat.h b/include/net/sctp/compat.h
--- a/include/net/sctp/compat.h	2005-01-15 07:05:50 -08:00
+++ b/include/net/sctp/compat.h	2005-01-15 07:05:50 -08:00
@@ -64,37 +64,6 @@
 #define __unsafe(x)
 #define dst_pmtu(x) ((x)->pmtu)
 
-#define sk_family family
-#define sk_state state
-#define sk_type type
-#define sk_socket socket
-#define sk_prot prot
-#define sk_rcvbuf rcvbuf
-#define sk_sndbuf sndbuf
-#define sk_ack_backlog ack_backlog
-#define sk_max_ack_backlog max_ack_backlog
-#define sk_write_space write_space
-#define sk_use_write_queue use_write_queue
-#define sk_err err
-#define sk_err_soft err_soft
-#define sk_error_report error_report
-#define sk_error_queue error_queue
-#define sk_shutdown shutdown
-#define sk_state_change state_change
-#define sk_receive_queue receive_queue
-#define sk_data_ready data_ready
-#define sk_no_check no_check
-#define sk_reuse reuse
-#define sk_destruct destruct
-#define sk_zapped zapped
-#define sk_protocol protocol
-#define sk_backlog_rcv backlog_rcv
-#define sk_allocation allocation
-#define sk_lingertime lingertime
-#define sk_sleep sleep
-#define sk_wmem_queued wmem_queued
-#define sk_bound_dev_if bound_dev_if
-
 /*
  * find last bit set.
  */
diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
--- a/include/net/sctp/sctp.h	2005-01-15 07:05:50 -08:00
+++ b/include/net/sctp/sctp.h	2005-01-15 07:05:50 -08:00
@@ -616,7 +616,7 @@
 #define sctp_sstate(sk, state) __sctp_sstate((sk), (SCTP_SS_##state))
 int static inline __sctp_sstate(const struct sock *sk, sctp_sock_state_t state)
 {
-	return sk->sk_state == state;
+	return sk->state == state;
 }
 
 /* Map v4-mapped v6 address back to v4 address */
diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c
--- a/net/sctp/associola.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/associola.c	2005-01-15 07:05:50 -08:00
@@ -157,10 +157,10 @@
 	 * RFC 6 - A SCTP receiver MUST be able to receive a minimum of
 	 * 1500 bytes in one SCTP packet.
 	 */
-	if (sk->sk_rcvbuf < SCTP_DEFAULT_MINWINDOW)
+	if (sk->rcvbuf < SCTP_DEFAULT_MINWINDOW)
 		asoc->rwnd = SCTP_DEFAULT_MINWINDOW;
 	else
-		asoc->rwnd = sk->sk_rcvbuf;
+		asoc->rwnd = sk->rcvbuf;
 
 	asoc->a_rwnd = asoc->rwnd;
 
@@ -311,7 +311,7 @@
 
 	/* Decrement the backlog value for a TCP-style listening socket. */
 	if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
-		sk->sk_ack_backlog--;
+		sk->ack_backlog--;
 
 	/* Mark as dead, so other users can know this structure is
 	 * going away.
@@ -911,7 +911,7 @@
 
 	/* Decrement the backlog value for a TCP-style socket. */
 	if (sctp_style(oldsk, TCP))
-		oldsk->sk_ack_backlog--;
+		oldsk->ack_backlog--;
 
 	/* Release references to the old endpoint and the sock.  */
 	sctp_endpoint_put(assoc->ep);
@@ -1093,7 +1093,7 @@
 	case SCTP_STATE_SHUTDOWN_SENT:
 		if ((asoc->rwnd > asoc->a_rwnd) &&
 		    ((asoc->rwnd - asoc->a_rwnd) >=
-		     min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pmtu)))
+		     min_t(__u32, (asoc->base.sk->rcvbuf >> 1), asoc->pmtu)))
 			return 1;
 		break;
 	default:
@@ -1176,7 +1176,7 @@
 	 * the endpoint.
 	 */
 	scope = sctp_scope(&asoc->peer.active_path->ipaddr);
-	flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
+	flags = (PF_INET6 == asoc->base.sk->family) ? SCTP_ADDR6_ALLOWED : 0;
 	if (asoc->peer.ipv4_address)
 		flags |= SCTP_ADDR4_PEERSUPP;
 	if (asoc->peer.ipv6_address)
diff -Nru a/net/sctp/endpointola.c b/net/sctp/endpointola.c
--- a/net/sctp/endpointola.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/endpointola.c	2005-01-15 07:05:50 -08:00
@@ -125,8 +125,8 @@
 		sp->autoclose * HZ;
 
 	/* Use SCTP specific send buffer space queues.  */
-	sk->sk_write_space = sctp_write_space;
-	sk->sk_use_write_queue = 1;
+	sk->write_space = sctp_write_space;
+	sk->use_write_queue = 1;
 
 	/* Initialize the secret key used with cookie. */
 	get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE);
@@ -171,7 +171,7 @@
 
 	/* Increment the backlog value for a TCP-style listening socket. */
 	if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
-		sk->sk_ack_backlog++;
+		sk->ack_backlog++;
 }
 
 /* Free the endpoint structure.  Delay cleanup until
@@ -188,7 +188,7 @@
 {
 	SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return);
 
-	ep->base.sk->sk_state = SCTP_SS_CLOSED;
+	ep->base.sk->state = SCTP_SS_CLOSED;
 
 	/* Unlink this endpoint, so we can't find it again! */
 	sctp_unhash_endpoint(ep);
diff -Nru a/net/sctp/input.c b/net/sctp/input.c
--- a/net/sctp/input.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/input.c	2005-01-15 07:05:50 -08:00
@@ -484,10 +484,10 @@
 
 	inet = inet_sk(sk);
 	if (!sock_owned_by_user(sk) && inet->recverr) {
-		sk->sk_err = err;
-		sk->sk_error_report(sk);
+		sk->err = err;
+		sk->error_report(sk);
 	} else {  /* Only an error on timeout */
-		sk->sk_err_soft = err;
+		sk->err_soft = err;
 	}
 
 out_unlock:
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/ipv6.c	2005-01-15 07:05:50 -08:00
@@ -146,10 +146,10 @@
 	np = inet6_sk(sk);
 	icmpv6_err_convert(type, code, &err);
 	if (!sock_owned_by_user(sk) && np->recverr) {
-		sk->sk_err = err;
-		sk->sk_error_report(sk);
+		sk->err = err;
+		sk->error_report(sk);
 	} else {  /* Only an error on timeout */
-		sk->sk_err_soft = err;
+		sk->err_soft = err;
 	}
 
 out_unlock:
@@ -169,7 +169,7 @@
 
 	memset(&fl, 0, sizeof(fl));
 
-	fl.proto = sk->sk_protocol;
+	fl.proto = sk->protocol;
 
 	/* Fill in the dest address from the route entry passed with the skb
 	 * and the source address from the transport.
@@ -182,7 +182,7 @@
 	if (ipv6_addr_type(fl.fl6_src) & IPV6_ADDR_LINKLOCAL)
 		fl.oif = transport->saddr.v6.sin6_scope_id;
 	else
-		fl.oif = sk->sk_bound_dev_if;
+		fl.oif = sk->bound_dev_if;
 	fl.uli_u.ports.sport = sk->sport;
 	fl.uli_u.ports.dport = transport->ipaddr.v6.sin6_port;
 
@@ -610,18 +610,18 @@
 	sock_init_data(NULL, newsk);
 	sk_set_owner(newsk, THIS_MODULE);
 
-	newsk->sk_type = SOCK_STREAM;
+	newsk->type = SOCK_STREAM;
 
-	newsk->sk_prot = sk->sk_prot;
-	newsk->sk_no_check = sk->sk_no_check;
-	newsk->sk_reuse = sk->sk_reuse;
-
-	newsk->sk_destruct = inet_sock_destruct;
-	newsk->sk_zapped = 0;
-	newsk->sk_family = PF_INET6;
-	newsk->sk_protocol = IPPROTO_SCTP;
-	newsk->sk_backlog_rcv = sk->sk_prot->backlog_rcv;
-	newsk->sk_shutdown = sk->sk_shutdown;
+	newsk->prot = sk->prot;
+	newsk->no_check = sk->no_check;
+	newsk->reuse = sk->reuse;
+
+	newsk->destruct = inet_sock_destruct;
+	newsk->zapped = 0;
+	newsk->family = PF_INET6;
+	newsk->protocol = IPPROTO_SCTP;
+	newsk->backlog_rcv = sk->prot->backlog_rcv;
+	newsk->shutdown = sk->shutdown;
 
 	newinet = inet_sk(newsk);
 	newnp = inet6_sk(newsk);
@@ -656,7 +656,7 @@
 	atomic_inc(&inet_sock_nr);
 #endif
 
-	if (newsk->sk_prot->init(newsk)) {
+	if (newsk->prot->init(newsk)) {
 		inet_sock_release(newsk);
 		newsk = NULL;
 	}
@@ -831,8 +831,8 @@
 			 */
 
 			if (addr->v6.sin6_scope_id)
-				sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
-			if (!sk->sk_bound_dev_if)
+				sk->bound_dev_if = addr->v6.sin6_scope_id;
+			if (!sk->bound_dev_if)
 				return 0;
 		}
 		af = opt->pf->af;
@@ -861,8 +861,8 @@
 			 */
 
 			if (addr->v6.sin6_scope_id)
-				sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
-			if (!sk->sk_bound_dev_if)
+				sk->bound_dev_if = addr->v6.sin6_scope_id;
+			if (!sk->bound_dev_if)
 				return 0;
 		}
 		af = opt->pf->af;
diff -Nru a/net/sctp/output.c b/net/sctp/output.c
--- a/net/sctp/output.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/output.c	2005-01-15 07:05:50 -08:00
@@ -161,7 +161,7 @@
 		if (!packet->has_cookie_echo) {
 			error = sctp_packet_transmit(packet);
 			if (error < 0)
-				chunk->skb->sk->sk_err = -error;
+				chunk->skb->sk->err = -error;
 
 			/* If we have an empty packet, then we can NOT ever
 			 * return PMTU_FULL.
diff -Nru a/net/sctp/outqueue.c b/net/sctp/outqueue.c
--- a/net/sctp/outqueue.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/outqueue.c	2005-01-15 07:05:50 -08:00
@@ -497,7 +497,7 @@
 	error = sctp_outq_flush(q, /* rtx_timeout */ 1);
 
 	if (error)
-		q->asoc->base.sk->sk_err = -error;
+		q->asoc->base.sk->err = -error;
 }
 
 /*
diff -Nru a/net/sctp/proc.c b/net/sctp/proc.c
--- a/net/sctp/proc.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/proc.c	2005-01-15 07:05:50 -08:00
@@ -177,7 +177,7 @@
 			ep = sctp_ep(epb);
 			sk = epb->sk;
 			seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d ", ep, sk,
-				   sctp_sk(sk)->type, sk->sk_state, hash,
+				   sctp_sk(sk)->type, sk->state, hash,
 				   epb->bind_addr.port);
 			sctp_seq_dump_local_addrs(seq, epb);
 			seq_printf(seq, "\n");
@@ -240,7 +240,7 @@
 			sk = epb->sk;
 			seq_printf(seq,
 				   "%8p %8p %-3d %-3d %-2d %-4d %-5d %-5d ",
-				   assoc, sk, sctp_sk(sk)->type, sk->sk_state,
+				   assoc, sk, sctp_sk(sk)->type, sk->state,
 				   assoc->state, hash, epb->bind_addr.port,
 				   assoc->peer.port);
 			sctp_seq_dump_local_addrs(seq, epb);
diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c
--- a/net/sctp/protocol.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/protocol.c	2005-01-15 07:05:50 -08:00
@@ -561,18 +561,18 @@
 	sock_init_data(NULL, newsk);
 	sk_set_owner(newsk, THIS_MODULE);
 
-	newsk->sk_type = SOCK_STREAM;
+	newsk->type = SOCK_STREAM;
 
-	newsk->sk_prot = sk->sk_prot;
-	newsk->sk_no_check = sk->sk_no_check;
-	newsk->sk_reuse = sk->sk_reuse;
-	newsk->sk_shutdown = sk->sk_shutdown;
-
-	newsk->sk_destruct = inet_sock_destruct;
-	newsk->sk_zapped = 0;
-	newsk->sk_family = PF_INET;
-	newsk->sk_protocol = IPPROTO_SCTP;
-	newsk->sk_backlog_rcv = sk->sk_prot->backlog_rcv;
+	newsk->prot = sk->prot;
+	newsk->no_check = sk->no_check;
+	newsk->reuse = sk->reuse;
+	newsk->shutdown = sk->shutdown;
+
+	newsk->destruct = inet_sock_destruct;
+	newsk->zapped = 0;
+	newsk->family = PF_INET;
+	newsk->protocol = IPPROTO_SCTP;
+	newsk->backlog_rcv = sk->prot->backlog_rcv;
 
 	newinet = inet_sk(newsk);
 
@@ -597,7 +597,7 @@
 	atomic_inc(&inet_sock_nr);
 #endif
 
-	if (newsk->sk_prot->init(newsk)) {
+	if (newsk->prot->init(newsk)) {
 		inet_sock_release(newsk);
 		newsk = NULL;
 	}
@@ -655,7 +655,7 @@
 		       "SCTP: Failed to create the SCTP control socket.\n");
 		return err;
 	}
-	sctp_ctl_socket->sk->sk_allocation = GFP_ATOMIC;
+	sctp_ctl_socket->sk->allocation = GFP_ATOMIC;
 	inet_sk(sctp_ctl_socket->sk)->ttl = MAXTTL;
 
 	return 0;
diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
--- a/net/sctp/sm_make_chunk.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/sm_make_chunk.c	2005-01-15 07:05:50 -08:00
@@ -1961,7 +1961,7 @@
 	 */
 	switch (param.p->type) {
 	case SCTP_PARAM_IPV6_ADDRESS:
-		if (PF_INET6 != asoc->base.sk->sk_family)
+		if (PF_INET6 != asoc->base.sk->family)
 			break;
 		/* Fall through. */
 	case SCTP_PARAM_IPV4_ADDRESS:
diff -Nru a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
--- a/net/sctp/sm_sideeffect.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/sm_sideeffect.c	2005-01-15 07:05:50 -08:00
@@ -247,7 +247,7 @@
 			   transport, GFP_ATOMIC);
 
 	if (error)
-		asoc->base.sk->sk_err = -error;
+		asoc->base.sk->err = -error;
 
 out_unlock:
 	sctp_bh_unlock_sock(asoc->base.sk);
@@ -287,7 +287,7 @@
 			   (void *)timeout_type, GFP_ATOMIC);
 
 	if (error)
-		asoc->base.sk->sk_err = -error;
+		asoc->base.sk->err = -error;
 
 out_unlock:
 	sctp_bh_unlock_sock(asoc->base.sk);
@@ -363,7 +363,7 @@
 			   transport, GFP_ATOMIC);
 
          if (error)
-		 asoc->base.sk->sk_err = -error;
+		 asoc->base.sk->err = -error;
 
 out_unlock:
 	sctp_bh_unlock_sock(asoc->base.sk);
@@ -478,9 +478,9 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	/* Set sk_err to ECONNRESET on a 1-1 style socket. */
+	/* Set sk->err to ECONNRESET on a 1-1 style socket. */
 	if (!sctp_style(asoc->base.sk, UDP))
-		asoc->base.sk->sk_err = ECONNRESET; 
+		asoc->base.sk->err = ECONNRESET; 
 
 	/* SEND_FAILED sent later when cleaning up the association. */
 	asoc->outqueue.error = error;
@@ -666,16 +666,16 @@
 	asoc->state = state;
 
 	if (sctp_style(sk, TCP)) {
-		/* Change the sk->sk_state of a TCP-style socket that has 
+		/* Change the sk->state of a TCP-style socket that has 
 		 * sucessfully completed a connect() call.
 		 */
 		if (sctp_state(asoc, ESTABLISHED) && sctp_sstate(sk, CLOSED))
-			sk->sk_state = SCTP_SS_ESTABLISHED;
+			sk->state = SCTP_SS_ESTABLISHED;
 
 		/* Set the RCV_SHUTDOWN flag when a SHUTDOWN is received. */
 		if (sctp_state(asoc, SHUTDOWN_RECEIVED) &&
 		    sctp_sstate(sk, ESTABLISHED))
-			sk->sk_shutdown |= RCV_SHUTDOWN;
+			sk->shutdown |= RCV_SHUTDOWN;
 	}
 
 	if (sctp_state(asoc, ESTABLISHED) ||
@@ -694,7 +694,7 @@
 		 * notifications.
 		 */
 		if (!sctp_style(sk, UDP))
-			sk->sk_state_change(sk);
+			sk->state_change(sk);
 	}
 }
 
@@ -709,7 +709,7 @@
 	 * can pick it up later.
 	 */ 
 	if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING) &&
-	    (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
+	    (!asoc->temp) && (sk->shutdown != SHUTDOWN_MASK))
 		return;
 
 	sctp_unhash_established(asoc);
diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
--- a/net/sctp/sm_statefuns.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/sm_statefuns.c	2005-01-15 07:05:50 -08:00
@@ -268,7 +268,7 @@
 	 */
 	if (!sctp_sstate(sk, LISTENING) ||
 	    (sctp_style(sk, TCP) &&
-	     (sk->sk_ack_backlog >= sk->sk_max_ack_backlog)))
+	     (sk->ack_backlog >= sk->max_ack_backlog)))
 		return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
 
 	/* 3.1 A packet containing an INIT chunk MUST have a zero Verification
diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c
--- a/net/sctp/socket.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/socket.c	2005-01-15 07:05:50 -08:00
@@ -116,7 +116,7 @@
 	struct sock *sk = asoc->base.sk;
 	int amt = 0;
 
-	amt = sk->sk_sndbuf - asoc->sndbuf_used;
+	amt = sk->sndbuf - asoc->sndbuf_used;
 	if (amt < 0)
 		amt = 0;
 	return amt;
@@ -144,7 +144,7 @@
 	*((struct sctp_chunk **)(chunk->skb->cb)) = chunk;
 
 	asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk);
-	sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk);
+	sk->wmem_queued += SCTP_DATA_SNDSIZE(chunk);
 }
 
 /* Verify that this is a valid address. */
@@ -224,7 +224,7 @@
 	if (id_asoc && (id_asoc != addr_asoc))
 		return NULL;
 
-	sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk),
+	sctp_get_pf_specific(sk->family)->addr_v4map(sctp_sk(sk),
 						(union sctp_addr *)addr);
 
 	return transport;
@@ -610,7 +610,7 @@
 		}
 
 		/* FIXME - There is probably a need to check if sk->sk_saddr and
-		 * sk->sk_rcv_addr are currently set to one of the addresses to
+		 * sk->rcv_addr are currently set to one of the addresses to
 		 * be removed. This is something which needs to be looked into
 		 * when we are fixing the outstanding issues with multi-homing
 		 * socket routing and failover schemes. Refer to comments in
@@ -949,7 +949,7 @@
 	SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p, timeout:%ld)\n", sk, timeout);
 
 	sctp_lock_sock(sk);
-	sk->sk_shutdown = SHUTDOWN_MASK;
+	sk->shutdown = SHUTDOWN_MASK;
 
 	ep = sctp_sk(sk)->ep;
 
@@ -967,7 +967,7 @@
 				sctp_unhash_established(asoc);
 				sctp_association_free(asoc);
 
-			} else if (sk->linger && !sk->sk_lingertime)
+			} else if (sk->linger && !sk->lingertime)
 				sctp_primitive_ABORT(asoc, NULL);
 			else
 				sctp_primitive_SHUTDOWN(asoc, NULL);
@@ -976,7 +976,7 @@
 	}
 
 	/* Clean up any skbs sitting on the receive queue.  */
-	sctp_queue_purge_ulpevents(&sk->sk_receive_queue);
+	sctp_queue_purge_ulpevents(&sk->receive_queue);
 	sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby);
 
 	/* On a TCP-style socket, block for at most linger_time if set. */
@@ -1312,7 +1312,7 @@
 	/* API 7.1.7, the sndbuf size per association bounds the
 	 * maximum size of data that can be sent in a single send call.
 	 */
-	if (msg_len > sk->sk_sndbuf) {
+	if (msg_len > sk->sndbuf) {
 		err = -EMSGSIZE;
 		goto out_free;
 	}
@@ -1549,7 +1549,7 @@
 		if (flags & MSG_PEEK)
 			goto out_free;
 		sctp_skb_pull(skb, copied);
-		skb_queue_head(&sk->sk_receive_queue, skb);
+		skb_queue_head(&sk->receive_queue, skb);
 
 		/* When only partial message is copied to the user, increase
 		 * rwnd by that amount. If all the data in the skb is read,
@@ -2357,7 +2357,7 @@
 	af = sctp_get_af_specific(to.sa.sa_family);
 	af->to_sk_daddr(&to, sk);
 
-	timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK);
+	timeo = sock_sndtimeo(sk, sk->socket->file->f_flags & O_NONBLOCK);
 	err = sctp_wait_for_connect(asoc, &timeo);
 
 out_unlock:
@@ -2403,7 +2403,7 @@
 		goto out;
 	}
 
-	timeo = sock_rcvtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK);
+	timeo = sock_rcvtimeo(sk, sk->socket->file->f_flags & O_NONBLOCK);
 
 	error = sctp_wait_for_accept(sk, timeo);
 	if (error)
@@ -2451,7 +2451,7 @@
 	sp = sctp_sk(sk);
 
 	/* Initialize the SCTP per socket area.  */
-	switch (sk->sk_type) {
+	switch (sk->type) {
 	case SOCK_SEQPACKET:
 		sp->type = SCTP_SOCKET_UDP;
 		break;
@@ -2531,7 +2531,7 @@
 
 	sp->adaption_ind = 0;
 
-	sp->pf = sctp_get_pf_specific(sk->sk_family);
+	sp->pf = sctp_get_pf_specific(sk->family);
 
 	/* Control variables for partial data delivery. */
 	sp->pd_mode           = 0;
@@ -2648,7 +2648,7 @@
 	memcpy(&status.sstat_primary.spinfo_address,
 	       &(transport->ipaddr), sizeof(union sctp_addr));
 	/* Map ipv4 address into v4-mapped-on-v6 address.  */
-	sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk),
+	sctp_get_pf_specific(sk->family)->addr_v4map(sctp_sk(sk),
 		(union sctp_addr *)&status.sstat_primary.spinfo_address);
 	status.sstat_primary.spinfo_state = transport->active;
 	status.sstat_primary.spinfo_cwnd = transport->cwnd;
@@ -2802,7 +2802,7 @@
 		return -EINVAL;
 
 	/* Create a new socket.  */
-	err = sock_create(sk->sk_family, SOCK_SEQPACKET, IPPROTO_SCTP, &sock);
+	err = sock_create(sk->family, SOCK_SEQPACKET, IPPROTO_SCTP, &sock);
 	if (err < 0)
 		return err;
 
@@ -3016,8 +3016,8 @@
 	list_for_each(pos, &asoc->peer.transport_addr_list) {
 		from = list_entry(pos, struct sctp_transport, transports);
 		memcpy(&temp, &from->ipaddr, sizeof(temp));
-		sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
-		addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len;
+		sctp_get_pf_specific(sk->family)->addr_v4map(sp, &temp);
+		addrlen = sctp_get_af_specific(sk->family)->sockaddr_len;
 		temp.v4.sin_port = htons(temp.v4.sin_port);
 		if (copy_to_user(to, &temp, addrlen))
 			return -EFAULT;
@@ -3111,7 +3111,7 @@
 				struct sctp_sockaddr_entry,
 				list);
 		memcpy(&temp, &from->a, sizeof(temp));
-		sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
+		sctp_get_pf_specific(sk->family)->addr_v4map(sp, &temp);
 		addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
 		temp.v4.sin_port = htons(temp.v4.sin_port);
 		if (copy_to_user(to, &temp, addrlen))
@@ -3160,7 +3160,7 @@
 	asoc->peer.primary_path->ipaddr.v4.sin_port =
 		ntohs(asoc->peer.primary_path->ipaddr.v4.sin_port);
 
-	sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp,
+	sctp_get_pf_specific(sk->family)->addr_v4map(sp,
 			(union sctp_addr *)&prim.ssp_addr);
 
 	if (copy_to_user(optval, &prim, sizeof(struct sctp_prim)))
@@ -3664,12 +3664,12 @@
 		 * used by other socket (pp->sk != NULL); that other
 		 * socket is going to be sk2.
 		 */
-		int sk_reuse = sk->sk_reuse;
+		int reuse = sk->reuse;
 		struct sock *sk2 = pp->sk;
 
 		SCTP_DEBUG_PRINTK("sctp_get_port() found a "
 				  "possible match\n");
-		if (pp->fastreuse != 0 && sk->sk_reuse != 0)
+		if (pp->fastreuse != 0 && sk->reuse != 0)
 			goto success;
 
 		/* Run through the list of sockets bound to the port
@@ -3686,7 +3686,7 @@
 			struct sctp_endpoint *ep2;
 			ep2 = sctp_sk(sk2)->ep;
 
-			if (sk_reuse && sk2->sk_reuse)
+			if (reuse && sk2->reuse)
 				continue;
 
 			if (sctp_bind_addr_match(&ep2->base.bind_addr, addr,
@@ -3710,12 +3710,12 @@
 		goto fail_unlock;
 
 	/* In either case (hit or miss), make sure fastreuse is 1 only
-	 * if sk->sk_reuse is too (that is, if the caller requested
+	 * if sk->reuse is too (that is, if the caller requested
 	 * SO_REUSEADDR on this socket -sk-).
 	 */
 	if (!pp->sk)
-		pp->fastreuse = sk->sk_reuse ? 1 : 0;
-	else if (pp->fastreuse && sk->sk_reuse == 0)
+		pp->fastreuse = sk->reuse ? 1 : 0;
+	else if (pp->fastreuse && sk->reuse == 0)
 		pp->fastreuse = 0;
 
 	/* We are set, so fill up all the data in the hash table
@@ -3787,7 +3787,7 @@
 			return 0;
 		
 		sctp_unhash_endpoint(ep);
-		sk->sk_state = SCTP_SS_CLOSED;
+		sk->state = SCTP_SS_CLOSED;
 	}
 
 	/* Return if we are already listening. */
@@ -3808,7 +3808,7 @@
 		if (sctp_autobind(sk))
 			return -EAGAIN;
 	}
-	sk->sk_state = SCTP_SS_LISTENING;
+	sk->state = SCTP_SS_LISTENING;
 	sctp_hash_endpoint(ep);
 	return 0;
 }
@@ -3830,7 +3830,7 @@
 			return 0;
 		
 		sctp_unhash_endpoint(ep);
-		sk->sk_state = SCTP_SS_CLOSED;
+		sk->state = SCTP_SS_CLOSED;
 	}
 
 	if (sctp_sstate(sk, LISTENING))
@@ -3850,8 +3850,8 @@
 		if (sctp_autobind(sk))
 			return -EAGAIN;
 	}
-	sk->sk_state = SCTP_SS_LISTENING;
-	sk->sk_max_ack_backlog = backlog;
+	sk->state = SCTP_SS_LISTENING;
+	sk->max_ack_backlog = backlog;
 	sctp_hash_endpoint(ep);
 	return 0;
 }
@@ -3925,7 +3925,7 @@
 	struct sctp_opt *sp = sctp_sk(sk);
 	unsigned int mask;
 
-	poll_wait(file, sk->sk_sleep, wait);
+	poll_wait(file, sk->sleep, wait);
 
 	/* A TCP-style listening socket becomes readable when the accept queue
 	 * is not empty.
@@ -3937,14 +3937,14 @@
 	mask = 0;
 
 	/* Is there any exceptional events?  */
-	if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
+	if (sk->err || !skb_queue_empty(&sk->error_queue))
 		mask |= POLLERR;
-	if (sk->sk_shutdown == SHUTDOWN_MASK)
+	if (sk->shutdown == SHUTDOWN_MASK)
 		mask |= POLLHUP;
 
 	/* Is it readable?  Reconsider this code with TCP-style support.  */
-	if (!skb_queue_empty(&sk->sk_receive_queue) ||
-	    (sk->sk_shutdown & RCV_SHUTDOWN))
+	if (!skb_queue_empty(&sk->receive_queue) ||
+	    (sk->shutdown & RCV_SHUTDOWN))
 		mask |= POLLIN | POLLRDNORM;
 
 	/* The association is either gone or not ready.  */
@@ -3955,7 +3955,7 @@
 	if (sctp_writeable(sk)) {
 		mask |= POLLOUT | POLLWRNORM;
 	} else {
-		set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
+		set_bit(SOCK_ASYNC_NOSPACE, &sk->socket->flags);
 		/*
 		 * Since the socket is not locked, the buffer
 		 * might be made available after the writeable check and
@@ -4164,7 +4164,7 @@
 	int error;
 	DECLARE_WAITQUEUE(wait, current);
 
-	add_wait_queue_exclusive(sk->sk_sleep, &wait);
+	add_wait_queue_exclusive(sk->sleep, &wait);
 	__set_current_state(TASK_INTERRUPTIBLE);
 
 	/* Socket errors? */
@@ -4172,11 +4172,11 @@
 	if (error)
 		goto out;
 
-	if (!skb_queue_empty(&sk->sk_receive_queue))
+	if (!skb_queue_empty(&sk->receive_queue))
 		goto ready;
 
 	/* Socket shut down?  */
-	if (sk->sk_shutdown & RCV_SHUTDOWN)
+	if (sk->shutdown & RCV_SHUTDOWN)
 		goto out;
 
 	/* Sequenced packets can come disconnected.  If so we report the
@@ -4202,7 +4202,7 @@
 	sctp_lock_sock(sk);
 
 ready:
-	remove_wait_queue(sk->sk_sleep, &wait);
+	remove_wait_queue(sk->sleep, &wait);
 	__set_current_state(TASK_RUNNING);
 	return 0;
 
@@ -4210,7 +4210,7 @@
 	error = sock_intr_errno(*timeo_p);
 
 out:
-	remove_wait_queue(sk->sk_sleep, &wait);
+	remove_wait_queue(sk->sleep, &wait);
 	__set_current_state(TASK_RUNNING);
 	*err = error;
 	return error;
@@ -4227,7 +4227,7 @@
 	struct sk_buff *skb;
 	long timeo;
 
-	/* Caller is allowed not to check sk->sk_err before calling.  */
+	/* Caller is allowed not to check sk->err before calling.  */
 	error = sock_error(sk);
 	if (error)
 		goto no_packet;
@@ -4248,21 +4248,21 @@
 		if (flags & MSG_PEEK) {
 			unsigned long cpu_flags;
 
-			sctp_spin_lock_irqsave(&sk->sk_receive_queue.lock,
+			sctp_spin_lock_irqsave(&sk->receive_queue.lock,
 					       cpu_flags);
-			skb = skb_peek(&sk->sk_receive_queue);
+			skb = skb_peek(&sk->receive_queue);
 			if (skb)
 				atomic_inc(&skb->users);
-			sctp_spin_unlock_irqrestore(&sk->sk_receive_queue.lock,
+			sctp_spin_unlock_irqrestore(&sk->receive_queue.lock,
 						    cpu_flags);
 		} else {
-			skb = skb_dequeue(&sk->sk_receive_queue);
+			skb = skb_dequeue(&sk->receive_queue);
 		}
 
 		if (skb)
 			return skb;
 
-		if (sk->sk_shutdown & RCV_SHUTDOWN)
+		if (sk->shutdown & RCV_SHUTDOWN)
 			break;
 
 		/* User doesn't want to wait.  */
@@ -4282,22 +4282,22 @@
 static void __sctp_write_space(struct sctp_association *asoc)
 {
 	struct sock *sk = asoc->base.sk;
-	struct socket *sock = sk->sk_socket;
+	struct socket *sock = sk->socket;
 
 	if ((sctp_wspace(asoc) > 0) && sock) {
 		if (waitqueue_active(&asoc->wait))
 			wake_up_interruptible(&asoc->wait);
 
 		if (sctp_writeable(sk)) {
-			if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
-				wake_up_interruptible(sk->sk_sleep);
+			if (sk->sleep && waitqueue_active(sk->sleep))
+				wake_up_interruptible(sk->sleep);
 
 			/* Note that we try to include the Async I/O support
 			 * here by modeling from the current TCP/UDP code.
 			 * We have not tested with it yet.
 			 */
 			if (sock->fasync_list &&
-			    !(sk->sk_shutdown & SEND_SHUTDOWN))
+			    !(sk->shutdown & SEND_SHUTDOWN))
 				sock_wake_async(sock, 2, POLL_OUT);
 		}
 	}
@@ -4318,7 +4318,7 @@
 	asoc = chunk->asoc;
 	sk = asoc->base.sk;
 	asoc->sndbuf_used -= SCTP_DATA_SNDSIZE(chunk);
-	sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk);
+	sk->wmem_queued -= SCTP_DATA_SNDSIZE(chunk);
 	__sctp_write_space(asoc);
 
 	sctp_association_put(asoc);
@@ -4347,7 +4347,7 @@
 		__set_current_state(TASK_INTERRUPTIBLE);
 		if (!*timeo_p)
 			goto do_nonblock;
-		if (sk->sk_err || asoc->state >= SCTP_STATE_SHUTDOWN_PENDING ||
+		if (sk->err || asoc->state >= SCTP_STATE_SHUTDOWN_PENDING ||
 		    asoc->base.dead)
 			goto do_error;
 		if (signal_pending(current))
@@ -4415,7 +4415,7 @@
 {
 	int amt = 0;
 
-	amt = sk->sk_sndbuf - sk->sk_wmem_queued;
+	amt = sk->sndbuf - sk->wmem_queued;
 	if (amt < 0)
 		amt = 0;
 	return amt;
@@ -4442,9 +4442,9 @@
 		__set_current_state(TASK_INTERRUPTIBLE);
 		if (!*timeo_p)
 			goto do_nonblock;
-		if (sk->sk_shutdown & RCV_SHUTDOWN)
+		if (sk->shutdown & RCV_SHUTDOWN)
 			break;
-		if (sk->sk_err || asoc->state >= SCTP_STATE_SHUTDOWN_PENDING ||
+		if (sk->err || asoc->state >= SCTP_STATE_SHUTDOWN_PENDING ||
 		    asoc->base.dead)
 			goto do_error;
 		if (signal_pending(current))
@@ -4497,7 +4497,7 @@
 
 	ep = sctp_sk(sk)->ep;
 
-	add_wait_queue_exclusive(sk->sk_sleep, &wait);
+	add_wait_queue_exclusive(sk->sleep, &wait);
 
 	for (;;) {
 		__set_current_state(TASK_INTERRUPTIBLE);
@@ -4524,7 +4524,7 @@
 			break;
 	}
 
-	remove_wait_queue(sk->sk_sleep, &wait);
+	remove_wait_queue(sk->sleep, &wait);
 	__set_current_state(TASK_RUNNING);	
 
 	return err;
@@ -4534,7 +4534,7 @@
 {
 	DECLARE_WAITQUEUE(wait, current);
 
-	add_wait_queue_exclusive(sk->sk_sleep, &wait);
+	add_wait_queue_exclusive(sk->sleep, &wait);
 
 	do {
 		__set_current_state(TASK_INTERRUPTIBLE);
@@ -4545,7 +4545,7 @@
 		sctp_lock_sock(sk);
 	} while (!signal_pending(current) && timeout);
 
-	remove_wait_queue(sk->sk_sleep, &wait);
+	remove_wait_queue(sk->sleep, &wait);
 	__set_current_state(TASK_RUNNING);	
 }
 
@@ -4565,8 +4565,8 @@
 	/* Migrate socket buffer sizes and all the socket level options to the
 	 * new socket.
 	 */
-	newsk->sk_sndbuf = oldsk->sk_sndbuf;
-	newsk->sk_rcvbuf = oldsk->sk_rcvbuf;
+	newsk->sndbuf = oldsk->sndbuf;
+	newsk->rcvbuf = oldsk->rcvbuf;
 	/* Brute force copy old sctp opt. */
 	memcpy(newsp, oldsp, sizeof(struct sctp_opt));
 
@@ -4581,11 +4581,11 @@
 	/* Move any messages in the old socket's receive queue that are for the
 	 * peeled off association to the new socket's receive queue.
 	 */
-	sctp_skb_for_each(skb, &oldsk->sk_receive_queue, tmp) {
+	sctp_skb_for_each(skb, &oldsk->receive_queue, tmp) {
 		event = sctp_skb2event(skb);
 		if (event->asoc == assoc) {
 			__skb_unlink(skb, skb->list);
-			__skb_queue_tail(&newsk->sk_receive_queue, skb);
+			__skb_queue_tail(&newsk->receive_queue, skb);
 		}
 	}
 
@@ -4605,7 +4605,7 @@
 		if (assoc->ulpq.pd_mode) {
 			queue = &newsp->pd_lobby;
 		} else
-			queue = &newsk->sk_receive_queue;
+			queue = &newsk->receive_queue;
 
 		/* Walk through the pd_lobby, looking for skbs that
 		 * need moved to the new socket.
@@ -4639,9 +4639,9 @@
 	 * is called, set RCV_SHUTDOWN flag.
 	 */
 	if (sctp_state(assoc, CLOSED) && sctp_style(newsk, TCP))
-		newsk->sk_shutdown |= RCV_SHUTDOWN;
+		newsk->shutdown |= RCV_SHUTDOWN;
 
-	newsk->sk_state = SCTP_SS_ESTABLISHED;
+	newsk->state = SCTP_SS_ESTABLISHED;
 }
 
 /* This proto struct describes the ULP interface for SCTP.  */
diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
--- a/net/sctp/ulpevent.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/ulpevent.c	2005-01-15 07:05:50 -08:00
@@ -323,7 +323,7 @@
 	memcpy(&spc->spc_aaddr, aaddr, sizeof(struct sockaddr_storage));
 
 	/* Map ipv4 address into v4-mapped-on-v6 address.  */
-	sctp_get_pf_specific(asoc->base.sk->sk_family)->addr_v4map(
+	sctp_get_pf_specific(asoc->base.sk->family)->addr_v4map(
 					sctp_sk(asoc->base.sk),
 					(union sctp_addr *)&spc->spc_aaddr);
 
diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
--- a/net/sctp/ulpqueue.c	2005-01-15 07:05:50 -08:00
+++ b/net/sctp/ulpqueue.c	2005-01-15 07:05:50 -08:00
@@ -144,7 +144,7 @@
 	sp->pd_mode = 0;
 	if (!skb_queue_empty(&sp->pd_lobby)) {
 		struct list_head *list;
-		sctp_skb_list_tail(&sp->pd_lobby, &sk->sk_receive_queue);
+		sctp_skb_list_tail(&sp->pd_lobby, &sk->receive_queue);
 		list = (struct list_head *)&sctp_sk(sk)->pd_lobby;
 		INIT_LIST_HEAD(list);
 		return 1;
@@ -170,7 +170,7 @@
 	/* If the socket is just going to throw this away, do not
 	 * even try to deliver it.
 	 */
-	if (sk->dead || (sk->sk_shutdown & RCV_SHUTDOWN))
+	if (sk->dead || (sk->shutdown & RCV_SHUTDOWN))
 		goto out_free;
 
 	/* Check if the user wishes to receive this event.  */
@@ -183,13 +183,13 @@
 	 */
 
 	if (!sctp_sk(sk)->pd_mode) {
-		queue = &sk->sk_receive_queue;
+		queue = &sk->receive_queue;
 	} else if (ulpq->pd_mode) {
 		if (event->msg_flags & MSG_NOTIFICATION)
 		       	queue = &sctp_sk(sk)->pd_lobby;
 		else {
 			clear_pd = event->msg_flags & MSG_EOR;
-			queue = &sk->sk_receive_queue;
+			queue = &sk->receive_queue;
 		}
 	} else
 		queue = &sctp_sk(sk)->pd_lobby;
@@ -210,8 +210,8 @@
 	if (clear_pd)
 		sctp_ulpq_clear_pd(ulpq);
 
-	if (queue == &sk->sk_receive_queue)
-		sk->sk_data_ready(sk, 0);
+	if (queue == &sk->receive_queue)
+		sk->data_ready(sk, 0);
 	return 1;
 
 out_free:
@@ -818,7 +818,7 @@
 
 	freed = 0;
 
-	if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) {
+	if (skb_queue_empty(&asoc->base.sk->receive_queue)) {
 		freed = sctp_ulpq_renege_order(ulpq, needed);
 		if (freed < needed) {
 			freed += sctp_ulpq_renege_frags(ulpq, needed - freed);
@@ -857,9 +857,9 @@
 					      SCTP_PARTIAL_DELIVERY_ABORTED,
 					      gfp);
 	if (ev)
-		__skb_queue_tail(&sk->sk_receive_queue, sctp_event2skb(ev));
+		__skb_queue_tail(&sk->receive_queue, sctp_event2skb(ev));
 
 	/* If there is data waiting, send it up the socket now. */
 	if (sctp_ulpq_clear_pd(ulpq) || ev)
-		sk->sk_data_ready(sk, 0);
+		sk->data_ready(sk, 0);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.