From MAILER-DAEMON Mon Feb 10 18:08:10 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WCzxS-0001Kb-E2
	for mharc-commit-inetutils@gnu.org; Mon, 10 Feb 2014 18:08:10 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39731)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WCzxP-0001Jx-Rj
	for commit-inetutils@gnu.org; Mon, 10 Feb 2014 18:08:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WCzxO-0001IP-CV
	for commit-inetutils@gnu.org; Mon, 10 Feb 2014 18:08:07 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60556)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WCzxO-0001IL-8a
	for commit-inetutils@gnu.org; Mon, 10 Feb 2014 18:08:06 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WCzxN-0000Un-OL
	for commit-inetutils@gnu.org; Mon, 10 Feb 2014 23:08:05 +0000
Date: Mon, 10 Feb 2014 23:08:05 +0000
Message-Id: <E1WCzxN-0000Un-OL@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-3-gaa0bc87
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ae85332551569302e50a58ce64ea18244aa08848
X-Git-Newrev: aa0bc87caab6ddaf73aa1d99a613869b2e5c9450
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Feb 2014 23:08:09 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  aa0bc87caab6ddaf73aa1d99a613869b2e5c9450 (commit)
       via  88bf3877829a3a8e4c9537ebcad42052e9648aa3 (commit)
      from  ae85332551569302e50a58ce64ea18244aa08848 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=aa0bc87caab6ddaf73aa1d99a613869b2e5c9450


commit aa0bc87caab6ddaf73aa1d99a613869b2e5c9450
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Feb 9 21:55:14 2014 +0100

    ftp: Detect one-time passwords.
    
    Follow RFC 2228 when reacting to a
    challange-response password request.

diff --git a/ChangeLog b/ChangeLog
index 1d44a50..bb11459 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-02-09  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftp: Detect one-time passwords.
+	RFC 2228 reserves response code 336 for replies
+	used with challange-response authentication.
+
+	* ftp/cmds.c (user): React to response code 336 within
+	FTP command `USER', print its message, and possibly
+	discard an already supplied password.
+	* ftp/ftp.c (login): Likewise.
+
 2014-02-09  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftpd: Parse commands of RFC 2228.
diff --git a/ftp/cmds.c b/ftp/cmds.c
index 544c0aa..ece6ef5 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -1683,8 +1683,20 @@ user (int argc, char **argv)
   n = command ("USER %s", argv[1]);
   if (n == CONTINUE)
     {
+      /* Is this a case of challenge-response?
+       * RFC 2228 stipulates code 336 for this.
+       * Suppress message in verbose mode, since
+       * it has already been displayed.
+       */
+      if (code == 336 && !verbose)
+	printf ("%s\n", reply_string + strlen ("336 "));
+      /* In addition, any password given on the
+       * command line is irrelevant, so ignore it.
+       */
+      if (argc < 3 || code == 336)
+	argv[2] = getpass ("Password: ");
       if (argc < 3)
-	argv[2] = getpass ("Password: "), argc++;
+	argc++;
       n = command ("PASS %s", argv[2]);
       if (argv[2])
 	memset (argv[2], 0, strlen (argv[2]));
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 1edded4..17ddd28 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -330,8 +330,18 @@ login (char *host)
   n = command ("USER %s", user);
   if (n == CONTINUE)
     {
-      if (pass == NULL)
-	pass = getpass ("Password:");
+      /* Is this a case of challenge-response?
+       * RFC 2228 stipulates code 336 for this.
+       * Suppress the message in verbose mode,
+       * since it has already been displayed.
+       */
+      if (code == 336 && !verbose)
+	printf ("%s\n", reply_string + strlen ("336 "));
+      /* In addition, any password given on the
+       * command line is irrelevant, so ignore it.
+       */
+      if (pass == NULL || code == 336)
+	pass = getpass ("Password: ");
       n = command ("PASS %s", pass);
       if (pass)
 	memset (pass, 0, strlen (pass));
@@ -339,7 +349,7 @@ login (char *host)
   if (n == CONTINUE)
     {
       aflag++;
-      acct = getpass ("Account:");
+      acct = getpass ("Account: ");
       n = command ("ACCT %s", acct);
       if (acct)
 	memset (acct, 0, strlen (acct));

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=88bf3877829a3a8e4c9537ebcad42052e9648aa3


commit 88bf3877829a3a8e4c9537ebcad42052e9648aa3
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Feb 9 00:13:48 2014 +0100

    ftpd: Parse commands in RFC 2228.
    
    Let the parser recognize these security
    extensions, but mark them as unimplemented.

diff --git a/ChangeLog b/ChangeLog
index e8e37c3..1d44a50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-02-09  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ftpd: Parse commands of RFC 2228.
+	Tokens are implemented, but no actions.
+
+	* ftpd/ftpcmd.y (ADAT, AUTH, CCC, CONF, ENC, MIC, PBSZ)
+	(PROT): New tokens.
+	(cmdtab): New entries `ADAT', `AUTH', `CCC', `CONF', `ENC',
+	`MIC', `PBSZ', and `PROT'.  All are marked as unimplemented.
+
 2013-12-23  Alfred M. Szmidt  <ams@gnu.org>
 
 	* doc/inetutils.texi (rsh invocation): Use @item for first entry
diff --git a/ftpd/ftpcmd.y b/ftpd/ftpcmd.y
index cac55ef..440a4e2 100644
--- a/ftpd/ftpcmd.y
+++ b/ftpd/ftpcmd.y
@@ -163,6 +163,9 @@ static void yyerror       (const char *s);
 
 	EPRT	EPSV	LPRT	LPSV
 
+	ADAT	AUTH	CCC	CONF	ENC	MIC
+	PBSZ	PROT
+
 	UMASK	IDLE	CHMOD
 
 	LEXERR
