X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b7266188b87f3620ec3f9f717e57194a7dd989fe..d1ecb069dfe24481e4a83f44cb5217a2b06746d7:/bsd/netinet6/raw_ip6.c diff --git a/bsd/netinet6/raw_ip6.c b/bsd/netinet6/raw_ip6.c index d4a32b927..79eda381e 100644 --- a/bsd/netinet6/raw_ip6.c +++ b/bsd/netinet6/raw_ip6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Apple Inc. All rights reserved. + * Copyright (c) 2009 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -487,8 +487,28 @@ rip6_output( in6p->in6p_route.ro_rt = NULL; } +#if PKT_PRIORITY + if (soisbackground(so)) + m_prio_background(m); +#endif /* PKT_PRIORITY */ + error = ip6_output(m, optp, &in6p->in6p_route, 0, in6p->in6p_moptions, &oifp, 0); + +#if IFNET_ROUTE_REFCNT + /* + * Always discard the cached route for unconnected socket + * or if it is a multicast route. + */ + if (in6p->in6p_route.ro_rt != NULL && + ((in6p->in6p_route.ro_rt->rt_flags & RTF_MULTICAST) || + in6p->in6p_socket == NULL || + in6p->in6p_socket->so_state != SS_ISCONNECTED)) { + rtfree(in6p->in6p_route.ro_rt); + in6p->in6p_route.ro_rt = NULL; + } +#endif /* IFNET_ROUTE_REFCNT */ + if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { if (oifp) icmp6_ifoutstat_inc(oifp, type, code);