CVS commit: src/external/gpl3/binutils/dist/ld/emulparams

2016-10-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct  6 20:29:33 UTC 2016

Modified Files:
src/external/gpl3/binutils/dist/ld/emulparams: elf32ppc_nbsd.sh

Log Message:
fix ppc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh
diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh:1.1 src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh:1.2
--- src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh:1.1	Thu Mar  6 23:13:46 2014
+++ src/external/gpl3/binutils/dist/ld/emulparams/elf32ppc_nbsd.sh	Thu Oct  6 16:29:33 2016
@@ -2,6 +2,9 @@
 
 case "$target" in
   powerpc64*-*-netbsd*)
-LIB_PATH='=/usr/lib/powerpc'
+case "$EMULATION_NAME" in
+*32*)
+  LIB_PATH='=/usr/lib/powerpc'
 ;;
+esac
 esac



CVS commit: src/tests/lib/librumpclient

2016-10-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct  6 20:14:11 UTC 2016

Modified Files:
src/tests/lib/librumpclient: Makefile

Log Message:
revert, fixing the real cause.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/librumpclient/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumpclient/Makefile
diff -u src/tests/lib/librumpclient/Makefile:1.8 src/tests/lib/librumpclient/Makefile:1.9
--- src/tests/lib/librumpclient/Makefile:1.8	Thu Oct  6 15:52:36 2016
+++ src/tests/lib/librumpclient/Makefile	Thu Oct  6 16:14:11 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2016/10/06 19:52:36 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2016/10/06 20:14:11 christos Exp $
 #
 
 .include 
@@ -19,8 +19,6 @@ CPPFLAGS+=	-D_KERNTYPES
 LDADD+= -lrumpclient
 LDADD+= -lrumpdev
 LDADD+= -lrumpvfs
-LDADD+= -lrump
-LDADD+= -lrumpuser
-LDADD+= -lpthread
+LDADD.h_execthr= -lpthread
 
 .include 



CVS commit: src/tests/lib/librumpclient

2016-10-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct  6 19:52:36 UTC 2016

Modified Files:
src/tests/lib/librumpclient: Makefile

Log Message:
Add more indirect library dependencies


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/librumpclient/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumpclient/Makefile
diff -u src/tests/lib/librumpclient/Makefile:1.7 src/tests/lib/librumpclient/Makefile:1.8
--- src/tests/lib/librumpclient/Makefile:1.7	Wed Aug 10 17:10:18 2016
+++ src/tests/lib/librumpclient/Makefile	Thu Oct  6 15:52:36 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2016/08/10 21:10:18 kre Exp $
+#	$NetBSD: Makefile,v 1.8 2016/10/06 19:52:36 christos Exp $
 #
 
 .include 
@@ -19,6 +19,8 @@ CPPFLAGS+=	-D_KERNTYPES
 LDADD+= -lrumpclient
 LDADD+= -lrumpdev
 LDADD+= -lrumpvfs
-LDADD.h_execthr= -lpthread
+LDADD+= -lrump
+LDADD+= -lrumpuser
+LDADD+= -lpthread
 
 .include 



CVS commit: src/usr.sbin/ifwatchd

2016-10-06 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Oct  6 11:13:57 UTC 2016

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Inhibit initial up should only apply at program start, not for hot plugged 
interfaces while it's running.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/ifwatchd/ifwatchd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.39 src/usr.sbin/ifwatchd/ifwatchd.c:1.40
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.39	Thu Oct  6 11:08:55 2016
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Thu Oct  6 11:13:57 2016
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.39 2016/10/06 11:08:55 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.40 2016/10/06 11:13:57 roy Exp $	*/
 #include 