@@ -1382,6 +1385,16 @@ static struct tab cmdtab[] = {
   /* Long addressing in RFC 1639.  Obsoleted in RFC 5797.  */
   { "LPRT", LPRT, ARGS, 1,	"<sp> af,hal,h0..hn,2,p0,p1" },
   { "LPSV", LPSV, ARGS, 1,	"(set server in long passive mode)" },
+  /* Security extensions in RFC 2228.  */
+  { "ADAT", ADAT, OSTR, 0,	"<sp> security-data" },
+  { "AUTH", AUTH, OSTR, 0,	"<sp> mechanism" },
+  { "CCC", CCC, ARGS, 0,	"(clear command channel)" },
+  { "CONF", CONF, OSTR, 0, 	"<sp> confidential-msg" },
+  { "ENC", ENC, OSTR, 0,	"<sp> private-message" },
+  { "MIC", MIC, OSTR, 0,	"<sp> safe-message" },
+  { "PBSZ", PBSZ, OSTR, 0,	"<sp> buf-size" },
+  { "PROT", PROT, OSTR, 0,	"<sp> char" },
+  /* End of list.  */
   { NULL,   0,    0,    0,	NULL }
 };
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog     |   21 +++++++++++++++++++++
 ftp/cmds.c    |   14 +++++++++++++-
 ftp/ftp.c     |   16 +++++++++++++---
 ftpd/ftpcmd.y |   13 +++++++++++++
 4 files changed, 60 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Feb 12 06:31:22 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WDY2E-0001Qp-G2
	for mharc-commit-inetutils@gnu.org; Wed, 12 Feb 2014 06:31:22 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48016)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WDY2B-0001QJ-Hs
	for commit-inetutils@gnu.org; Wed, 12 Feb 2014 06:31:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WDY29-0005WI-J3
	for commit-inetutils@gnu.org; Wed, 12 Feb 2014 06:31:19 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:54901)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WDY29-0005WD-GZ
	for commit-inetutils@gnu.org; Wed, 12 Feb 2014 06:31:17 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WDY28-0003SM-VV
	for commit-inetutils@gnu.org; Wed, 12 Feb 2014 11:31:17 +0000
Date: Wed, 12 Feb 2014 11:31:16 +0000
Message-Id: <E1WDY28-0003SM-VV@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-4-g2cd644b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: aa0bc87caab6ddaf73aa1d99a613869b2e5c9450
X-Git-Newrev: 2cd644b7cbe40992224d8e2ac3577c63e0369fb8
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Feb 2014 11:31:20 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  2cd644b7cbe40992224d8e2ac3577c63e0369fb8 (commit)
      from  aa0bc87caab6ddaf73aa1d99a613869b2e5c9450 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=2cd644b7cbe40992224d8e2ac3577c63e0369fb8


commit 2cd644b7cbe40992224d8e2ac3577c63e0369fb8
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Feb 12 12:26:42 2014 +0100

    ifconfig: Convenience format named `check'.

diff --git a/ChangeLog b/ChangeLog
index bb11459..d6ad8da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2013-02-09  Mats Erik Andersson  <gnu@gisladisker.se>
+2014-02-12  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* ifconfig/options.c (formats): Add format `check'
+	as a synonym for `check-existence'.
+
+2014-02-09  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ftp: Detect one-time passwords.
 	RFC 2228 reserves response code 336 for replies
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 1cc3599..5e7265a 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -185,6 +185,10 @@ struct format formats[] = {
    "${brdaddr?}{ broadcast ${brdaddr}}" "${mtu?}{ ipmtu ${mtu}}${\\n}}"
    "}"
   },
+  {"check",
+   "Shorthand for `check-existence'.",
+   "${format}{check-existence}"
+  },
   /* If interface does not exist, print error message and exit. */
   {"check-existence",
    "If interface does not exist, print error message and exit.",

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    7 ++++++-
 ifconfig/options.c |    4 ++++
 2 files changed, 10 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Feb 14 17:45:42 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WERVu-0006JH-2k
	for mharc-commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:45:42 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37089)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WERVq-0006It-G2
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:45:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WERVo-00050w-KE
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:45:38 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:40326)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WERVo-00050s-D2
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:45:36 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WERVn-00081i-88
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 22:45:35 +0000
Date: Fri, 14 Feb 2014 22:45:35 +0000
Message-Id: <E1WERVn-00081i-88@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-5-g93db34e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 2cd644b7cbe40992224d8e2ac3577c63e0369fb8
X-Git-Newrev: 93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Feb 2014 22:45:40 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839 (commit)
      from  2cd644b7cbe40992224d8e2ac3577c63e0369fb8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839


commit 93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Feb 14 23:45:28 2014 +0100

    Further tests of ifconfig.

