Permalink
Browse files

Patch 24 change log

1) Fix for sctp_sendmsg. If the sa_len was set to 0 all worked as
   it should... however if sa_len is set to a proper value then
   garbage would be set as the address size.
2) debug in timer routine made to print under debug
   level 1 instead of whenever debug is defined
3) port 0 check moved before the checksum verification.
4) Added missing port 0 check for IPv6
5) Fixed packet-drop processing decrease routine. The
   fs/cwnd subtraction were done the wrong way.
6) The initial RTO would not backoff, doubling. This
   was due to not initializing it to rto.initial.
7) The parameter length of the stream reset request
   was incorrect.
8) All timers that sub-functions that ran threshold_management() had
   a possibility that the association was destroyed. However no way
   was it possible to communicate that fact to the calling timeout
   handler. Thus it was possible that a chunk_output would be
   called on an association that was free... very bad. This is
   all fixed and now all t-o functions that do threshold mangagment
   must return 0 for ok and 1 for association destroyed.
9) Got rid of  an used define in sctp_constants.h
10) Rewrite IPv4 src address selection and fixed bound specific
    IPv6 src address selection.
11) Missing return when already in SHUTDOWN-RECIEVED.
12) Improper memset found by Marko Lindholm in the libsctp.a code
    for sctp_bindx.
13) Fix the stream reset functions to use the parameters properly
    per the newly forming draft. Still have a bug here where
    we can loose multiple stream resets (labeled with FIXME)
14) Kernel changes for sctp_sendx()
15) Kernel changes for MSG_SENDALL flag
16) sctp lib adde of sctp_sendx()


Patch 25 all of patch24)

1) Link Local addresses for V6 where the ll address
   is included implicitly would make a false decision to
   NOT list addresses. This has been fixed.
2) Fix switch back after failure
3) We run only one RTO timer. In the timing of
   things we would compare to any dest that had been
   idle longer than the HB-Delay value.. This is
   incorrect, we should take the longest value and
   HB if its greater than the RTO.
4) Fixed shutdown-received state so we get the
   shutdown and not return without stopping the
   timer and sending a S-A.
5) Chunk_output was not being called when a shutdown
   was queued on the v6 side. This is a bug that
   was fixed for v4 at the Munester Inter-op, but we
   missed the V6 side :-<
6) You can use NULL as the to argument in sctp_sendmsg
   for 1to1 style sockets.
7) Performance changes on the sender side of SCTP that
   provide signifigant gains in SACK processing as
   well as on destinations that fill up the ifp queue.
8) Fixed IPV6 to V4 mapping issue with V6 Mapped addresses
   in sctp_bindx
9) Get rid of warnings comparison in signed/unsigned.
10) Purged TCP_MODEL, so now it is always present.
11) Fixed a socketoption mbuf leak when a setsockopt() failed.
12) Fixed problem with mapped v4 addresses.
13) Iterator & was a &&
14) Link local should also include ipv4 private addresses, since
    if its on the local link it better be also part of the
    private address space :-D
15) A performance improvement introduced a bug that caused
    HB's to stop being sent due to a miscaluclation of time.
16) DSACK timer now configurable on an EP
17) Whew, 5.3.x compatibile aka SMP with locking now
    works.
  • Loading branch information...
