Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig don't allow destination addresses to be set fo...



details:   https://anonhg.NetBSD.org/src/rev/051664513d1f
branches:  trunk
changeset: 474921:051664513d1f
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Mon Jul 26 11:56:55 1999 +0000

description:
don't allow destination addresses to be set for non-Point-to-point interfaces

diffstat:

 sbin/ifconfig/ifconfig.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 9575c9d3239d -r 051664513d1f sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c  Mon Jul 26 08:07:30 1999 +0000
+++ b/sbin/ifconfig/ifconfig.c  Mon Jul 26 11:56:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifconfig.c,v 1.54 1999/07/03 17:31:15 sommerfeld Exp $ */
+/*     $NetBSD: ifconfig.c,v 1.55 1999/07/26 11:56:55 darrenr Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 #if 0
 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
 #else
-__RCSID("$NetBSD: ifconfig.c,v 1.54 1999/07/03 17:31:15 sommerfeld Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.55 1999/07/26 11:56:55 darrenr Exp $");
 #endif
 #endif /* not lint */
 
@@ -478,8 +478,12 @@
                for (p = cmds; p->c_name; p++)
                        if (strcmp(argv[0], p->c_name) == 0)
                                break;
-               if (p->c_name == 0 && setaddr)
+               if (p->c_name == 0 && setaddr) {
+                       if (!(flags & IFF_POINTOPOINT)) {
+                               errx(1, "Can't set destination address %s\n",
+                                    "on non-point-to-point link");
                        p++;    /* got src, do dst */
+               }
                if (p->c_func) {
                        if (p->c_parameter == NEXTARG) {
                                if (argc < 2)



Home | Main Index | Thread Index | Old Index