diff --git a/ChangeLog b/ChangeLog
index d6ad8da..6c010ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-02-14  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	Script for testing of ifconfig's modes.
+	Will document all tested features.
+
+	* tests/ifconfig_modes.sh: New file.  Intentionally
+	without execution bit, and not for automatic testing.
+	* tests/Makefile.am (EXTRA_DIST): Add `ifconfig_modes.sh`.
+
 2014-02-12  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* ifconfig/options.c (formats): Add format `check'
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 50d0e1a..7ab0e53 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -80,7 +80,7 @@ TESTS = localhost waitdaemon $(dist_check_SCRIPTS)
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)
 
-EXTRA_DIST = tools.sh.in
+EXTRA_DIST = tools.sh.in ifconfig_modes.sh
 
 BUILT_SOURCES = tools.sh
 
diff --git a/tests/ifconfig_modes.sh b/tests/ifconfig_modes.sh
new file mode 100644
index 0000000..baa903f
--- /dev/null
+++ b/tests/ifconfig_modes.sh
@@ -0,0 +1,298 @@
+#!/bin/sh
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This file is part of GNU Inetutils.
+#
+# GNU Inetutils is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Inetutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see `http://www.gnu.org/licenses/'.
+
+# Check invocation modes of ifconfig.
+#
+# Written by Mats Erik Andersson.
+
+usage () {
+  cat <<HERE
+Checking of invocation modes for ifconfig.
+Never use this script on production systems,
+or at least, use a system where \$IFACE names
+an interface without all kind of connectivity.
+
+The following environment variables are used:
+
+IFACE		Interface to examine. (mandatory)
+IFCONFIG	Location of executable.  Override
+		manually whenever needed.
+VERBOSE		Verbose commenting, whenever set.
+
+HERE
+}
+
+# Is a usage explanation asked for?
+#
+if test "$1" = "-h" || test "$1" = "--help" || test "$1" = "--usage"; then
+  usage
+  exit 0
+fi
+
+set -u
+
+: ${EXEEXT:=}
+
+silence=
+if test -z "${VERBOSE+set}"; then
+  silence=:
+fi
+
+# Step into `tests/', should the call have
+# been made in source or build root.
+#
+##test -d tests && test -f "tests/${0##*/}" && cd tests/
+test -d tests/ && cd tests/
+
+# Executable under test.
+#
+IFCONFIG=${IFCONFIG:-../ifconfig/ifconfig$EXEEXT}
+
+test -x $IFCONFIG ||
+  { echo >&2 'No executable available for "ifconfig".'; exit 1; }
+
+test -n "${IFACE:+set}" ||
+  { echo >&2 'No interface is assigned to IFACE.';
+    echo >&2; usage >&2; exit 1;
+  }
+
+# Exclude all access to the loopback device.
+if test `expr "$IFACE" : 'lo'` -gt 0; then
+  { echo >&2 'This interface, IFACE="'$IFACE'", might be a loopback device.'
+    echo >&2 'Execution denied!'
+    exit 1
+  }
+fi
+
+# Make sure the interface exists.
+$IFCONFIG --interface=$IFACE --format=check-existence || exit 1
+
+# Two alternate setups.
+#
+# Observe that the broadcast addresses violate the netmask.
+# Some systems will amend them at repeated calls to ifconfig:
+#
+#  1.2.2.255/23 --> 1.2.3.255
+#
+#  2.3.6.255/22 --> 2.3.7.255
+#
+ADDRESS1=1.2.3.4
+ADDRESS1_PATTERN='1\.2\.3\.4'
+ADDRESS2=2.3.4.5
+ADDRESS2_PATTERN='2\.3\.4\.5'
+BRDADDR1=1.2.2.255
+BRDADDR1_PATTERN='1\.2\.2\.255'
+BRDADDR2=2.3.4.255
+BRDADDR2_PATTERN='2\.3\.4\.255'
+NETMASK1=255.255.254.0
+NETMASK1_HEX=0xfffffe00
+NETMASK1_PATTERN='255\.255\.254\.0'
+NETMASK2=255.255.252.0
+NETMASK2_HEX=0xfffffc00
+NETMASK2_PATTERN='255\.255\.252\.0'
+METRIC=7
+MTU=1234
+
+get_gnu_output () {
+  $IFCONFIG --interface=$IFACE --format=gnu
+} # get_gnu_output
+
+make_setup () {
+  # First alternative.
+  ADDRESS=$ADDRESS1
+  ADDRESS_PATTERN=$ADDRESS1_PATTERN
+  BRDADDR=$BRDADDR1
+  BRDADDR_PATTERN=$BRDADDR1_PATTERN
+  NETMASK=$NETMASK1
+  NETMASK_HEX=$NETMASK1_HEX
+  NETMASK_PATTERN=$NETMASK1_PATTERN
+  METRIC=`expr $METRIC + 1`
+  MTU=`expr $MTU + 10`
+
+  # Change setup whenever the address is in use.
+  get_gnu_output |
+    grep "inet address  $ADDRESS1_PATTERN" >/dev/null 2>&1 &&
+      ADDRESS=$ADDRESS2 ADDRESS_PATTERN=$ADDRESS2_PATTERN \
+      BRDADDR=$BRDADDR2 BRDADDR_PATTERN=$BRDADDR2_PATTERN \
+      NETMASK=$NETMASK2 NETMASK_HEX=$NETMASK2_HEX \
+      NETMASK_PATTERN=$NETMASK2_PATTERN \
+      METRIC=`expr $METRIC + 1` MTU=`expr $MTU + 10`
+} # make_setup
+
+make_setup
+
+#
+# Counter of failures.
+#
+STATUS=0
+
+increase_status () {
+  STATUS=`expr $STATUS + 1`
+}
+
+check_output () {
+  echo "$OUTPUT" |
+  grep "$1" > /dev/null || { echo >&2 "$2"; increase_status; }
+}
+
+#
+# Check setting of address, netmask, and broadcast
+# address using switches.
+#
+$silence cat <<-HERE
+	** Set address, netmask, and broadcast using switches:
+	**	--address=$ADDRESS --netmask=$NETMASK --broadcast=$BRDADDR
+	HERE
+
+$IFCONFIG --interface=$IFACE --address=$ADDRESS \
+	  --netmask=$NETMASK --broadcast=$BRDADDR
+OUTPUT=`get_gnu_output`
+
+check_output	"inet address  $ADDRESS_PATTERN" \
+		'Failed to set address with "--address".'
+
+check_output	"broadcast     $BRDADDR_PATTERN" \
+		'Failed to set broadcast address with "--broadcast".'
+
+check_output	"netmask       $NETMASK_PATTERN" \
+		'Failed to set netmask with "--netmask".'
+
+check_output	"flags         UP" \
+		'Failed to bring interface up while setting address.'
+
+#
+# Assign metric and MTU using switches.
+#
+$silence cat <<-HERE
+	** Set metric and MTU using switches:
+	**	--metric=$METRIC --mtu=$MTU
+	HERE
+
+$IFCONFIG --interface=$IFACE --metric=$METRIC --mtu=$MTU
+OUTPUT=`get_gnu_output`
+
+check_output "metric        $METRIC" \
+	     'Failed to set metric with "--metric".'
+
+check_output "mtu           $MTU" \
+	     'Failed to set MTU with "--mtu".'
+
+#
+# Bring the adapter down, and then up again.
+# The previous actions contain an implicit
+# switch '--up', as do standard implementations.
+#
+$silence cat <<-HERE
+	** Bring interface down, then up again.
+	**	--down, --up
+	HERE
+
+$IFCONFIG --interface=$IFACE --down >/dev/null
+OUTPUT=`get_gnu_output`
+
+# The absence of the flag UP indicates success.
+echo "$OUTPUT" | grep flags |
+  grep -v "flags         UP" >/dev/null ||
+    { echo >&2 'Failed to bring interface down with "--down".'
+      increase_status
+    }
+
+#
+# And up again!
+#
+$IFCONFIG --interface=$IFACE --up >/dev/null
+OUTPUT=`get_gnu_output`
+
+check_output "flags         UP" \
+	     'Failed to bring interface up with "--up".'
+
+# Choose a second address collection.
+
+make_setup
+
+#
+# Bring interface down on a parsed commandline.
+#
+$silence cat <<-HERE
+	** Bring interface down on a parsed command line:
+	**   ifconfig $IFACE down
+	HERE
+
+$IFCONFIG $IFACE down >/dev/null
+OUTPUT=`get_gnu_output`
+
+echo "$OUTPUT" | grep flags |
+  grep -v "flags         UP" >/dev/null ||
+    { echo >&2 'Failed to bring interface down with directive.'
+      increase_status
+    }
+
+#
+# Check setting of address, netmask, and broadcast
+# address on a parsed command line.
+#
+$silence cat <<-HERE
+	** Set address, netmask, and broadcast as arguments.
+	**   ifconfig $IFACE $ADDRESS broadcast $BRDADDR netmask $NETMASK
+	HERE
+
+$IFCONFIG $IFACE $ADDRESS broadcast $BRDADDR netmask $NETMASK
+OUTPUT=`get_gnu_output`
+
+check_output	"inet address  $ADDRESS_PATTERN" \
+		'Failed to set address as argument.'
+
+check_output	"broadcast     $BRDADDR_PATTERN" \
+		'Failed to set broadcast as argument.'
+
+check_output	"netmask       $NETMASK_PATTERN" \
+		'Failed to set netmask as argument.'
+
+check_output	"flags         UP" \
+		'Failed to bring interface up implicitly.'
+
+#
+# Assign metric and MTU on command line.
+#
+$silence cat <<-HERE
+	** Set metric and MTU as parsed arguments:
+	**   ifconfig $IFACE metric $METRIC mtu $MTU
+	HERE
+
+$IFCONFIG $IFACE metric $METRIC mtu $MTU
+OUTPUT=`get_gnu_output`
+
+check_output "metric        $METRIC" \
+	     'Failed to set metric as argument.'
+
+check_output "mtu           $MTU" \
+	     'Failed to set MTU as argument.'
+
+#
+# Status summary
+#
+if test $STATUS -eq 0; then
+  $silence echo 'Successful testing: '`uname -o -r -s`
+else
+  PLURAL=
+  test $STATUS -le 1 || PLURAL=s
+  echo 'There were '$STATUS' failure'$PLURAL': '`uname -o -r -s`
+fi
+
+exit $STATUS

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |    9 ++
 tests/Makefile.am       |    2 +-
 tests/ifconfig_modes.sh |  298 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 308 insertions(+), 1 deletions(-)
 create mode 100644 tests/ifconfig_modes.sh


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Feb 14 17:54:49 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WERej-0007fD-7C
	for mharc-commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:54:49 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38448)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEReg-0007dh-SA
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:54:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WERef-0007Lq-Om
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:54:46 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:40413)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WERef-0007Lm-LE
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 17:54:45 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WERef-00008l-5v
	for commit-inetutils@gnu.org; Fri, 14 Feb 2014 22:54:45 +0000
