summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-07-03 16:41:30 -0300
committerRenato Botelho <renato@netgate.com>2017-07-03 16:41:30 -0300
commitb91e8edec6ef973706ceba5985379a0aded6a5aa (patch)
tree92c1d3976fd61f447f3e62225141c02b6ef4c320 /sys/netinet6
parent5fa580e9c45b6668f134701651fa17cad722750e (diff)
parentff3a058c4f832f66c1a779cf9bd05f758ad411d8 (diff)
downloadFreeBSD-src-b91e8edec6ef973706ceba5985379a0aded6a5aa.zip
FreeBSD-src-b91e8edec6ef973706ceba5985379a0aded6a5aa.tar.gz
Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_5
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c1
-rw-r--r--sys/netinet6/sctp6_usrreq.c10
-rw-r--r--sys/netinet6/sctp6_var.h2
-rw-r--r--sys/netinet6/udp6_usrreq.c9
4 files changed, 16 insertions, 6 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 962fee3..551f174 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -324,6 +324,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
uint32_t id;
if (inp != NULL) {
+ INP_LOCK_ASSERT(inp);
M_SETFIB(m, inp->inp_inc.inc_fibnum);
if ((flags & IP_NODEFAULTFLOWID) == 0) {
/* unconditionally set flowid */
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index c2a45a6..054b4c1 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -183,7 +183,7 @@ sctp6_notify(struct sctp_inpcb *inp,
struct sctp_nets *net,
uint8_t icmp6_type,
uint8_t icmp6_code,
- uint16_t next_mtu)
+ uint32_t next_mtu)
{
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
@@ -237,11 +237,11 @@ sctp6_notify(struct sctp_inpcb *inp,
timer_stopped = 0;
}
/* Update the path MTU. */
+ if (net->port) {
+ next_mtu -= sizeof(struct udphdr);
+ }
if (net->mtu > next_mtu) {
net->mtu = next_mtu;
- if (net->port) {
- net->mtu -= sizeof(struct udphdr);
- }
}
/* Update the association MTU */
if (stcb->asoc.smallest_mtu > next_mtu) {
@@ -383,7 +383,7 @@ sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d)
sctp6_notify(inp, stcb, net,
ip6cp->ip6c_icmp6->icmp6_type,
ip6cp->ip6c_icmp6->icmp6_code,
- (uint16_t)ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
+ ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
} else {
if ((stcb == NULL) && (inp != NULL)) {
/* reduce inp's ref-count */
diff --git a/sys/netinet6/sctp6_var.h b/sys/netinet6/sctp6_var.h
index 232fee1..a24ceba 100644
--- a/sys/netinet6/sctp6_var.h
+++ b/sys/netinet6/sctp6_var.h
@@ -49,6 +49,6 @@ sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
void sctp6_ctlinput(int, struct sockaddr *, void *);
void
sctp6_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *,
- uint8_t, uint8_t, uint16_t);
+ uint8_t, uint8_t, uint32_t);
#endif
#endif
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index cc10527..56faf5a 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -1104,6 +1104,10 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
error = EINVAL;
goto out;
}
+ if ((inp->inp_vflag & INP_IPV4) == 0) {
+ error = EAFNOSUPPORT;
+ goto out;
+ }
if (inp->inp_faddr.s_addr != INADDR_ANY) {
error = EISCONN;
goto out;
@@ -1121,6 +1125,11 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
if (error == 0)
soisconnected(so);
goto out;
+ } else {
+ if ((inp->inp_vflag & INP_IPV6) == 0) {
+ error = EAFNOSUPPORT;
+ goto out;
+ }
}
#endif
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
OpenPOWER on IntegriCloud