summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2008-06-14 07:58:05 +0000
committerrrs <rrs@FreeBSD.org>2008-06-14 07:58:05 +0000
commit7782c49376b2a6dea979e4c270f324a1771d1a7a (patch)
tree3df882f31d5c2904b2d47df7b10bea16002c929b /sys/netinet6
parentf07c38e84aa87001718dc3e4625bc30c9af3be89 (diff)
downloadFreeBSD-src-7782c49376b2a6dea979e4c270f324a1771d1a7a.zip
FreeBSD-src-7782c49376b2a6dea979e4c270f324a1771d1a7a.tar.gz
- Macro-izes the packed declaration in all headers.
- Vimage prep - these are major restructures to move all global variables to be accessed via a macro or two. The variables all go into a single structure. - Asconf address addition tweaks (add_or_del Interfaces) - Fix rwnd calcualtion to be more conservative. - Support SACK_IMMEDIATE flag to skip delayed sack by demand of peer. - Comment updates in the sack mapping calculations - Invarients panic added. - Pre-support for UDP tunneling (we can do this on MAC but will need added support from UDP to get a "pipe" of UDP packets in. - clear trace buffer sysctl added when local tracing on. Note the majority of this huge patch is all the vimage prep stuff :-)
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/sctp6_usrreq.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index 8798092..92e5a9e 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/sctp_input.h>
#include <netinet/sctp_output.h>
#include <netinet/sctp_bsd_addr.h>
+#include <netinet/udp.h>
#ifdef IPSEC
#include <netipsec/ipsec.h>
@@ -79,6 +80,7 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
struct sctp_tcb *stcb = NULL;
int pkt_len = 0;
int off = *offp;
+ uint16_t port = 0;
/* get the VRF and table id's */
if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) {
@@ -125,7 +127,7 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
if (sh->dest_port == 0)
goto bad;
check = sh->checksum; /* save incoming checksum */
- if ((check == 0) && (sctp_no_csum_on_loopback) &&
+ if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) &&
(IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) {
goto sctp_skip_csum;
}
@@ -136,6 +138,12 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
calc_check, check, m, mlen, iphlen);
stcb = sctp_findassociation_addr(m, iphlen, offset - sizeof(*ch),
sh, ch, &in6p, &net, vrf_id);
+ if ((net) && (port)) {
+ if (net->port == 0) {
+ sctp_pathmtu_adjustment(in6p, stcb, net, net->mtu - sizeof(struct udphdr));
+ }
+ net->port = port;
+ }
/* in6p's ref-count increased && stcb locked */
if ((in6p) && (stcb)) {
sctp_send_packet_dropped(stcb, net, m, iphlen, 1);
@@ -157,6 +165,12 @@ sctp_skip_csum:
*/
stcb = sctp_findassociation_addr(m, iphlen, offset - sizeof(*ch),
sh, ch, &in6p, &net, vrf_id);
+ if ((net) && (port)) {
+ if (net->port == 0) {
+ sctp_pathmtu_adjustment(in6p, stcb, net, net->mtu - sizeof(struct udphdr));
+ }
+ net->port = port;
+ }
/* in6p's ref-count increased */
if (in6p == NULL) {
struct sctp_init_chunk *init_chk, chunk_buf;
@@ -177,14 +191,14 @@ sctp_skip_csum:
sh->v_tag = 0;
}
if (ch->chunk_type == SCTP_SHUTDOWN_ACK) {
- sctp_send_shutdown_complete2(m, iphlen, sh, vrf_id, 0);
+ sctp_send_shutdown_complete2(m, iphlen, sh, vrf_id, port);
goto bad;
}
if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) {
goto bad;
}
if (ch->chunk_type != SCTP_ABORT_ASSOCIATION)
- sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, 0);
+ sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port);
goto bad;
} else if (stcb == NULL) {
refcount_up = 1;
@@ -212,7 +226,7 @@ sctp_skip_csum:
/* sa_ignore NO_NULL_CHK */
sctp_common_input_processing(&m, iphlen, offset, length, sh, ch,
- in6p, stcb, net, ecn_bits, vrf_id, 0);
+ in6p, stcb, net, ecn_bits, vrf_id, port);
/* inp's ref-count reduced && stcb unlocked */
/* XXX this stuff below gets moved to appropriate parts later... */
if (m)
@@ -384,7 +398,7 @@ sctp6_notify(struct sctp_inpcb *inp,
* PF state.
*/
/* Stop any running T3 timers here? */
- if (sctp_cmt_on_off && sctp_cmt_pf) {
+ if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) && SCTP_BASE_SYSCTL(sctp_cmt_pf)) {
net->dest_state &= ~SCTP_ADDR_PF;
SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
net);
@@ -644,7 +658,7 @@ sctp6_attach(struct socket *so, int proto, struct thread *p)
return EINVAL;
}
if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
- error = SCTP_SORESERVE(so, sctp_sendspace, sctp_recvspace);
+ error = SCTP_SORESERVE(so, SCTP_BASE_SYSCTL(sctp_sendspace), SCTP_BASE_SYSCTL(sctp_recvspace));
if (error)
return error;
}
OpenPOWER on IntegriCloud