Date: Fri, 14 Feb 2014 22:54:45 +0000
Message-Id: <E1WERef-00008l-5v@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-6-g0fcf5db
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839
X-Git-Newrev: 0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Feb 2014 22:54:48 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31 (commit)
      from  93db34ea1d5f933a26c48c8c0fe9a4e79d9c1839 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31


commit 0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Feb 14 23:51:07 2014 +0100

    ifconfig: Correction to flag listing.

diff --git a/ChangeLog b/ChangeLog
index 6c010ef..38ede45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-02-14  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	* ifconfig/flags.c (if_list_flags): Increment counter
+	only in the for-statement; update the insertion of list
+	delimiters.  Each second flag name was falsely scrubbed.
+
+2014-02-14  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	Script for testing of ifconfig's modes.
 	Will document all tested features.
 
diff --git a/ifconfig/flags.c b/ifconfig/flags.c
index d8b7b48..6381df1 100644
--- a/ifconfig/flags.c
+++ b/ifconfig/flags.c
@@ -257,7 +257,7 @@ if_list_flags (const char *prefix)
   fcount = i;
   qsort (fnames, fcount, sizeof (fnames[0]), cmpname);
 
-  len += 2 * fcount;
+  len += strlen (", ") * fcount;	/* Delimiters  */
 
   if (prefix)
     len += strlen (prefix);
@@ -276,13 +276,11 @@ if_list_flags (const char *prefix)
 	continue;
       strcpy (p, fnames[i]);
       p += strlen (fnames[i]);
-      if (++i < fcount)
+      if (i + 1 < fcount)
 	{
 	  *p++ = ',';
 	  *p++ = ' ';
 	}
-      else
-	break;
     }
   *p = 0;
   free (fnames);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    6 ++++++
 ifconfig/flags.c |    6 ++----
 2 files changed, 8 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Feb 15 06:30:29 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WEdS0-0003fx-UC
	for mharc-commit-inetutils@gnu.org; Sat, 15 Feb 2014 06:30:28 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40862)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEdRx-0003fp-LT
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 06:30:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEdRw-0001is-Bw
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 06:30:25 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:47324)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEdRw-0001in-1s
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 06:30:24 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WEdRv-0007Bx-8z
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 11:30:23 +0000
Date: Sat, 15 Feb 2014 11:30:23 +0000
Message-Id: <E1WEdRv-0007Bx-8z@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-7-g85ce575
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31
X-Git-Newrev: 85ce575d0b5a444462efa60c3202848a7446b00d
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Feb 2014 11:30:27 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  85ce575d0b5a444462efa60c3202848a7446b00d (commit)
      from  0fcf5db471f8d3ce4c20a19b9baab0d9d735bc31 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=85ce575d0b5a444462efa60c3202848a7446b00d


commit 85ce575d0b5a444462efa60c3202848a7446b00d
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Feb 15 10:08:43 2014 +0100

    Corner test case for ifconfig.
    
    GNU/Linux displays problems while bringing up the
    interface after an address change.

diff --git a/ChangeLog b/ChangeLog
index 38ede45..e0deed3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	* tests/ifconfig_modes.sh: Add test case to explain
+	failures to automatically bring the interface up at
+	an address change.  GNU/Linux is affected by this.
+
 2014-02-14  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	* ifconfig/flags.c (if_list_flags): Increment counter
