+ lck_mtx_unlock(rt_mtx);
+ }
+}
+
+extern lck_spin_t *dlil_input_lock;
+
+__private_extern__ void
+if_data_internal_to_if_data(
+ const struct if_data_internal *if_data_int,
+ struct if_data *if_data)
+{
+#define COPYFIELD(fld) if_data->fld = if_data_int->fld
+#define COPYFIELD32(fld) if_data->fld = (u_int32_t)(if_data_int->fld)
+ COPYFIELD(ifi_type);
+ COPYFIELD(ifi_typelen);
+ COPYFIELD(ifi_physical);
+ COPYFIELD(ifi_addrlen);
+ COPYFIELD(ifi_hdrlen);
+ COPYFIELD(ifi_recvquota);
+ COPYFIELD(ifi_xmitquota);
+ if_data->ifi_unused1 = 0;
+ COPYFIELD(ifi_mtu);
+ COPYFIELD(ifi_metric);
+ if (if_data_int->ifi_baudrate & 0xFFFFFFFF00000000LL) {
+ if_data->ifi_baudrate = 0xFFFFFFFF;
+ }
+ else {
+ COPYFIELD32(ifi_baudrate);
+ }
+
+ lck_spin_lock(dlil_input_lock);
+ COPYFIELD32(ifi_ipackets);
+ COPYFIELD32(ifi_ierrors);
+ COPYFIELD32(ifi_opackets);
+ COPYFIELD32(ifi_oerrors);
+ COPYFIELD32(ifi_collisions);
+ COPYFIELD32(ifi_ibytes);
+ COPYFIELD32(ifi_obytes);
+ COPYFIELD32(ifi_imcasts);
+ COPYFIELD32(ifi_omcasts);
+ COPYFIELD32(ifi_iqdrops);
+ COPYFIELD32(ifi_noproto);
+ COPYFIELD32(ifi_recvtiming);
+ COPYFIELD32(ifi_xmittiming);
+ COPYFIELD(ifi_lastchange);
+ lck_spin_unlock(dlil_input_lock);
+
+#if IF_LASTCHANGEUPTIME
+ if_data->ifi_lastchange.tv_sec += boottime_sec();
+#endif
+
+ if_data->ifi_unused2 = 0;
+ COPYFIELD(ifi_hwassist);
+ if_data->ifi_reserved1 = 0;
+ if_data->ifi_reserved2 = 0;
+#undef COPYFIELD32
+#undef COPYFIELD
+}
+
+__private_extern__ void
+if_data_internal_to_if_data64(
+ const struct if_data_internal *if_data_int,
+ struct if_data64 *if_data64)
+{
+#define COPYFIELD(fld) if_data64->fld = if_data_int->fld
+ COPYFIELD(ifi_type);
+ COPYFIELD(ifi_typelen);
+ COPYFIELD(ifi_physical);
+ COPYFIELD(ifi_addrlen);
+ COPYFIELD(ifi_hdrlen);
+ COPYFIELD(ifi_recvquota);
+ COPYFIELD(ifi_xmitquota);
+ if_data64->ifi_unused1 = 0;
+ COPYFIELD(ifi_mtu);
+ COPYFIELD(ifi_metric);
+ COPYFIELD(ifi_baudrate);
+
+ lck_spin_lock(dlil_input_lock);
+ COPYFIELD(ifi_ipackets);
+ COPYFIELD(ifi_ierrors);
+ COPYFIELD(ifi_opackets);
+ COPYFIELD(ifi_oerrors);
+ COPYFIELD(ifi_collisions);
+ COPYFIELD(ifi_ibytes);
+ COPYFIELD(ifi_obytes);
+ COPYFIELD(ifi_imcasts);
+ COPYFIELD(ifi_omcasts);
+ COPYFIELD(ifi_iqdrops);
+ COPYFIELD(ifi_noproto);
+ COPYFIELD(ifi_recvtiming);
+ COPYFIELD(ifi_xmittiming);
+ COPYFIELD(ifi_lastchange);
+ lck_spin_unlock(dlil_input_lock);
+
+#if IF_LASTCHANGEUPTIME
+ if_data64->ifi_lastchange.tv_sec += boottime_sec();
+#endif
+
+#undef COPYFIELD