1 parent a23136f commit 57054622ad85ad5a322e004b37db8ae43fe0feee itojun committed Mar 6, 2005

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,5 +1,4 @@
-/* $KAME: sctp.h,v 1.17 2004/08/17 04:06:15 itojun Exp $ */
-/* added comment for commit test */
+/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */
#ifndef _NETINET_SCTP_H_
#define _NETINET_SCTP_H_
@@ -35,6 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+#include <sys/types.h>
/*
* SCTP protocol - RFC2960.
@@ -66,7 +66,6 @@ struct sctp_paramhdr {
u_int16_t param_length; /* parameter length */
};
-
/*
* user socket options
*/
@@ -132,20 +131,25 @@ struct sctp_paramhdr {
#define SCTP_GET_STAT_LOG 0x0000001d
#define SCTP_CONNECT_X 0x0000001e /* hidden opt for connectx */
#define SCTP_RESET_STREAMS 0x0000001f
+#define SCTP_CONNECT_X_DELAYED 0x00000020 /* hidden opt for connectx_delayed
+ * part of sctp_sendx()
+ */
+#define SCTP_CONNECT_X_COMPLETE 0x00000021
+#define SCTP_GET_ASOC_ID_LIST 0x00000022
+
+/* Other BSD items */
+#define SCTP_GET_NONCE_VALUES 0x00000023
+#define SCTP_DELAYED_ACK_TIME 0x00000024
/* Things for the AUTH draft possibly */
-#define SCTP_PEER_PUBLIC_KEY 0x00000020 /* get the peers public key */
-#define SCTP_MY_PUBLIC_KEY 0x00000021 /* get/set my endpoints public key */
-#define SCTP_SET_AUTH_SECRET 0x00000022 /* get/set my shared secret */
-#define SCTP_SET_AUTH_CHUNKS 0x00000023 /* specify what chunks you want authenticated,
- * the system may have additional requirments
+#define SCTP_PEER_PUBLIC_KEY 0x00000100 /* get the peers public key */
+#define SCTP_MY_PUBLIC_KEY 0x00000101 /* get/set my endpoints public key */
+#define SCTP_SET_AUTH_SECRET 0x00000102 /* get/set my shared secret */
+#define SCTP_SET_AUTH_CHUNKS 0x00000103/* specify what chunks you want
+ * the system may have additional requirments
* as well. I.e. probably ASCONF/ASCONF-ACK no matter
* if you want it or not.
*/
-/* Other debug items */
-#define SCTP_GET_NONCE_VALUES 0x00000024
-
-
/* Debug things that need to be purged */
#define SCTP_SET_INITIAL_DBG_SEQ 0x00001f00
#define SCTP_RESET_PEGS 0x00002000
@@ -237,6 +241,60 @@ struct sctp_error_unrecognized_chunk {
#define HAVE_SCTP_NOCONNECT 0
#define HAVE_SCTP_ECN_NONCE 1 /* ECN Nonce option */
+/* Main SCTP chunk types, we place
+ * these here since that way natd and f/w's
+ * in user land can find them.
+ */
+#define SCTP_DATA 0x00
+#define SCTP_INITIATION 0x01
+#define SCTP_INITIATION_ACK 0x02
+#define SCTP_SELECTIVE_ACK 0x03
+#define SCTP_HEARTBEAT_REQUEST 0x04
+#define SCTP_HEARTBEAT_ACK 0x05
+#define SCTP_ABORT_ASSOCIATION 0x06
+#define SCTP_SHUTDOWN 0x07
+#define SCTP_SHUTDOWN_ACK 0x08
+#define SCTP_OPERATION_ERROR 0x09
+#define SCTP_COOKIE_ECHO 0x0a
+#define SCTP_COOKIE_ACK 0x0b
+#define SCTP_ECN_ECHO 0x0c
+#define SCTP_ECN_CWR 0x0d
+#define SCTP_SHUTDOWN_COMPLETE 0x0e
+
+/* draft-ietf-tsvwg-addip-sctp */
+#define SCTP_ASCONF 0xc1
+#define SCTP_ASCONF_ACK 0x80
+
+/* draft-ietf-stewart-prsctp */
+#define SCTP_FORWARD_CUM_TSN 0xc0
+
+/* draft-ietf-stewart-pktdrpsctp */
+#define SCTP_PACKET_DROPPED 0x81
+
+/* draft-ietf-stewart-strreset-xxx */
+#define SCTP_STREAM_RESET 0x82
+
+/* ABORT and SHUTDOWN COMPLETE FLAG */
+#define SCTP_HAD_NO_TCB 0x01
+
+/* Packet dropped flags */
+#define SCTP_FROM_MIDDLE_BOX SCTP_HAD_NO_TCB
+#define SCTP_BADCRC 0x02
+#define SCTP_PACKET_TRUNCATED 0x04
+
+#define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite time */
+#define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst in sat */
+/* Data Chuck Specific Flags */
+#define SCTP_DATA_FRAG_MASK 0x03
+#define SCTP_DATA_MIDDLE_FRAG 0x00
+#define SCTP_DATA_LAST_FRAG 0x01
+#define SCTP_DATA_FIRST_FRAG 0x02
+#define SCTP_DATA_NOT_FRAG 0x03
+#define SCTP_DATA_UNORDERED 0x04
+
+/* ECN Nonce: SACK Chunk Specific Flags */
+#define SCTP_SACK_NONCE_SUM 0x01
+
#include <netinet/sctp_uio.h>
#endif /* !_NETINET_SCTP_H_ */
@@ -1,4 +1,4 @@
-/* $KAME: sctp_asconf.c,v 1.23 2004/08/17 06:28:01 t-momose Exp $ */
+/* $KAME: sctp_asconf.c,v 1.24 2005/03/06 16:04:16 itojun Exp $ */
/*
* Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -580,7 +580,7 @@ sctp_process_asconf_set_primary(struct sctp_asconf_paramhdr *aph,
* if all parameters are processed ok, send a plain (empty) ASCONF-ACK
*/
void
-sctp_handle_asconf(struct mbuf *m, int offset, struct sctp_asconf_chunk *cp,
+sctp_handle_asconf(struct mbuf *m, unsigned int offset, struct sctp_asconf_chunk *cp,
struct sctp_tcb *stcb, struct sctp_nets *net)
{
struct sctp_association *asoc;
@@ -589,7 +589,7 @@ sctp_handle_asconf(struct mbuf *m, int offset, struct sctp_asconf_chunk *cp,
struct sctp_asconf_ack_chunk *ack_cp;
struct sctp_asconf_paramhdr *aph, *ack_aph;
struct sctp_ipv6addr_param *p_addr;
- int asconf_limit;
+ unsigned int asconf_limit;
int error = 0; /* did an error occur? */
/* asconf param buffer */
static u_int8_t aparam_buf[DEFAULT_PARAM_BUFFER];
@@ -696,7 +696,7 @@ sctp_handle_asconf(struct mbuf *m, int offset, struct sctp_asconf_chunk *cp,
/* process through all parameters */
while (aph != NULL) {
- int param_length, param_type;
+ unsigned int param_length, param_type;
param_type = ntohs(aph->ph.param_type);
param_length = ntohs(aph->ph.param_length);
@@ -1404,7 +1404,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
offset += sizeof(struct sctp_asconf_ack_chunk);
/* process through all parameters */
while (ack_length >= sizeof(struct sctp_asconf_paramhdr)) {
- int param_length, param_type;
+ unsigned int param_length, param_type;
/* get pointer to next asconf parameter */
aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset,
@@ -1584,10 +1584,10 @@ sctp_is_scopeid_in_nets(struct sctp_tcb *stcb, struct sockaddr *sa)
/* hunt through our destination nets list for this scope_id */
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
- if (((struct sockaddr *)(&net->ra._l_addr))->sa_family !=
+ if (((struct sockaddr *)(&net->ro._l_addr))->sa_family !=
AF_INET6)
continue;
- net6 = (struct sockaddr_in6 *)&net->ra._l_addr;
+ net6 = (struct sockaddr_in6 *)&net->ro._l_addr;
if (IN6_IS_ADDR_LINKLOCAL(&net6->sin6_addr) == 0)
continue;
if (sctp_is_same_scope(sin6, net6)) {
@@ -1806,19 +1806,23 @@ sctp_addr_mgmt_ep(struct sctp_inpcb *inp, struct ifaddr *ifa, uint16_t type)
struct sctp_tcb *stcb;
int s;
+ SCTP_INP_WLOCK(inp);
/* make sure we're "allowed" to add this type of addr */
if (ifa->ifa_addr->sa_family == AF_INET6) {
struct in6_ifaddr *ifa6;
/* invalid if we're not a v6 endpoint */
- if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0)
+ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
+ SCTP_INP_WUNLOCK(inp);
return;
+ }
/* is the v6 addr really valid ? */
ifa6 = (struct in6_ifaddr *)ifa;
if (IFA6_IS_DEPRECATED(ifa6) ||
(ifa6->ia6_flags &
(IN6_IFF_DETACHED | IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) {
/* can't use an invalid address */
+ SCTP_INP_WUNLOCK(inp);
return;
}
} else if (ifa->ifa_addr->sa_family == AF_INET) {
@@ -1834,13 +1838,15 @@ sctp_addr_mgmt_ep(struct sctp_inpcb *inp, struct ifaddr *ifa, uint16_t type)
#else
(inp6->inp_flags & IN6P_IPV6_V6ONLY)
#endif
- )
+ ) {
+ SCTP_INP_WUNLOCK(inp);
return;
+ }
} else {
/* invalid address family */
+ SCTP_INP_WUNLOCK(inp);
return;
}
-
/* is this endpoint subset bound ? */
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
/* subset bound endpoint */
@@ -1855,6 +1861,7 @@ sctp_addr_mgmt_ep(struct sctp_inpcb *inp, struct ifaddr *ifa, uint16_t type)
sctp_del_local_addr_ep(inp, ifa);
}
/* no asconfs to queue for this inp... */
+ SCTP_INP_WUNLOCK(inp);
return;
} else {
/*
@@ -1878,9 +1885,12 @@ sctp_addr_mgmt_ep(struct sctp_inpcb *inp, struct ifaddr *ifa, uint16_t type)
#endif
/* process for all associations for this endpoint */
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
sctp_addr_mgmt_assoc(inp, stcb, ifa, type);
+ SCTP_TCB_UNLOCK(stcb);
} /* for each stcb */
splx(s);
+ SCTP_INP_WUNLOCK(inp);
}
/*
@@ -1906,17 +1916,21 @@ sctp_addr_mgmt_restrict_ep(struct sctp_inpcb *inp, struct ifaddr *ifa)
#else
s = splnet();
#endif
+ SCTP_INP_RLOCK(inp);
/* process for all associations for this endpoint */
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
/* put this address on the "pending/do not use yet" list */
+ SCTP_TCB_LOCK(stcb);
sctp_add_local_addr_assoc(stcb, ifa);
+ SCTP_TCB_UNLOCK(stcb);
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_ASCONF1) {
printf("restrict_ep: added addr to unusable list\n");
}
#endif /* SCTP_DEBUG */
} /* for each stcb */
splx(s);
+ SCTP_INP_RUNLOCK(inp);
}
/*
@@ -1973,6 +1987,7 @@ sctp_addr_mgmt(struct ifaddr *ifa, uint16_t type) {
* all addresses are passed from any type of interface-- need to filter
* duplicate addresses may get requested
*/
+
void
sctp_add_ip_address(struct ifaddr *ifa)
{
@@ -2002,22 +2017,24 @@ sctp_delete_ip_address(struct ifaddr *ifa)
}
/* go through all our PCB's */
+ SCTP_INP_INFO_RLOCK();
LIST_FOREACH(inp, &sctppcbinfo.listhead, sctp_list) {
struct sctp_tcb *stcb;
struct sctp_laddr *laddr, *laddr_next;
/* process for all associations for this endpoint */
+ SCTP_INP_RLOCK(inp);
LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
struct sctp_nets *net;
/* process through the nets list */
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
struct rtentry *rt;
/* delete this address if cached */
- rt = net->ra.ro_rt;
+ rt = net->ro.ro_rt;
if (rt != NULL && rt->rt_ifa == ifa) {
/* RTFREE(rt);*/
- net->ra.ro_rt = NULL;
+ net->ro.ro_rt = NULL;
}
} /* for each net */
/* process through the asoc "pending" list */
@@ -2041,7 +2058,9 @@ sctp_delete_ip_address(struct ifaddr *ifa)
}
laddr = laddr_next;
} /* while */
+ SCTP_INP_RUNLOCK(inp);
} /* for each inp */
+ SCTP_INP_INFO_RUNLOCK();
}
/*
@@ -2435,7 +2454,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb)
*/
static void
sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
- int offset, int length)
+ unsigned int offset, unsigned int length)
{
struct sctp_paramhdr tmp_param, *ph;
uint16_t plen, ptype;
@@ -2591,8 +2610,8 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
* returns 1 if found, 0 if not
*/
static uint32_t
-sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, int offset,
- int length, struct sockaddr *sa)
+sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, unsigned int offset,
+ unsigned int length, struct sockaddr *sa)
{
struct sctp_paramhdr tmp_param, *ph;
uint16_t plen, ptype;
@@ -2606,7 +2625,7 @@ sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, int offset,
if (
#ifdef INET6
- (sa->sa_family != AF_INET6) &&
+ (sa->sa_family != AF_INET6) &&
#endif /* INET6 */
(sa->sa_family != AF_INET))
return (0);
@@ -1,4 +1,4 @@
-/* $KAME: sctp_asconf.h,v 1.7 2004/08/17 04:06:16 itojun Exp $ */
+/* $KAME: sctp_asconf.h,v 1.8 2005/03/06 16:04:16 itojun Exp $ */
#ifndef _NETINET_SCTP_ASCONF_H_
#define _NETINET_SCTP_ASCONF_H_
@@ -39,7 +39,7 @@ extern void sctp_asconf_cleanup(struct sctp_tcb *, struct sctp_nets *);
extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *);
-extern void sctp_handle_asconf(struct mbuf *, int, struct sctp_asconf_chunk *,
+extern void sctp_handle_asconf(struct mbuf *, unsigned int, struct sctp_asconf_chunk *,
struct sctp_tcb *, struct sctp_nets *);
extern void sctp_handle_asconf_ack(struct mbuf *, int,
@@ -1,4 +1,4 @@
-/* $KAME: sctp_callout.h,v 1.8 2005/01/25 07:35:42 itojun Exp $ */
+/* $KAME: sctp_callout.h,v 1.9 2005/03/06 16:04:17 itojun Exp $ */
#ifndef __SCTP_CALLOUT__
#define __SCTP_CALLOUT__
@@ -60,7 +60,7 @@ void callout_init __P((struct callout *));
#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING)
void callout_reset __P((struct callout *, int, void (*)(void *), void *));
-#ifndef __NetBSD__
+#ifndef __NetBSD__
int callout_stop __P((struct callout *));
#endif
#endif
Oops, something went wrong.

0 comments on commit 5705462

Please sign in to comment.