diff --git a/tests/ifconfig_modes.sh b/tests/ifconfig_modes.sh
index baa903f..bbd32a7 100644
--- a/tests/ifconfig_modes.sh
+++ b/tests/ifconfig_modes.sh
@@ -152,6 +152,23 @@ check_output () {
 }
 
 #
+# For consistency and repeatability, first bring the interface down.
+#
+$silence cat <<-HERE
+	** Bring interface down with a lone switch:
+	**   ifconfig -i $IFACE --down
+	HERE
+
+$IFCONFIG -i $IFACE --down >/dev/null
+OUTPUT=`get_gnu_output`
+
+echo "$OUTPUT" | grep flags |
+  grep -v "flags         UP" >/dev/null ||
+    { echo >&2 'Failed to bring interface down with switch.'
+      increase_status
+    }
+
+#
 # Check setting of address, netmask, and broadcast
 # address using switches.
 #
@@ -174,7 +191,46 @@ check_output	"netmask       $NETMASK_PATTERN" \
 		'Failed to set netmask with "--netmask".'
 
 check_output	"flags         UP" \
-		'Failed to bring interface up while setting address.'
+		'Failed to bring interface up with address/netmask/broadcast.'
+
+#
+# Diagnose a failure to implicitly bring the interface up.
+#
+echo "$OUTPUT" |
+  grep "flags         UP" >/dev/null 2>&1 ||
+    {
+      $silence cat <<-HERE
+	** Set only address and explicit 'up' switches:
+	**	--interface=$IFACE --address=$ADDRESS --up
+	HERE
+
+      $IFCONFIG --interface=$IFACE --address=$ADDRESS --up >/dev/null
+      OUTPUT=`get_gnu_output`
+
+      check_output	"flags         UP" \
+			'Failed to bring interface up with only address.'
+
+      # As a last resort, try a single imperative 'up'.
+      echo "$OUTPUT" |
+	grep "flags         UP" >/dev/null 2>&1 ||
+	  {
+	    $silence cat <<-HERE
+		** Apply a single switch:
+		**	--interface=$IFACE --up
+		HERE
+
+	    $IFCONFIG --interface=$IFACE --up >/dev/null
+	    OUTPUT=`get_gnu_output`
+
+	    if echo "$OUTPUT" | grep "flags         UP" >/dev/null 2>&1
+	    then
+	      echo >&2 '!!! This platform needs "--up" in splendid isolation.'
+	    else
+	      echo >&2 'Failed to bring interface up with a single "--up".'
+	      STATUS=`expr $STATUS + 1`
+	    fi
+	  }
+    }
 
 #
 # Assign metric and MTU using switches.
@@ -268,6 +324,45 @@ check_output	"flags         UP" \
 		'Failed to bring interface up implicitly.'
 
 #
+# Diagnose this last failure.
+#
+echo "$OUTPUT" |
+  grep "flags         UP" >/dev/null 2>&1 ||
+    {
+      $silence cat <<-HERE
+	** Set only address and explicit 'up' switches:
+	**   ifconfig $IFACE $ADDRESS up
+	HERE
+
+      $IFCONFIG $IFACE $ADDRESS up >/dev/null
+      OUTPUT=`get_gnu_output`
+
+      check_output	"flags         UP" \
+			'Failed to bring interface up with only address.'
+
+      # As a last resort, try a single imperative 'up'.
+      echo "$OUTPUT" |
+	grep "flags         UP" >/dev/null 2>&1 ||
+	  {
+	    $silence cat <<-HERE
+		** Apply a single switch:
+		**   ifconfig $IFACE up
+		HERE
+
+	    $IFCONFIG $IFACE up >/dev/null
+	    OUTPUT=`get_gnu_output`
+
+	    if echo "$OUTPUT" | grep "flags         UP" >/dev/null 2>&1
+	    then
+	      echo >&2 '!!! This platform needs specific "ifconfig '$IFACE' up".'
+	    else
+	      echo >&2 'Failed to bring interface up with a "ifconfig '$IFACE' up".'
+	      STATUS=`expr $STATUS + 1`
+	    fi
+	  }
+    }
+
+#
 # Assign metric and MTU on command line.
 #
 $silence cat <<-HERE

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |    6 +++
 tests/ifconfig_modes.sh |   97 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 102 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Feb 15 10:38:38 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WEhKA-0005qS-KL
	for mharc-commit-inetutils@gnu.org; Sat, 15 Feb 2014 10:38:38 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48038)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEhK7-0005py-OW
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 10:38:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEhK6-0003WW-BK
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 10:38:35 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49888)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WEhK6-0003WQ-7X
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 10:38:34 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WEhK0-0000zc-GG
	for commit-inetutils@gnu.org; Sat, 15 Feb 2014 15:38:29 +0000
Date: Sat, 15 Feb 2014 15:38:28 +0000
Message-Id: <E1WEhK0-0000zc-GG@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-8-ge2fbb2c
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 85ce575d0b5a444462efa60c3202848a7446b00d
X-Git-Newrev: e2fbb2cc6f8832e909e2b970e82211af92ed3e91
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Feb 2014 15:38:37 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  e2fbb2cc6f8832e909e2b970e82211af92ed3e91 (commit)
      from  85ce575d0b5a444462efa60c3202848a7446b00d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=e2fbb2cc6f8832e909e2b970e82211af92ed3e91


commit e2fbb2cc6f8832e909e2b970e82211af92ed3e91
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Feb 15 16:22:51 2014 +0100

    ifconfig: No listing of unchangeable flags.
    
    Many interface flags are known to be read-only.
    Avoid mentioning them in the help message.

diff --git a/ChangeLog b/ChangeLog
index e0deed3..cdd8e77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2014-02-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
+	ifconfig: No listing of unchangeable flags.
+
+	* ifconfig/flags.h [!IFF_CANTCHANGE]: Define it as naught.
+	(IU_IFF_CANTCHANGE): New macro.
+	* ifconfig/flags.c (if_list_flags): Do not list flags that
+	are known to give constant properties.  New macro FLAGS_COMMENT.
+	Add its contents to the end of the requested flags listing.
+	Skip a named flag if it matches IU_IFF_CANTCHANGE.  Also skip
+	flags named like 'link2/altphys', since their components
+	do appear in the listing.
+
+
+	Portability issues in test script.
+
+	* tests/ifconfig_modes.sh (MTU): Set to 1324 initially,
+	to get above 1280 needed for IPv6 compatibility.
+	The switch '-o' of uname is not portable.
+
+2014-02-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
 	* tests/ifconfig_modes.sh: Add test case to explain
 	failures to automatically bring the interface up at
 	an address change.  GNU/Linux is affected by this.
