X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3903760236c30e3b5ace7a4eefac3a269d68957c..5ba3f43ea354af8ad55bea84372a2bc834d8757c:/bsd/netinet6/raw_ip6.c?ds=sidebyside diff --git a/bsd/netinet6/raw_ip6.c b/bsd/netinet6/raw_ip6.c index 4fff23a3c..d7c6f689f 100644 --- a/bsd/netinet6/raw_ip6.c +++ b/bsd/netinet6/raw_ip6.c @@ -102,6 +102,7 @@ #include #include +#include #include #include @@ -282,7 +283,8 @@ void rip6_ctlinput( int cmd, struct sockaddr *sa, - void *d) + void *d, + __unused struct ifnet *ifp) { struct ip6_hdr *ip6; struct mbuf *m; @@ -667,8 +669,9 @@ rip6_output( * the route interface index used by IP. */ if (rt != NULL && - (outif = rt->rt_ifp) != in6p->in6p_last_outifp) + (outif = rt->rt_ifp) != in6p->in6p_last_outifp) { in6p->in6p_last_outifp = outif; + } } else { ROUTE_RELEASE(&in6p->in6p_route); } @@ -886,6 +889,7 @@ rip6_bind(struct socket *so, struct sockaddr *nam, struct proc *p) } inp->in6p_laddr = sin6.sin6_addr; inp->in6p_last_outifp = outif; + return (0); } @@ -915,6 +919,12 @@ rip6_connect(struct socket *so, struct sockaddr *nam, __unused struct proc *p) return EADDRNOTAVAIL; if (addr->sin6_family != AF_INET6) return EAFNOSUPPORT; + + if (!(so->so_flags1 & SOF1_CONNECT_COUNTED)) { + so->so_flags1 |= SOF1_CONNECT_COUNTED; + INC_ATOMIC_INT64_LIM(net_api_stats.nas_socket_inet6_dgram_connected); + } + #if ENABLE_DEFAULT_SCOPE if (addr->sin6_scope_id == 0) { /* not change if specified */ /* avoid overwrites */ @@ -941,6 +951,7 @@ rip6_connect(struct socket *so, struct sockaddr *nam, __unused struct proc *p) if (inp->in6p_route.ro_rt != NULL) outif = inp->in6p_route.ro_rt->rt_ifp; inp->in6p_last_outifp = outif; + soisconnected(so); return 0; }