From f74580926ebfafec21a3760883df8b5f8905a685 Mon Sep 17 00:00:00 2001 From: reyk Date: Mon, 18 May 2015 13:32:28 +0000 Subject: [PATCH] Move the rdomain from struct ifnet into struct if_data. This way it will be exported to userland with the existing sysctl, getifaddrs() and routing socket (if_msghdr.ifm_data) interfaces that expose if_data. All programs and daemons - Apps - that call the SIOCGIFRDOMAIN ioctl in a getifaddrs() loop or after receiving an interface message on the routing socket can now remove the pointless additional ioctl. In base, that could be: dhclient, isakmpd, dhcpd, dhcrelay, ntpd, ospfd, ripd, ifconfig. No ABI breakage because it uses a previously unused pad field in if_data. OK mpi@ deraadt@ --- sys/net/if.h | 4 ++-- sys/net/if_var.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/if.h b/sys/net/if.h index 20d69d6c4c8..aebcab02d72 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.162 2015/04/10 08:48:24 mpi Exp $ */ +/* $OpenBSD: if.h,v 1.163 2015/05/18 13:32:28 reyk Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -102,7 +102,7 @@ struct if_data { u_char ifi_link_state; /* current link state */ u_int32_t ifi_mtu; /* maximum transmission unit */ u_int32_t ifi_metric; /* routing metric (external only) */ - u_int32_t ifi_pad; + u_int32_t ifi_rdomain; /* routing instance */ u_int64_t ifi_baudrate; /* linespeed */ /* volatile statistics */ u_int64_t ifi_ipackets; /* packets received on interface */ diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 78e7b57926f..8529152ba27 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_var.h,v 1.27 2015/05/15 11:53:06 claudio Exp $ */ +/* $OpenBSD: if_var.h,v 1.28 2015/05/18 13:32:28 reyk Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -152,7 +152,6 @@ struct ifnet { /* and the entries */ int if_xflags; /* extra softnet flags */ struct if_data if_data; /* stats and other data about if */ u_int32_t if_hardmtu; /* maximum MTU device supports */ - u_int if_rdomain; /* routing instance */ char if_description[IFDESCRSIZE]; /* interface description */ u_short if_rtlabelid; /* next route label */ u_int8_t if_priority; @@ -203,6 +202,7 @@ struct ifnet { /* and the entries */ #define if_noproto if_data.ifi_noproto #define if_lastchange if_data.ifi_lastchange #define if_capabilities if_data.ifi_capabilities +#define if_rdomain if_data.ifi_rdomain /* * The ifaddr structure contains information about one address -- 2.20.1