diff --git a/ifconfig/flags.c b/ifconfig/flags.c
index 6381df1..ea79426 100644
--- a/ifconfig/flags.c
+++ b/ifconfig/flags.c
@@ -224,6 +224,7 @@ cmpname (const void *a, const void *b)
 char *
 if_list_flags (const char *prefix)
 {
+#define FLAGS_COMMENT "\nPrepend 'no' to negate the effect."
   size_t len = 0;
   struct if_flag *fp;
   char **fnames;
@@ -246,6 +247,9 @@ if_list_flags (const char *prefix)
       {
 	const char *q;
 
+	if (fp->mask & IU_IFF_CANTCHANGE)
+	  continue;
+
 	fnames[i++] = p;
 	q = fp->name;
 	if (strncmp (q, "NO", 2) == 0)
@@ -262,6 +266,8 @@ if_list_flags (const char *prefix)
   if (prefix)
     len += strlen (prefix);
 
+  len += strlen (FLAGS_COMMENT);
+
   str = xmalloc (len + 1);
   p = str;
   if (prefix)
@@ -272,7 +278,9 @@ if_list_flags (const char *prefix)
 
   for (i = 0; i < fcount; i++)
     {
-      if (i && strcmp (fnames[i - 1], fnames[i]) == 0)
+      /* Omit repeated, or alternate names, like "link2/altphys".  */
+      if (i && strncmp (fnames[i - 1], fnames[i],
+			strlen (fnames[i - 1])) == 0)
 	continue;
       strcpy (p, fnames[i]);
       p += strlen (fnames[i]);
@@ -282,6 +290,9 @@ if_list_flags (const char *prefix)
 	  *p++ = ' ';
 	}
     }
+  strcpy (p, FLAGS_COMMENT);
+  p += strlen (FLAGS_COMMENT);
+#undef FLAGS_COMMENT
   *p = 0;
   free (fnames);
   return str;
diff --git a/ifconfig/flags.h b/ifconfig/flags.h
index 28a567b..f488947 100644
--- a/ifconfig/flags.h
+++ b/ifconfig/flags.h
@@ -36,6 +36,17 @@
 # define EXPECT_D2 ":D2/SNAP:SNAP:"
 # define EXPECT_SNAP ":D2/SNAP:D2:"
 
+/* Suppress flags that are not changeable by user.  */
+#ifndef IFF_CANTCHANGE
+# define IFF_CANTCHANGE 0
+#endif /* IFF_CANTCHANGE */
+
+/* Manually exclude flags that experience tell us be static.  */
+#define IU_IFF_CANTCHANGE \
+	(IFF_CANTCHANGE | IFF_LOOPBACK | IFF_POINTOPOINT | \
+	 IFF_ALLMULTI | IFF_BROADCAST | IFF_MULTICAST | \
+	 IFF_PROMISC | IFF_RUNNING)
+
 /* Return the name corresponding to the interface flag FLAG.
    If FLAG is unknown, return NULL.
    AVOID contains a ':' surrounded and seperated list of flag names
diff --git a/tests/ifconfig_modes.sh b/tests/ifconfig_modes.sh
index bbd32a7..6574c24 100644
--- a/tests/ifconfig_modes.sh
+++ b/tests/ifconfig_modes.sh
@@ -107,7 +107,7 @@ NETMASK2=255.255.252.0
 NETMASK2_HEX=0xfffffc00
 NETMASK2_PATTERN='255\.255\.252\.0'
 METRIC=7
-MTU=1234
+MTU=1324
 
 get_gnu_output () {
   $IFCONFIG --interface=$IFACE --format=gnu
@@ -383,11 +383,11 @@ check_output "mtu           $MTU" \
 # Status summary
 #
 if test $STATUS -eq 0; then
-  $silence echo 'Successful testing: '`uname -o -r -s`
+  $silence echo 'Successful testing: '`uname -m -r -s`
 else
   PLURAL=
   test $STATUS -le 1 || PLURAL=s
-  echo 'There were '$STATUS' failure'$PLURAL': '`uname -o -r -s`
+  echo 'There were '$STATUS' failure'$PLURAL': '`uname -m -r -s`
 fi
 
 exit $STATUS

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   20 ++++++++++++++++++++
 ifconfig/flags.c        |   13 ++++++++++++-
 ifconfig/flags.h        |   11 +++++++++++
 tests/ifconfig_modes.sh |    6 +++---
 4 files changed, 46 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Feb 22 15:51:20 2014
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1WHJXc-0005aH-Mr
	for mharc-commit-inetutils@gnu.org; Sat, 22 Feb 2014 15:51:20 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42596)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WHJXZ-0005a6-LJ
	for commit-inetutils@gnu.org; Sat, 22 Feb 2014 15:51:19 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WHJXX-0007AR-R6
	for commit-inetutils@gnu.org; Sat, 22 Feb 2014 15:51:17 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:49895)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1WHJXX-0007AL-MW
	for commit-inetutils@gnu.org; Sat, 22 Feb 2014 15:51:15 -0500
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1WHJXX-0002O7-1g
	for commit-inetutils@gnu.org; Sat, 22 Feb 2014 20:51:15 +0000
Date: Sat, 22 Feb 2014 20:51:15 +0000
Message-Id: <E1WHJXX-0002O7-1g@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_2-9-g5f8a021
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e2fbb2cc6f8832e909e2b970e82211af92ed3e91
X-Git-Newrev: 5f8a021b32df3d31cd98f6c85ad7c8f2b8308506
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: commit-inetutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: CVS commit notices for the GNU Internet utilities
	<commit-inetutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-inetutils>
List-Post: <mailto:commit-inetutils@gnu.org>
List-Help: <mailto:commit-inetutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-inetutils>,
	<mailto:commit-inetutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 22 Feb 2014 20:51:19 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  5f8a021b32df3d31cd98f6c85ad7c8f2b8308506 (commit)
      from  e2fbb2cc6f8832e909e2b970e82211af92ed3e91 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=5f8a021b32df3d31cd98f6c85ad7c8f2b8308506


commit 5f8a021b32df3d31cd98f6c85ad7c8f2b8308506
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Feb 22 21:46:28 2014 +0100

    ifconfig: Allow flags richer than 16 bits.
    
    Contemporary systems are not restricted to flags within
    a 16 bit span, notably FreeBSD and GNU/kFreeBSD.  Support
    this wider range and incorporate three new flags.

diff --git a/ChangeLog b/ChangeLog
index cdd8e77..c6045f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2014-02-22  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Allow flags richer than 16 bits.
+	Systems like GNU/kFreeBSD and FreeBSD use two `short int'
+	to represent interface flags.  Adapt to this fact.
+
+	* ifconfig/changeif.c (set_flags): Apply mask 0xffff to flags.
+	[ifr_flagshigh]: Calculate flag changes also on ifr_flagshigh.
+	* ifconfig/flags.c [IFF_PPROMISC] (if_flags): Add user land
+	setable flag "PROMISC".
+	[IFF_MONITOR] (if_flags): Add flag "MONITOR".
+	[IFF_STATICARP] (if_flags): Add flag "STATICARP".
+	[IFF_STATICARP] (flag_char_tab): Add short flag 's'.
+	[IFF_MONITOR] (flag_char_tab): Add short flag 'm'.
+	* ifconfig/options.c (formats) <unix>: Print flags numerically
+	using format string "%x".
+	* ifconfig/printif.c (put_flags): Change signature.  New type
+	of F is `unsigned int'.  New variable UFLAGS.  Work with UFLAGS,
+	not `flags'.
+	(put_flags_short): New signature.
+	[SIOCGIFFLAGS] (fh_ifdisplay_query, fh_brdaddr_query)
+	(fh_dstaddr_query, fh_flags): New variable UFLAGS, replacing
+	`form->ifr->ifr_flags'.
+	* ifconfig/printif.h (put_flags): Change prototype.
+
 2014-02-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: No listing of unchangeable flags.
diff --git a/ifconfig/changeif.c b/ifconfig/changeif.c
index 391513f..0bc99ac 100644
--- a/ifconfig/changeif.c
+++ b/ifconfig/changeif.c
@@ -247,7 +247,14 @@ set_flags (int sfd, struct ifreq *ifr, int setflags, int clrflags)
       error (0, errno, "SIOCGIFFLAGS failed");
       return -1;
     }
-  ifr->ifr_flags = (tifr.ifr_flags | setflags) & ~clrflags;
+  /* Some systems, notably FreeBSD, use two short integers.  */
+  ifr->ifr_flags = (tifr.ifr_flags | setflags) & ~clrflags & 0xffff;
+
+# ifdef ifr_flagshigh
+  ifr->ifr_flagshigh = (tifr.ifr_flagshigh | (setflags >> 16))
+		       & ~(clrflags >> 16);
+# endif /* ifr_flagshigh */
+
   if (ioctl (sfd, SIOCSIFFLAGS, ifr) < 0)
     {
       error (0, errno, "SIOCSIFFLAGS failed");
diff --git a/ifconfig/flags.c b/ifconfig/flags.c
index ea79426..19777a9 100644
--- a/ifconfig/flags.c
+++ b/ifconfig/flags.c
@@ -67,6 +67,12 @@ struct if_flag
     {"NOARP", IFF_NOARP, 0},
     {"ARP", IFF_NOARP, 1},
 #endif
+/* Keep IFF_PPROMISC prior to IFF_PROMISC
+ * for precedence in parsing.
+ */
+#ifdef IFF_PPROMISC		/* User accessible promiscuous mode.  */
+    {"PROMISC", IFF_PPROMISC, 0},
+#endif
 #ifdef IFF_PROMISC		/* Receive all packets.  */
     {"PROMISC", IFF_PROMISC, 0},
 #endif
@@ -212,6 +218,12 @@ struct if_flag
 #ifdef IFF_SNAP			/* Ethernet driver outputs SNAP header.  */
     {"SNAP", IFF_SNAP, 0},
 #endif
+#ifdef IFF_MONITOR
+    {"MONITOR", IFF_MONITOR, 0},
+#endif
+#ifdef IFF_STATICARP
+    {"STATICARP", IFF_STATICARP, 0},
+#endif
     { NULL, 0, 0}
   };
 
@@ -423,10 +435,16 @@ static struct if_flag_char flag_char_tab[] = {
   { IFF_POINTOPOINT, 'P' },
 #endif
 #ifdef IFF_SLAVE
-  { IFF_SLAVE,       's' },
+  { IFF_SLAVE,       's' },	/* Linux */
+#endif
+#ifdef IFF_STATICARP
+  { IFF_STATICARP,   's' },	/* FreeBSD */
 #endif
 #ifdef IFF_MASTER
-  { IFF_MASTER,      'm' },
+  { IFF_MASTER,      'm' },	/* Linux */
+#endif
+#ifdef IFF_MONITOR
+  { IFF_MONITOR,     'm' },	/* FreeBSD */
 #endif
 #ifdef IFF_SIMPLEX
   { IFF_SIMPLEX,     'S' },
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 5e7265a..2c18ac8 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -157,7 +157,7 @@ struct format formats[] = {
    "Traditional UNIX interface listing.  Default for Solaris, BSD and HPUX.",
    "${format}{check-existence}"
    "${ifdisplay?}{"
-   "${name}: flags=${flags}{number}{%hx}<${flags}{string}{,}>"
+   "${name}: flags=${flags}{number}{%x}<${flags}{string}{,}>"
    "${metric?}{ metric ${metric}}"
    "${mtu?}{ mtu ${mtu}}${\\n}"
    /* Print only if hwtype emits something.  */
diff --git a/ifconfig/printif.c b/ifconfig/printif.c
index 25cc8ea..3f8347f 100644
--- a/ifconfig/printif.c
+++ b/ifconfig/printif.c
@@ -303,15 +303,16 @@ put_addr (format_data_t form, int argc, char *argv[], struct sockaddr *sa)
 }
 
 void
-put_flags (format_data_t form, int argc, char *argv[], short flags)
+put_flags (format_data_t form, int argc, char *argv[], int flags)
 {
-  unsigned short int f = 1;
+  unsigned int f = 1;
   const char *name;
   int first = 1;
+  unsigned int uflags = (unsigned int) flags;
 
-  while (flags && f)
+  while (uflags && f)
     {
-      if (f & flags)
+      if (f & uflags)
 	{
 	  name = if_flagtoname (f, NULL);
 	  if (name)
@@ -324,13 +325,13 @@ put_flags (format_data_t form, int argc, char *argv[], short flags)
 		    put_char (form, ' ');
 		}
 	      put_string (form, name);
-	      flags &= ~f;
+	      uflags &= ~f;
 	      first = 0;
 	    }
 	}
       f = f << 1;
     }
-  if (flags)
+  if (uflags)
     {
       if (!first)
 	{
@@ -339,13 +340,13 @@ put_flags (format_data_t form, int argc, char *argv[], short flags)
 	  else
 	    put_char (form, ' ');
 	}
-      put_int (form, argc - 1, &argv[1], flags);
+      put_int (form, argc - 1, &argv[1], uflags);
     }
 }
 
 void
 put_flags_short (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-		 char *argv[] _GL_UNUSED_PARAMETER, short flags)
