X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..060df5ea7c632b1ac8cc8aac1fb59758165c2084:/bsd/netinet/ip_divert.c diff --git a/bsd/netinet/ip_divert.c b/bsd/netinet/ip_divert.c index 815e39266..e3c771e6d 100644 --- a/bsd/netinet/ip_divert.c +++ b/bsd/netinet/ip_divert.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * Copyright (c) 2000-2010 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -314,10 +314,17 @@ div_output(struct socket *so, struct mbuf *m, struct sockaddr *addr, struct ip *const ip = mtod(m, struct ip *); struct sockaddr_in *sin = (struct sockaddr_in *)addr; int error = 0; +#if PKT_PRIORITY + mbuf_traffic_class_t mtc = MBUF_TC_NONE; +#endif /* PKT_PRIORITY */ - if (control) - m_freem(control); /* XXX */ + if (control != NULL) { +#if PKT_PRIORITY + mtc = mbuf_traffic_class_from_control(control); +#endif /* PKT_PRIORITY */ + m_freem(control); /* XXX */ + } /* Loopback avoidance and state recovery */ if (sin) { struct m_tag *mtag; @@ -375,6 +382,10 @@ div_output(struct socket *so, struct mbuf *m, struct sockaddr *addr, /* Copy the cached route and take an extra reference */ inp_route_copyout(inp, &ro); +#if PKT_PRIORITY + set_traffic_class(m, so, mtc); +#endif /* PKT_PRIORITY */ + socket_unlock(so, 0); #if CONFIG_MACF_NET mac_mbuf_label_associate_inpcb(inp, m);