Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Fix sys/netinet/in.c:r1.229 problem...



details:   https://anonhg.NetBSD.org/src/rev/0a3462528a64
branches:  trunk
changeset: 318445:0a3462528a64
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Tue Apr 24 01:32:30 2018 +0000
description:
Fix sys/netinet/in.c:r1.229 problem. I have missed FALLTHROUGH, sorry.

diffstat:

 sys/netinet/in.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r af6ad41b9658 -r 0a3462528a64 sys/netinet/in.c
--- a/sys/netinet/in.c  Mon Apr 23 22:53:04 2018 +0000
+++ b/sys/netinet/in.c  Tue Apr 24 01:32:30 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.229 2018/04/20 09:56:22 knakahara Exp $       */
+/*     $NetBSD: in.c,v 1.230 2018/04/24 01:32:30 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.229 2018/04/20 09:56:22 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.230 2018/04/24 01:32:30 knakahara Exp $");
 
 #include "arp.h"
 
@@ -479,9 +479,14 @@
                } else if (in_hosteq(ia->ia_addr.sin_addr,
                           ifra->ifra_addr.sin_addr))
                        hostIsNew = 0;
+               if (ifra->ifra_addr.sin_family != AF_INET) {
+                       error = EAFNOSUPPORT;
+                       goto out;
+               }
                /* FALLTHROUGH */
        case SIOCSIFDSTADDR:
-               if (ifreq_getaddr(cmd, ifr)->sa_family != AF_INET) {
+               if (cmd == SIOCSIFDSTADDR &&
+                   ifreq_getaddr(cmd, ifr)->sa_family != AF_INET) {
                        error = EAFNOSUPPORT;
                        goto out;
                }



Home | Main Index | Thread Index | Old Index