SIOCSIFDSTADDR uses struct ifreq instead of struct ifaddr or struct in_aliasreq.

SIOCSIFDSTADDR is not used by base package commands...

I checked sys/net*/* only.
This commit is contained in:
knakahara 2018-04-20 09:56:22 +00:00
parent 6a7684ef24
commit fdd8807341
4 changed files with 13 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.128 2017/04/13 00:47:33 maya Exp $ */
/* $NetBSD: if_sl.c,v 1.129 2018/04/20 09:56:22 knakahara Exp $ */
/*
* Copyright (c) 1987, 1989, 1992, 1993
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.128 2017/04/13 00:47:33 maya Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.129 2018/04/20 09:56:22 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -992,7 +992,7 @@ slioctl(struct ifnet *ifp, u_long cmd, void *data)
break;
case SIOCSIFDSTADDR:
if (ifa->ifa_addr->sa_family != AF_INET)
if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET)
error = EAFNOSUPPORT;
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_strip.c,v 1.108 2017/04/13 00:47:33 maya Exp $ */
/* $NetBSD: if_strip.c,v 1.109 2018/04/20 09:56:22 knakahara Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
/*
@ -87,7 +87,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.108 2017/04/13 00:47:33 maya Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.109 2018/04/20 09:56:22 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1268,7 +1268,7 @@ int
stripioctl(struct ifnet *ifp, u_long cmd, void *data)
{
struct ifaddr *ifa = (struct ifaddr *)data;
struct ifreq *ifr;
struct ifreq *ifr = (struct ifreq *)data;;
int s, error = 0;
s = splnet();
@ -1283,13 +1283,12 @@ stripioctl(struct ifnet *ifp, u_long cmd, void *data)
break;
case SIOCSIFDSTADDR:
if (ifa->ifa_addr->sa_family != AF_INET)
if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET)
error = EAFNOSUPPORT;
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
ifr = (struct ifreq *)data;
if (ifr == 0) {
error = EAFNOSUPPORT; /* XXX */
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.228 2018/04/08 13:52:22 christos Exp $ */
/* $NetBSD: in.c,v 1.229 2018/04/20 09:56:22 knakahara Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.228 2018/04/08 13:52:22 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.229 2018/04/20 09:56:22 knakahara Exp $");
#include "arp.h"
@ -481,7 +481,7 @@ in_control0(struct socket *so, u_long cmd, void *data, struct ifnet *ifp)
hostIsNew = 0;
/* FALLTHROUGH */
case SIOCSIFDSTADDR:
if (ifra->ifra_addr.sin_family != AF_INET) {
if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET) {
error = EAFNOSUPPORT;
goto out;
}

View File

@ -27,7 +27,7 @@
* i4b_ipr.c - isdn4bsd IP over raw HDLC ISDN network driver
* ---------------------------------------------------------
*
* $Id: i4b_ipr.c,v 1.42 2017/03/28 08:47:19 ozaki-r Exp $
* $Id: i4b_ipr.c,v 1.43 2018/04/20 09:56:22 knakahara Exp $
*
* $FreeBSD$
*
@ -59,7 +59,7 @@
*---------------------------------------------------------------------------*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.42 2017/03/28 08:47:19 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.43 2018/04/20 09:56:22 knakahara Exp $");
#include "irip.h"
#include "opt_irip.h"
@ -578,7 +578,7 @@ iripioctl(struct ifnet *ifp, u_long cmd, void *data)
case SIOCAIFADDR: /* add interface address */
case SIOCINITIFADDR: /* set interface address */
case SIOCSIFDSTADDR: /* set interface destination address */
if(ifa->ifa_addr->sa_family != AF_INET)
if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET)
error = EAFNOSUPPORT;
else
sc->sc_if.if_flags |= IFF_UP;