-__RCSID("$NetBSD: ifwatchd.c,v 1.39 2016/10/06 11:08:55 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.40 2016/10/06 11:13:57 roy Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -470,8 +470,7 @@ check_carrier(const struct if_msghdr *if
 	 * inhibit_initial is not set
 	 */
 	carrier_status = ifm->ifm_data.ifi_link_state;
-	if ((carrier_status != p->last_carrier_status) ||
-	((p->last_carrier_status == -1) && !inhibit_initial)) {
+	if (carrier_status != p->last_carrier_status) {
 		switch (carrier_status) {
 		case LINK_STATE_UP:
 			ev = CARRIER;
@@ -506,7 +505,7 @@ check_announce(const struct if_announcem
 			break;
 		case IFAN_DEPARTURE:
 			p->index = -1;
-			p->last_carrier_status = LINK_STATE_UNKNOWN;
+			p->last_carrier_status = -1;
 			invoke_script(p->ifname, DEPARTURE, NULL, NULL);
 			break;
 		default:



CVS commit: src/usr.sbin/ifwatchd

2016-10-06 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Oct  6 11:08:56 UTC 2016

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Remove rescan_interfaces as the interface announcement message
contains the interface index.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/ifwatchd/ifwatchd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.38 src/usr.sbin/ifwatchd/ifwatchd.c:1.39
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.38	Thu Oct  6 10:33:05 2016
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Thu Oct  6 11:08:55 2016
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.39 2016/10/06 11:08:55 roy Exp $	*/
 #include 
-__RCSID("$NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.39 2016/10/06 11:08:55 roy Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,6 @@ static void invoke_script(const char *if
 static void list_interfaces(const char *ifnames);
 static void check_announce(const struct if_announcemsghdr *ifan);
 static void check_carrier(const struct if_msghdr *ifm);
-static void rescan_interfaces(void);
 static void free_interfaces(void);
 static struct interface_data * find_interface(int index);
 static void run_initial_ups(void);
@@ -257,7 +256,6 @@ dispatch(const void *msg, size_t len)
 		check_addrs(msg);
 		break;
 	case RTM_IFANNOUNCE:
-		rescan_interfaces();
 		check_announce(msg);
 		break;
 	case RTM_IFINFO:
@@ -503,9 +501,12 @@ check_announce(const struct if_announcem
 
 		switch (ifan->ifan_what) {
 		case IFAN_ARRIVAL:
+			p->index = ifan->ifan_index;
 			invoke_script(p->ifname, ARRIVAL, NULL, NULL);
 			break;
 		case IFAN_DEPARTURE:
+			p->index = -1;
+			p->last_carrier_status = LINK_STATE_UNKNOWN;
 			invoke_script(p->ifname, DEPARTURE, NULL, NULL);
 			break;
 		default:
@@ -519,19 +520,6 @@ check_announce(const struct if_announcem
 }
 
 static void
-rescan_interfaces(void)
-{
-	struct interface_data * p;
-
-	SLIST_FOREACH(p, , next) {
-		p->index = if_nametoindex(p->ifname);
-		if (verbose)
-			printf("interface \"%s\" has index %d\n", p->ifname,
-			p->index);
-	}
-}
-
-static void
 free_interfaces(void)
 {
 	struct interface_data * p;



CVS commit: src/usr.sbin/ifwatchd

2016-10-06 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Oct  6 10:33:05 UTC 2016

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Simplify logic - invoke script when address is added and ready or
when removed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/ifwatchd/ifwatchd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.37 src/usr.sbin/ifwatchd/ifwatchd.c:1.38
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.37	Thu Oct  6 10:30:31 2016
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Thu Oct  6 10:33:05 2016
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $	*/
 #include 
- __RCSID("$NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.38 2016/10/06 10:33:05 roy Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -338,14 +338,7 @@ check_addrs(const struct ifa_msghdr *ifa
 	if (ifa != NULL && ifd != NULL) {
 		ev = ifam->ifam_type == RTM_DELADDR ? DOWN : UP;
 		aflag = check_addrflags(ifa->sa_family, ifam->ifam_addrflags);
-		if (ev == UP) {
-			if (aflag == NOTREADY)
-return;
-			if (aflag == DETACHED)
-return;		/* XXX set ev to DOWN? */
-		}
-		if ((ev == UP && aflag == READY) ||
-		(ev == DOWN && aflag == DETACHED /* XXX why DETACHED? */))
+		if ((ev == UP && aflag == READY) || ev == DOWN)
 			invoke_script(ifd->ifname, ev, ifa, brd);
 	}
 }



CVS commit: src/usr.sbin/ifwatchd

2016-10-06 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Oct  6 10:30:31 UTC 2016

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
We already know the interface name, so don't bother calling if_indextoname
to work it out again.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/ifwatchd/ifwatchd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.36 src/usr.sbin/ifwatchd/ifwatchd.c:1.37
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.36	Thu Sep 29 15:25:28 2016
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Thu Oct  6 10:30:31 2016
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.36 2016/09/29 15:25:28 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $	*/
 #include 
- __RCSID("$NetBSD: ifwatchd.c,v 1.36 2016/09/29 15:25:28 roy Exp $");
+ __RCSID("$NetBSD: ifwatchd.c,v 1.37 2016/10/06 10:30:31 roy Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -63,8 +63,8 @@ __dead static void usage(void);
 static void dispatch(const void *, size_t);
 static enum addrflag check_addrflags(int af, int addrflags);
 static void check_addrs(const struct ifa_msghdr *ifam);
-static void invoke_script(const struct sockaddr *sa, const struct sockaddr *dst,
-enum event ev, int ifindex, const char *ifname_hint);
+static void invoke_script(const char *ifname, enum event ev,
+const struct sockaddr *sa, const struct sockaddr *dst);
 static void list_interfaces(const char *ifnames);
 static void check_announce(const struct if_announcemsghdr *ifan);
 static void check_carrier(const struct if_msghdr *ifm);
@@ -346,19 +346,26 @@ check_addrs(const struct ifa_msghdr *ifa
 		}
 		if ((ev == UP && aflag == READY) ||
 		(ev == DOWN && aflag == DETACHED /* XXX why DETACHED? */))
-			invoke_script(ifa, brd, ev, ifd->index, ifd->ifname);
+			invoke_script(ifd->ifname, ev, ifa, brd);
 	}
 }
 
 static void
-invoke_script(const struct sockaddr *sa, const struct sockaddr *dest,
-enum event ev, int ifindex, const char *ifname_hint)
+invoke_script(const char *ifname, enum event ev,
+const struct sockaddr *sa, const struct sockaddr *dest)
 {
-	char addr[NI_MAXHOST], daddr[NI_MAXHOST], ifname_buf[IFNAMSIZ];
-	const char * volatile ifname;
+	char addr[NI_MAXHOST], daddr[NI_MAXHOST];
 	const char *script;
 	int status;
 
+	if (ifname == NULL)
+		return;
+
+	script = *scripts[ev];
+	if (script == NULL)
+		return;
+
+	addr[0] = daddr[0] = 0;
 	if (sa != NULL) {
 		if (sa->sa_len == 0) {
 			fprintf(stderr,
@@ -384,15 +391,7 @@ invoke_script(const struct sockaddr *sa,
 return;
 		}
 		}
-	}
 
-	addr[0] = daddr[0] = 0;
-	ifname = if_indextoname(ifindex, ifname_buf);
-	ifname = ifname ? ifname : ifname_hint;
-	if (ifname == NULL)
-		return;
-
-	if (sa != NULL) {
 		if (getnameinfo(sa, sa->sa_len, addr, sizeof addr, NULL, 0,
 		NI_NUMERICHOST)) {
 			if (verbose)
@@ -400,6 +399,7 @@ invoke_script(const struct sockaddr *sa,
 			return;	/* this address can not be handled */
 		}
 	}
+
 	if (dest != NULL) {
 		if (getnameinfo(dest, dest->sa_len, daddr, sizeof daddr,
 		NULL, 0, NI_NUMERICHOST)) {
@@ -409,9 +409,6 @@ invoke_script(const struct sockaddr *sa,
 		}
 	}
 
-	script = *scripts[ev];
-	if (script == NULL) return;
-
 	if (verbose)
 		(void) printf("calling: %s %s %s %s %s %s\n",
 		script, ifname, DummyTTY, DummySpeed, addr, daddr);
@@ -496,7 +493,7 @@ check_carrier(const struct if_msghdr *if
 printf("unknown link status ignored\n");
 			return;
 		}
-		invoke_script(NULL, NULL, ev, ifm->ifm_index, p->ifname);
+		invoke_script(p->ifname, ev, NULL, NULL);
 		p->last_carrier_status = carrier_status;
 	}
 }
@@ -513,12 +510,10 @@ check_announce(const struct if_announcem
 
 		switch (ifan->ifan_what) {
 		case IFAN_ARRIVAL:
-			invoke_script(NULL, NULL, ARRIVAL, p->index,
-			NULL);
+			invoke_script(p->ifname, ARRIVAL, NULL, NULL);
 			break;
 		case IFAN_DEPARTURE:
-			invoke_script(NULL, NULL, DEPARTURE, p->index,
-			p->ifname);
+			invoke_script(p->ifname, DEPARTURE, NULL, NULL);
 			break;
 		default:
 			if (verbose)
@@ -592,8 +587,7 @@ run_initial_ups(void)
 
 		ifa = p->ifa_addr;
 		if (ifa != NULL && ifa->sa_family == AF_LINK)
-			invoke_script(NULL, NULL, ARRIVAL, ifd->index,
-			NULL);
+			invoke_script(ifd->ifname, ARRIVAL, NULL, NULL);
 
 		if ((p->ifa_flags & IFF_UP) == 0)
 			continue;
@@ -608,8 +602,7 @@ run_initial_ups(void)
 			if (ioctl(s, SIOCGIFMEDIA, ) != -1
 			&& (ifmr.ifm_status & IFM_AVALID)
 			&& (ifmr.ifm_status & IFM_ACTIVE)) {
-invoke_script(NULL, NULL, CARRIER,
-ifd->index, ifd->ifname);
+invoke_script(ifd->ifname, CARRIER, NULL, NULL);
 ifd->last_carrier_status =
 LINK_STATE_UP;
 			}
@@ -618,7 +611,7 @@ run_initial_ups(void)
 		aflag = check_addrflags(ifa->sa_family, p->ifa_addrflags);
 		if (aflag !=