Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys SIOCSIFDSTADDR uses struct ifreq instead of struct ifadd...



details:   https://anonhg.NetBSD.org/src/rev/e3d6e52eafe7
branches:  trunk
changeset: 361263:e3d6e52eafe7
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Apr 20 09:56:22 2018 +0000

description:
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.

diffstat:

 sys/net/if_sl.c       |  6 +++---
 sys/net/if_strip.c    |  9 ++++-----
 sys/netinet/in.c      |  6 +++---
 sys/netisdn/i4b_ipr.c |  6 +++---
 4 files changed, 13 insertions(+), 14 deletions(-)

diffs (126 lines):

diff -r 3cd51a435c4a -r e3d6e52eafe7 sys/net/if_sl.c
--- a/sys/net/if_sl.c   Fri Apr 20 06:01:59 2018 +0000
+++ b/sys/net/if_sl.c   Fri Apr 20 09:56:22 2018 +0000
@@ -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 @@
                break;
 
        case SIOCSIFDSTADDR:
-               if (ifa->ifa_addr->sa_family != AF_INET)
+               if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET)
                        error = EAFNOSUPPORT;
                break;
 
diff -r 3cd51a435c4a -r e3d6e52eafe7 sys/net/if_strip.c
--- a/sys/net/if_strip.c        Fri Apr 20 06:01:59 2018 +0000
+++ b/sys/net/if_strip.c        Fri Apr 20 09:56:22 2018 +0000
@@ -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 @@
 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 @@
                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;
diff -r 3cd51a435c4a -r e3d6e52eafe7 sys/netinet/in.c
--- a/sys/netinet/in.c  Fri Apr 20 06:01:59 2018 +0000
+++ b/sys/netinet/in.c  Fri Apr 20 09:56:22 2018 +0000
@@ -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 @@
                        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;
                }
diff -r 3cd51a435c4a -r e3d6e52eafe7 sys/netisdn/i4b_ipr.c
--- a/sys/netisdn/i4b_ipr.c     Fri Apr 20 06:01:59 2018 +0000
+++ b/sys/netisdn/i4b_ipr.c     Fri Apr 20 09:56:22 2018 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index