diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/sctp_input.c | 8 | ||||
-rw-r--r-- | sys/netinet/sctp_output.c | 11 | ||||
-rw-r--r-- | sys/netinet/sctp_pcb.c | 4 | ||||
-rw-r--r-- | sys/netinet/sctp_sysctl.c | 2 | ||||
-rw-r--r-- | sys/netinet/sctp_timer.c | 4 | ||||
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 4 |
6 files changed, 29 insertions, 4 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 2be2b87..c44c388 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -47,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_bsd_addr.h> #include <netinet/sctp_timer.h> #include <netinet/sctp_crc32.h> +#if defined(INET) || defined(INET6) #include <netinet/udp.h> +#endif #include <sys/smp.h> @@ -5603,12 +5605,14 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt calc_check, check, (void *)m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); +#if defined(INET) || defined(INET6) if ((net != NULL) && (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } net->port = port; } +#endif if ((net != NULL) && (use_mflowid != 0)) { net->flowid = mflowid; #ifdef INVARIANTS @@ -5634,12 +5638,14 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt } stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); +#if defined(INET) || defined(INET6) if ((net != NULL) && (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } net->port = port; } +#endif if ((net != NULL) && (use_mflowid != 0)) { net->flowid = mflowid; #ifdef INVARIANTS @@ -5748,12 +5754,14 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt * it changes our INP. */ inp = stcb->sctp_ep; +#if defined(INET) || defined(INET6) if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } net->port = port; } +#endif } } else { /* diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index b2a24e7..161ce6b 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_bsd_addr.h> #include <netinet/sctp_input.h> #include <netinet/sctp_crc32.h> +#if defined(INET) || defined(INET6) #include <netinet/udp.h> +#endif #include <netinet/udp_var.h> #include <machine/in_cksum.h> @@ -10964,13 +10966,14 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, struct mbuf *mout; struct sctphdr *shout; struct sctp_chunkhdr *ch; - struct udphdr *udp; - int len, cause_len, padding_len; #if defined(INET) || defined(INET6) + struct udphdr *udp; int ret; #endif + int len, cause_len, padding_len; + #ifdef INET struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; @@ -11021,9 +11024,11 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, default: break; } +#if defined(INET) || defined(INET6) if (port) { len += sizeof(struct udphdr); } +#endif mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_NOWAIT, 1, MT_DATA); if (mout == NULL) { if (cause) { @@ -11094,6 +11099,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, shout = mtod(mout, struct sctphdr *); break; } +#if defined(INET) || defined(INET6) if (port) { if (htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)) == 0) { sctp_m_freem(mout); @@ -11112,6 +11118,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, } else { udp = NULL; } +#endif shout->src_port = sh->dest_port; shout->dest_port = sh->src_port; shout->checksum = 0; diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 3cee79e..82b1788 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -46,7 +46,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_timer.h> #include <netinet/sctp_bsd_addr.h> #include <netinet/sctp_dtrace_define.h> +#if defined(INET) || defined(INET6) #include <netinet/udp.h> +#endif #ifdef INET6 #include <netinet6/ip6_var.h> #endif @@ -4007,9 +4009,11 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, break; } } +#if defined(INET) || defined(INET6) if (net->port) { net->mtu -= (uint32_t) sizeof(struct udphdr); } +#endif if (from == SCTP_ALLOC_ASOC) { stcb->asoc.smallest_mtu = net->mtu; } diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 6d18b63..99f4653 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); void sctp_init_sysctls() { + printf("sctp_init_sysctls().\n"); SCTP_BASE_SYSCTL(sctp_sendspace) = SCTPCTL_MAXDGRAM_DEFAULT; SCTP_BASE_SYSCTL(sctp_recvspace) = SCTPCTL_RECVSPACE_DEFAULT; SCTP_BASE_SYSCTL(sctp_auto_asconf) = SCTPCTL_AUTOASCONF_DEFAULT; @@ -125,6 +126,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly) = SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT; #if defined(SCTP_DEBUG) SCTP_BASE_SYSCTL(sctp_debug_on) = SCTPCTL_DEBUG_DEFAULT; +printf("debug = %d.\n", SCTP_BASE_SYSCTL(sctp_debug_on)); #endif #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_BASE_SYSCTL(sctp_output_unlocked) = SCTPCTL_OUTPUT_UNLOCKED_DEFAULT; diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 2aef412..30b12ae 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_input.h> #include <netinet/sctp.h> #include <netinet/sctp_uio.h> +#if defined(INET) || defined(INET6) #include <netinet/udp.h> +#endif void @@ -1480,9 +1482,11 @@ sctp_pathmtu_timer(struct sctp_inpcb *inp, } if (net->ro._s_addr) { mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._s_addr.sa, net->ro.ro_rt); +#if defined(INET) || defined(INET6) if (net->port) { mtu -= sizeof(struct udphdr); } +#endif if (mtu > next_mtu) { net->mtu = next_mtu; } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 931e28b..595aca3 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -214,8 +214,6 @@ sctp_notify_mbuf(struct sctp_inpcb *inp, SCTP_TCB_UNLOCK(stcb); } -#endif - void sctp_notify(struct sctp_inpcb *inp, struct ip *ip, @@ -302,6 +300,8 @@ sctp_notify(struct sctp_inpcb *inp, } } +#endif + #ifdef INET void sctp_ctlinput(cmd, sa, vip) |