/*
- * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
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;
/* 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);