+		 char *argv[] _GL_UNUSED_PARAMETER, int flags)
 {
   char buf[IF_FORMAT_FLAGS_BUFSIZE];
   if_format_flags (flags, buf, sizeof buf);
@@ -482,11 +483,16 @@ fh_ifdisplay_query (format_data_t form, int argc, char *argv[])
 #ifdef SIOCGIFFLAGS
   int f;
   int rev;
+  unsigned int uflags = (unsigned short) form->ifr->ifr_flags;
+
+# ifdef ifr_flagshigh
+  uflags |= (unsigned short) form->ifr->ifr_flagshigh << 16;
+# endif /* ifr_flagshigh */
 
   n = !(all_option || ifs_cmdline
 	|| ((f = if_nameztoflag ("UP", &rev))
 	    && ioctl (form->sfd, SIOCGIFFLAGS, form->ifr) == 0
-	    && (f & form->ifr->ifr_flags)));
+	    && (f & uflags)));
 #else
   n = 0;
 #endif
@@ -706,10 +712,15 @@ fh_brdaddr_query (format_data_t form, int argc, char *argv[])
 # ifdef SIOCGIFFLAGS
   int f;
   int rev;
+  unsigned int uflags = (unsigned short) form->ifr->ifr_flags;
+
+# ifdef ifr_flagshigh
+  uflags |= (unsigned short) form->ifr->ifr_flagshigh << 16;
+# endif /* ifr_flagshigh */
 
   if (0 == (f = if_nameztoflag ("BROADCAST", &rev))
       || (ioctl (form->sfd, SIOCGIFFLAGS, form->ifr) < 0)
-      || ((f & form->ifr->ifr_flags) == 0))
+      || ((f & uflags) == 0))
     {
       select_arg (form, argc, argv, 1);
       return;
@@ -745,10 +756,15 @@ fh_dstaddr_query (format_data_t form, int argc, char *argv[])
 # ifdef SIOCGIFFLAGS
   int f;
   int rev;
+  unsigned int uflags = (unsigned short) form->ifr->ifr_flags;
+
+#  ifdef ifr_flagshigh
+  uflags |= (unsigned short) form->ifr->ifr_flagshigh << 16;
+#  endif /* ifr_flagshigh */
 
   if (0 == (f = if_nameztoflag ("POINTOPOINT", &rev))
       || (ioctl (form->sfd, SIOCGIFFLAGS, form->ifr) < 0)
-      || ((f & form->ifr->ifr_flags) == 0))
+      || ((f & uflags) == 0))
     {
       select_arg (form, argc, argv, 1);
       return;
@@ -856,17 +872,23 @@ fh_flags (format_data_t form, int argc, char *argv[])
 	   form->ifr->ifr_name);
   else
     {
+      unsigned int uflags = (unsigned short) form->ifr->ifr_flags;
+
+# ifdef ifr_flagshigh
+      uflags |= (unsigned short) form->ifr->ifr_flagshigh << 16;
+# endif /* ifr_flagshigh */
+
       if (argc >= 1)
 	{
 	  if (!strcmp (argv[0], "number"))
-	    put_int (form, argc - 1, &argv[1], form->ifr->ifr_flags);
+	    put_int (form, argc - 1, &argv[1], uflags);
 	  else if (!strcmp (argv[0], "short"))
-	    put_flags_short (form, argc - 1, &argv[1], form->ifr->ifr_flags);
+	    put_flags_short (form, argc - 1, &argv[1], uflags);
 	  else if (!strcmp (argv[0], "string"))
-	    put_flags (form, argc - 1, &argv[1], form->ifr->ifr_flags);
+	    put_flags (form, argc - 1, &argv[1], uflags);
 	}
       else
-	put_flags (form, argc, argv, form->ifr->ifr_flags);
+	put_flags (form, argc, argv, uflags);
     }
 #else
   *column += printf ("(not available)");
diff --git a/ifconfig/printif.h b/ifconfig/printif.h
index e9f334d..188c068 100644
--- a/ifconfig/printif.h
+++ b/ifconfig/printif.h
@@ -67,7 +67,7 @@ void put_ulong (format_data_t form, int argc, char *argv[], unsigned long val);
 void select_arg (format_data_t form, int argc, char *argv[], int nr);
 void put_addr (format_data_t form, int argc, char *argv[],
 	       struct sockaddr *sa);
-void put_flags (format_data_t form, int argc, char *argv[], short flags);
+void put_flags (format_data_t form, int argc, char *argv[], int flags);
 
 /* Format handler can mangle form->format, so update it after calling
    here.  */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   25 ++++++++++++++++++++++++
 ifconfig/changeif.c |    9 +++++++-
 ifconfig/flags.c    |   22 +++++++++++++++++++-
 ifconfig/options.c  |    2 +-
 ifconfig/printif.c  |   52 ++++++++++++++++++++++++++++++++++++--------------
 ifconfig/printif.h  |    2 +-
 6 files changed, 92 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


