Provide compat layer for OSIOCAIFADDR.
This commit is contained in:
parent
5864b3a586
commit
77b89ad837
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257761
@ -412,6 +412,14 @@ struct ifaliasreq {
|
||||
int ifra_vhid;
|
||||
};
|
||||
|
||||
/* 9.x compat */
|
||||
struct oifaliasreq {
|
||||
char ifra_name[IFNAMSIZ];
|
||||
struct sockaddr ifra_addr;
|
||||
struct sockaddr ifra_broadaddr;
|
||||
struct sockaddr ifra_mask;
|
||||
};
|
||||
|
||||
struct ifmediareq {
|
||||
char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
|
||||
int ifm_current; /* current media options */
|
||||
|
@ -72,7 +72,7 @@ static int in_mask2len(struct in_addr *);
|
||||
static void in_len2mask(struct in_addr *, int);
|
||||
static int in_lifaddr_ioctl(struct socket *, u_long, caddr_t,
|
||||
struct ifnet *, struct thread *);
|
||||
static int in_aifaddr_ioctl(caddr_t, struct ifnet *, struct thread *);
|
||||
static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *);
|
||||
static int in_difaddr_ioctl(caddr_t, struct ifnet *, struct thread *);
|
||||
|
||||
static void in_socktrim(struct sockaddr_in *);
|
||||
@ -259,9 +259,10 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
|
||||
error = in_difaddr_ioctl(data, ifp, td);
|
||||
sx_xunlock(&in_control_sx);
|
||||
return (error);
|
||||
case OSIOCAIFADDR: /* 9.x compat */
|
||||
case SIOCAIFADDR:
|
||||
sx_xlock(&in_control_sx);
|
||||
error = in_aifaddr_ioctl(data, ifp, td);
|
||||
error = in_aifaddr_ioctl(cmd, data, ifp, td);
|
||||
sx_xunlock(&in_control_sx);
|
||||
return (error);
|
||||
case SIOCALIFADDR:
|
||||
@ -335,14 +336,14 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
|
||||
}
|
||||
|
||||
static int
|
||||
in_aifaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread *td)
|
||||
in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td)
|
||||
{
|
||||
const struct in_aliasreq *ifra = (struct in_aliasreq *)data;
|
||||
const struct sockaddr_in *addr = &ifra->ifra_addr;
|
||||
const struct sockaddr_in *broadaddr = &ifra->ifra_broadaddr;
|
||||
const struct sockaddr_in *mask = &ifra->ifra_mask;
|
||||
const struct sockaddr_in *dstaddr = &ifra->ifra_dstaddr;
|
||||
const int vhid = ifra->ifra_vhid;
|
||||
const int vhid = (cmd == SIOCAIFADDR) ? ifra->ifra_vhid : 0;
|
||||
struct ifaddr *ifa;
|
||||
struct in_ifaddr *ia;
|
||||
bool iaIsFirst;
|
||||
|
@ -68,7 +68,7 @@
|
||||
#define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */
|
||||
#define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */
|
||||
#define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */
|
||||
/* OSIOCAIFADDR _IOW('i', 26, struct oifaliasreq) FreeBSD 9.x */
|
||||
#define OSIOCAIFADDR _IOW('i', 26, struct oifaliasreq) /* FreeBSD 9.x */
|
||||
#define SIOCALIFADDR _IOW('i', 27, struct if_laddrreq) /* add IF addr */
|
||||
#define SIOCGLIFADDR _IOWR('i', 28, struct if_laddrreq) /* get IF addr */
|
||||
#define SIOCDLIFADDR _IOW('i', 29, struct if_laddrreq) /* delete IF addr */
|
||||
|
Loading…
Reference in New Issue
Block a user