From MAILER-DAEMON Sat Aug 01 15:00:35 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ZLc1L-0003y9-Hx
	for mharc-commit-inetutils@gnu.org; Sat, 01 Aug 2015 15:00:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58094)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLc1I-0003xx-Te
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 15:00:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLc1H-0002SG-Fj
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 15:00:32 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:53559)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLc1H-0002Rg-A4
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 15:00:31 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1ZLc1G-0007mm-1K
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 19:00:30 +0000
Date: Sat, 01 Aug 2015 19:00:30 +0000
Message-Id: <E1ZLc1G-0007mm-1K@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_4-9-gd4114d5
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 25b4f3449c040c79ae459cd9a3d0e6984eaa272c
X-Git-Newrev: d4114d50afdf7d08416c194ff71dff4abb046979
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, 01 Aug 2015 19:00:34 -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  d4114d50afdf7d08416c194ff71dff4abb046979 (commit)
      from  25b4f3449c040c79ae459cd9a3d0e6984eaa272c (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=d4114d50afdf7d08416c194ff71dff4abb046979


commit d4114d50afdf7d08416c194ff71dff4abb046979
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Aug 1 20:38:55 2015 +0200

    ifconfig: Apply interface flags correctly.
    
    Changes of interface flags could be suppressed when
    an address assignment was requested at the same time.
    Suppress also printout when properties are changed.
    Reported by Hans-Peter Budek.

diff --git a/ChangeLog b/ChangeLog
index f35be24..3e16d80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2015-08-01  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Apply flags correctly.
+	When finalizing actions, some flags could be forgotten.
+	In particular, the flag 'up' was ignored whenever an
+	address was assigned at the same time.  This is related
+	to the fact that an invocation only effecting interface
+	flags, still resulted in a full printout if interface
+	status.  This latter behaviour differs from all other
+	implementations and is rather annoying.  The issue was
+	detected and reported by Hans-Peter Budek in
+	http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00000.html
+
+	* ifconfig/options.c (pending_setflags, pending_clrflags):
+	Define as static variables.
+	(pending_valid): New variable.
+	(argp_options) <message 'up'>: Delete the claim that 'up' be
+	a default action together with address.
+	(parse_opt_set_flag): When `ifp' exists, update `ifp->valid'
+	with IF_VALID_FLAGS.  Otherwise, update `pending_valid'.
+	(parse_opt_finalize): If `ifp' exists and `pending_valid` is
+	set, then update `ifp->valid'.  The update of `ifp->setflags'
+	and `ifp->clrflags' is performed independently of assigning
+	an output format, as the latter would cause a printout also
+	when only some flag is being altered.
+	* ifconfig/options.h (IF_VALID_FLAGS): New macro.
+	(IF_VALID_HWADDR): Updated value.
+	(pending_setflags. pending_clrflags): Removed declaration.
+
 2015-07-30  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: A work-around specific to GNU/Hurd.
diff --git a/ifconfig/options.c b/ifconfig/options.c
index 3032062..484f252 100644
--- a/ifconfig/options.c
+++ b/ifconfig/options.c
@@ -49,8 +49,9 @@ int list_mode;
 int verbose;
 
 /* Flags asked for, possibly still pending application.  */
-int pending_setflags;
-int pending_clrflags;
+static int pending_setflags = 0;
+static int pending_clrflags = 0;
+static int pending_valid = 0;
 
 /* Array of all interfaces on the command line.  */
 struct ifconfig *ifs;
@@ -270,7 +271,7 @@ static struct argp_option argp_options[] = {
   { "format", FORMAT_OPTION, "FORMAT", 0,
     "select output format; set to `help' for info", GRP },
   { "up", UP_OPTION, NULL, 0,
-    "activate the interface (default if address is given)", GRP },
+    "activate the interface", GRP },
   { "down", DOWN_OPTION, NULL, 0,
     "shut the interface down", GRP },
   { "flags", 'F', "FLAG[,FLAG...]", 0,
@@ -381,6 +382,11 @@ void
 parse_opt_set_flag (struct ifconfig *ifp _GL_UNUSED_PARAMETER,
 		    int flag, int rev)
 {
+  if (ifp)
+    ifp->valid |= IF_VALID_FLAGS;
+  else
+    pending_valid |= IF_VALID_FLAGS;
+
   if (rev)
     {
       pending_clrflags |= flag;
@@ -496,12 +502,27 @@ parse_opt_set_default_format_from_file (const char *file)
 void
 parse_opt_finalize (struct ifconfig *ifp)
 {
+  /* The flags `--up' and `--down' are allowed early.  */
+  if (ifp && pending_valid)
+    {
+      ifp->valid |= pending_valid;
+      pending_valid = 0;
+    }
+
+  /* Only the empty set of actions, i.e., only the interface name
+   * is present on the command line, merits printout of status.
+   */
   if (ifp && !ifp->valid)
     {
       ifp->valid = IF_VALID_FORMAT;
       ifp->format = default_format;
+    }
+
+  if (ifp && (pending_setflags | pending_clrflags))
+    {
       ifp->setflags |= pending_setflags;
       ifp->clrflags |= pending_clrflags;
+      pending_setflags = pending_clrflags = 0;
     }
 }
 
diff --git a/ifconfig/options.h b/ifconfig/options.h
index 1052838..b3bfae4 100644
--- a/ifconfig/options.h
+++ b/ifconfig/options.h
@@ -50,9 +50,10 @@ struct ifconfig
   int mtu;
 # define IF_VALID_METRIC	0x100
   int metric;
+# define IF_VALID_FLAGS		0x200
   int setflags;
   int clrflags;
-# define IF_VALID_HWADDR	0x200
+# define IF_VALID_HWADDR	0x400
   char *hwaddr;
 };
 
@@ -67,9 +68,6 @@ extern struct format formats[];
 extern int all_option;
 extern int ifs_cmdline;
 
-extern int pending_setflags;
-extern int pending_clrflags;
-
 /* Array of interfaces mentioned on the command line.  */
 extern struct ifconfig *ifs;
 extern int nifs;

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

Summary of changes:
 ChangeLog          |   29 +++++++++++++++++++++++++++++
 ifconfig/options.c |   27 ++++++++++++++++++++++++---
 ifconfig/options.h |    6 ++----
 3 files changed, 55 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Sat Aug 01 19:10:24 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ZLfv6-0006Rw-7r
	for mharc-commit-inetutils@gnu.org; Sat, 01 Aug 2015 19:10:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34462)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLfv3-0006Ro-IB
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 19:10:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLfuy-0004SB-K8
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 19:10:21 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:56076)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZLfuy-0004S6-HF
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 19:10:16 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1ZLfux-00006b-Nw
	for commit-inetutils@gnu.org; Sat, 01 Aug 2015 23:10:16 +0000
Date: Sat, 01 Aug 2015 23:10:15 +0000
Message-Id: <E1ZLfux-00006b-Nw@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_4-10-gc1affe1
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d4114d50afdf7d08416c194ff71dff4abb046979
X-Git-Newrev: c1affe14d5e373b630358487fe1f89270cf73285
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, 01 Aug 2015 23:10:22 -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  c1affe14d5e373b630358487fe1f89270cf73285 (commit)
      from  d4114d50afdf7d08416c194ff71dff4abb046979 (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=c1affe14d5e373b630358487fe1f89270cf73285


commit c1affe14d5e373b630358487fe1f89270cf73285
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sun Aug 2 00:57:04 2015 +0200

    ifconfig: Verbose report on changed flags.

diff --git a/ChangeLog b/ChangeLog
index 3e16d80..3fea818 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-02  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Verbose report on changed flags.
+
+	* ifconfig/changeif.c (set_flags): In verbose report mode,
+	compose a message to name those flags that were set, and
+	also those that were cleared.
+
 2015-08-01  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: Apply flags correctly.
diff --git a/ifconfig/changeif.c b/ifconfig/changeif.c
index a040587..beac6f6 100644
--- a/ifconfig/changeif.c
+++ b/ifconfig/changeif.c
@@ -367,6 +367,30 @@ set_flags (int sfd, struct ifreq *ifr, int setflags, int clrflags)
       error (0, errno, "SIOCSIFFLAGS failed");
       return -1;
     }
+
+  if (verbose)
+    {
+      printf ("Setting %sflags", setflags ? "" : "no ");
+
+      if (setflags)
+	{
+	  printf (" `");
+	  print_if_flags (setflags, NULL, ',');
+	  putchar ('\'');
+	}
+
+      printf (" of `%s'", ifr->ifr_name);
+
+      if (clrflags)
+	{
+	  printf (", clearing `");
+	  print_if_flags (clrflags, NULL, ',');
+	  putchar ('\'');
+	}
+
+      printf (".\n");
+    }
+
   return 0;
 #endif
 }

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

Summary of changes:
 ChangeLog           |    8 ++++++++
 ifconfig/changeif.c |   24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Fri Aug 07 16:56:39 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ZNogw-00026F-VS
	for mharc-commit-inetutils@gnu.org; Fri, 07 Aug 2015 16:56:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50473)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZNogu-00025g-17
	for commit-inetutils@gnu.org; Fri, 07 Aug 2015 16:56:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZNogs-0006FJ-BI
	for commit-inetutils@gnu.org; Fri, 07 Aug 2015 16:56:35 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:35357)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZNogs-0006FF-7F
	for commit-inetutils@gnu.org; Fri, 07 Aug 2015 16:56:34 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1ZNogr-0003U2-HX
	for commit-inetutils@gnu.org; Fri, 07 Aug 2015 20:56:33 +0000
Date: Fri, 07 Aug 2015 20:56:33 +0000
Message-Id: <E1ZNogr-0003U2-HX@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_4-11-g050928b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: c1affe14d5e373b630358487fe1f89270cf73285
X-Git-Newrev: 050928be5416abda31db8bfa2fb7204387871fd1
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, 07 Aug 2015 20:56: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  050928be5416abda31db8bfa2fb7204387871fd1 (commit)
      from  c1affe14d5e373b630358487fe1f89270cf73285 (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=050928be5416abda31db8bfa2fb7204387871fd1


commit 050928be5416abda31db8bfa2fb7204387871fd1
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Fri Aug 7 22:51:43 2015 +0200

    ifconfig: Statistics for BSD systems.

diff --git a/ChangeLog b/ChangeLog
index 3fea818..7373f14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2015-08-07  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	ifconfig: Statistics for BSD systems.
+
+	* ifconfig/system/bsd.c (system_fh_ifstat_query)
+	(get_if_data_by_name, system_fh_missing_stat): New functions.
+	(_IU_DECLARE2): New macro.
+	(system_fh_rx_bytes, system_fh_rx_dropped, system_fh_rx_errors)
+	(system_fh_rx_packets, system_fh_tx_bytes, system_fh_tx_errors)
+	(system_fh_tx_packets, system_fh_collisions): New functions
+	defined using _IU_DECLARE2.
+	(system_fh_tx_dropped): New function.
+	* ifconfig/system/bsd.h (_IU_CAT2, _IU_DCL, _IU_EXTRN): New
+	macros identical to those in `ifconfig/system/linux.h'.
+	(SYSTEM_FORMAT_HANDLER) <ifstat?, collisions, rxbytes>
+	<rxdropped, rxerrors, rxfifoerr, rxframeerr, rxpackets>
+	<txbytes, txcarrier, txdropped, txerrors, txfifoerr, txpackets>:
+	New handler hooks.
+	(system_fh_ifstat_query, system_fh_missing_stat): New prototypes.
+	(system_fh_rx_bytes, system_fh_tx_bytes, system_fh_rx_dropped)
+	(system_fh_tx_dropped, system_fh_rx_errors, system_fh_tx_errors)
+	(system_fh_rx_packets, system_fh_tx_packets, system_fh_collisions):
+	New prototypes generated by _IU_EXTERN.
+
 2015-08-02  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: Verbose report on changed flags.
diff --git a/ifconfig/system/bsd.c b/ifconfig/system/bsd.c
index 1db525b..ec47ce6 100644
--- a/ifconfig/system/bsd.c
+++ b/ifconfig/system/bsd.c
@@ -198,6 +198,19 @@ struct ifmediareq ifm;
   if (!ifp) \
     getifaddrs (&ifp);
 
+void
+system_fh_ifstat_query (format_data_t form, int argc, char *argv[])
+{
+  /* Flush an existing interface list, thus renewing statistics.  */
+  if (ifp)
+    {
+      freeifaddrs (ifp);
+      ifp = NULL;
+    }
+
+  select_arg (form, argc, argv, getifaddrs (&ifp) ? 1 : 0);
+}
+
 struct if_nameindex* (*system_if_nameindex) (void) = if_nameindex;
 
 static void
@@ -728,3 +741,72 @@ system_fh_tunsrc (format_data_t form, int argc, char *argv[])
     put_string (form, "(no physrc)");
 #endif /* SIOCGIFPSRCADDR */
 }
+
+static struct if_data *
+get_if_data_by_name (format_data_t form)
+{
+  struct ifaddrs *fp;
+  struct if_data *data = NULL;
+
+  ESTABLISH_IFADDRS
+  if (!ifp)
+    return NULL;
+
+  for (fp = ifp; fp; fp = fp->ifa_next)
+    {
+      /* The choice of AF_LINK is the only portable alternative.
+       * Then IP, ARP etcera are included in all counters.
+       */
+      if (fp->ifa_addr->sa_family != AF_LINK ||
+	  strcmp (fp->ifa_name, form->ifr->ifr_name))
+	continue;
+
+      data = (struct if_data *) fp->ifa_data;
+      break;
+    }
+
+  return data;
+}
+
+void
+system_fh_missing_stat (format_data_t form, int argc, char *argv[])
+{
+  /* FIXME: Would a dash be a better answer?  */
+  put_ulong (form, argc, argv, 0);
+}
+
+#define _IU_DECLARE2(fld, udata)	\
+void					\
+_IU_CAT2 (system_fh_, fld) (format_data_t form, int argc, char *argv[])	\
+{				\
+  struct if_data *data = get_if_data_by_name (form);	\
+  if (data)			\
+    put_ulong (form, argc, argv, data->_IU_CAT2(ifi_, udata));	\
+  else				\
+    put_string (form, "(" #fld " unknown)");		\
+}
+
+_IU_DECLARE2 (rx_bytes, ibytes)
+_IU_DECLARE2 (rx_dropped, iqdrops)
+_IU_DECLARE2 (rx_errors, ierrors)
+_IU_DECLARE2 (rx_packets, ipackets)
+_IU_DECLARE2 (tx_bytes, obytes)
+_IU_DECLARE2 (tx_errors, oerrors)
+_IU_DECLARE2 (tx_packets, opackets)
+_IU_DECLARE2 (collisions, collisions)
+
+void
+system_fh_tx_dropped (format_data_t form, int argc, char *argv[])
+{
+#ifdef _IFI_OQDROPS
+  struct if_data *data = get_if_data_by_name (form);
+
+  if (data)
+    put_ulong (form, argc, argv, data->ifi_oqdrops);
+  else
+    put_string (form, "(txerrors unknown)");
+#else /* !_IFI_OQDROPS */
+  /* FIXME: Would a dash be a better answer?  */
+  put_ulong (form, argc, argv, 0);
+#endif
+}
diff --git a/ifconfig/system/bsd.h b/ifconfig/system/bsd.h
index 918c1f2..3398df6 100644
--- a/ifconfig/system/bsd.h
+++ b/ifconfig/system/bsd.h
@@ -57,6 +57,12 @@ struct system_ifconfig
 
 /* Output format support.  */
 
+# define _IU_CAT2(a, b) a ## b
+# define _IU_DCL(name, fld)				\
+  {#name, _IU_CAT2(system_fh_, fld) }
+# define _IU_EXTRN(fld)				\
+  extern void _IU_CAT2(system_fh_, fld) (format_data_t, int, char *[]);	\
+
 # define SYSTEM_FORMAT_HANDLER	\
   {"bsd", fh_nothing},		\
   {IU_BSD_TYPE, fh_nothing},	\
@@ -74,7 +80,21 @@ struct system_ifconfig
   {"status", system_fh_status}, \
   {"tunnel?", system_fh_tunnel_query}, \
   {"tundst", system_fh_tundst}, \
-  {"tunsrc", system_fh_tunsrc},
+  {"tunsrc", system_fh_tunsrc}, \
+  {"ifstat?", system_fh_ifstat_query}, \
+  _IU_DCL (collisions, collisions), \
+  _IU_DCL (rxbytes, rx_bytes), \
+  _IU_DCL (rxdropped, rx_dropped), \
+  _IU_DCL (rxerrors, rx_errors), \
+  {"rxfifoerr", system_fh_missing_stat}, \
+  {"rxframeerr", system_fh_missing_stat}, \
+  _IU_DCL (rxpackets, rx_packets), \
+  _IU_DCL (txbytes, tx_bytes), \
+  {"txcarrier", system_fh_missing_stat}, \
+  _IU_DCL (txdropped, tx_dropped), \
+  _IU_DCL (txerrors, tx_errors), \
+  {"txfifoerr", system_fh_missing_stat}, \
+  _IU_DCL (txpackets, tx_packets),
 
 void system_fh_brdaddr_query (format_data_t form, int argc, char *argv[]);
 void system_fh_brdaddr (format_data_t form, int argc, char *argv[]);
@@ -92,4 +112,17 @@ void system_fh_tunnel_query (format_data_t form, int argc, char *argv[]);
 void system_fh_tundst (format_data_t form, int argc, char *argv[]);
 void system_fh_tunsrc (format_data_t form, int argc, char *argv[]);
 
+void system_fh_ifstat_query (format_data_t form, int argc, char *argv[]);
+void system_fh_missing_stat (format_data_t form, int argc, char *argv[]);
+
+_IU_EXTRN (rx_bytes)
+_IU_EXTRN (tx_bytes)
+_IU_EXTRN (rx_dropped)
+_IU_EXTRN (tx_dropped)
+_IU_EXTRN (rx_errors)
+_IU_EXTRN (tx_errors)
+_IU_EXTRN (rx_packets)
+_IU_EXTRN (tx_packets)
+_IU_EXTRN (collisions)
+
 #endif /* IFCONFIG_SYSTEM_BSD_H */

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

Summary of changes:
 ChangeLog             |   24 ++++++++++++++
 ifconfig/system/bsd.c |   82 +++++++++++++++++++++++++++++++++++++++++++++++++
 ifconfig/system/bsd.h |   35 ++++++++++++++++++++-
 3 files changed, 140 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Wed Aug 19 09:28:47 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ZS2kW-0003Rc-Uw
	for mharc-commit-inetutils@gnu.org; Wed, 19 Aug 2015 08:45:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42667)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS2kP-0003La-OG
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 08:45:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS2kO-0001CI-F6
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 08:45:41 -0400
Received: from vcs.savannah.gnu.org ([208.118.235.72]:45203)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS2kO-0001C7-CF
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 08:45:40 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1ZS2kL-00078t-W5
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 12:45:39 +0000
Date: Wed, 19 Aug 2015 12:45:38 +0000
Message-Id: <E1ZS2kL-00078t-W5@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_4-12-gec8c9a3
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 050928be5416abda31db8bfa2fb7204387871fd1
X-Git-Newrev: ec8c9a31b46d325a2c1147dacd43971405e97c5d
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.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, 19 Aug 2015 12:45:47 -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  ec8c9a31b46d325a2c1147dacd43971405e97c5d (commit)
      from  050928be5416abda31db8bfa2fb7204387871fd1 (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=ec8c9a31b46d325a2c1147dacd43971405e97c5d


commit ec8c9a31b46d325a2c1147dacd43971405e97c5d
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Sat Aug 15 20:56:26 2015 +0200

    telnetd: Premature connection closure.
    
    A change, part of 0b7e8687, but secondary to its
    intention, turned out to cause service rejects during
    conditions akin to connection flooding.  Revert this
    particular part to gain established, good behaviour
    on GNU/Linux.
    Reported in `bug-inetutils/2015-07/msg00006.html'.

diff --git a/ChangeLog b/ChangeLog
index 7373f14..e6e23de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2015-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	telnetd: Premature connection closure.
+	When many connections are attempted in quick succession,
+	a substantial number of them are cancelled.  This does not
+	appear for manual use cases, but for contrived automated
+	set-ups.  The cause seems to be a change in the evaluation
+	of pty_read(), which was done to coincide with the condition
+	in use by the original BSD implementation.  Issue reported and
+	suggested by Chris Severance in
+	http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00006.html
+
+	* telnetd/telnetd.c (telnetd_run): Break the loop only by the
+	stronger condition `pty_read() < 0', i.e., only on non-masked
+	read errors.  This reverts a change introduced in 2015-03-15.
+	* telnetd/utility.c (pty_read): Add a comment that the read
+	errors EWOULDBLOCK, EAGAIN, and EIO are treated specially.
+
 2015-08-07  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	ifconfig: Statistics for BSD systems.
diff --git a/telnetd/telnetd.c b/telnetd/telnetd.c
index faecc07..0bf102a 100644
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -662,7 +662,13 @@ telnetd_run (void)
       if (FD_ISSET (pty, &ibits))
 	{
 	  /* Something to read from the pty... */
-	  if (pty_read () <= 0)
+
+	  /* Observe that pty_read() is masking a few select
+	   * read errors with the return value 0.  Let them
+	   * pass for further manipulation.  Issue reported in
+	   * http://lists.gnu.org/archive/html/bug-inetutils/2015-07/msg00006.html
+	   */
+	  if (pty_read () < 0)
 	    break;
 
 	  /* The first byte is now TIOCPKT data.  Peek at it.  */
diff --git a/telnetd/utility.c b/telnetd/utility.c
index e7ffb8e..e493dff 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -372,6 +372,14 @@ pty_input_putback (const char *str, size_t len)
   return 0;
 }
 
+/* pty_read()
+ *
+ * Read errors EWOULDBLOCK, EAGAIN, and EIO are
+ * tweeked into reporting zero bytes input.
+ * In particular, EIO is known to appear when
+ * reading off the master side, before having
+ * an active slave side.
+ */
 int
 pty_read (void)
 {

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

Summary of changes:
 ChangeLog         |   18 ++++++++++++++++++
 telnetd/telnetd.c |    8 +++++++-
 telnetd/utility.c |    8 ++++++++
 3 files changed, 33 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


From MAILER-DAEMON Thu Aug 20 20:06:43 2015
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ZSZr1-00011k-6y
	for mharc-commit-inetutils@gnu.org; Thu, 20 Aug 2015 20:06:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37087)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS3ro-0003q8-Ih
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 09:57:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS3rn-0004AH-As
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 09:57:24 -0400
Received: from vcs.savannah.gnu.org ([208.118.235.72]:46292)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu@gisladisker.se>) id 1ZS3rn-0004AD-8O
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 09:57:23 -0400
Received: from meand by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <gnu@gisladisker.se>) id 1ZS3rj-0000eG-Sq
	for commit-inetutils@gnu.org; Wed, 19 Aug 2015 13:57:22 +0000
Date: Wed, 19 Aug 2015 13:57:19 +0000
Message-Id: <E1ZS3rj-0000eG-Sq@vcs.savannah.gnu.org>
To: commit-inetutils@gnu.org
Subject: [SCM] GNU Inetutils  branch, master,
	updated. inetutils-1_9_4-13-g7655d89
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ec8c9a31b46d325a2c1147dacd43971405e97c5d
X-Git-Newrev: 7655d892c2a10adb6b1a8681253a96cf610cff46
From: Mats Erik Andersson <gnu@gisladisker.se>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.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, 21 Aug 2015 00:06:41 -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  7655d892c2a10adb6b1a8681253a96cf610cff46 (commit)
      from  ec8c9a31b46d325a2c1147dacd43971405e97c5d (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=7655d892c2a10adb6b1a8681253a96cf610cff46


commit 7655d892c2a10adb6b1a8681253a96cf610cff46
Author: Mats Erik Andersson <gnu@gisladisker.se>
Date:   Wed Aug 19 15:46:03 2015 +0200

    Function name collision on AIX systems.

diff --git a/ChangeLog b/ChangeLog
index e6e23de..6ef514f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-08-19  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	AIX systems have a system call send_file().  Rename our calls.
+	* src/tftp.c (send_file): Rename to...
+	(tftp_sendfile): ... this.
+	(put): Call tftp_sendfile, not send_file.
+	* src/tftpd.c (send_file): Rename to...
+	(tftpd_sendfile): ... this.
+	(formats): List tftpd_sendfile call, not send_file.
+
 2015-08-15  Mats Erik Andersson  <gnu@gisladisker.se>
 
 	telnetd: Premature connection closure.
diff --git a/src/tftp.c b/src/tftp.c
index 1d3c353..d0fbd6f 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -236,7 +236,7 @@ set_port (struct sockaddr_storage *ss, in_port_t port)
 }
 
 void recvfile (int, char *, char *);
-void send_file (int, char *, char *);
+void tftp_sendfile (int, char *, char *);
 
 static error_t
 parse_opt (int key, char *arg, struct argp_state *state)
@@ -614,7 +614,7 @@ put (int argc, char *argv[])
       if (verbose)
 	printf ("putting %s to %s:%s [%s]\n", cp, hostname, targ, mode);
       set_port (&peeraddr, port);
-      send_file (fd, targ, mode);
+      tftp_sendfile (fd, targ, mode);
       return;
     }
   /* this assumes the target is a directory */
@@ -634,7 +634,7 @@ put (int argc, char *argv[])
       if (verbose)
 	printf ("putting %s to %s:%s [%s]\n", argv[n], hostname, targ, mode);
       set_port (&peeraddr, port);
-      send_file (fd, targ, mode);
+      tftp_sendfile (fd, targ, mode);
     }
 }
 
@@ -980,7 +980,7 @@ setverbose (int argc _GL_UNUSED_PARAMETER, char *argv[] _GL_UNUSED_PARAMETER)
  * Send the requested file.
  */
 void
-send_file (int fd, char *name, char *mode)
+tftp_sendfile (int fd, char *name, char *mode)
 {
   register struct tftphdr *ap;	/* data and ack packets */
   struct tftphdr *r_init (void), *dp;
diff --git a/src/tftpd.c b/src/tftpd.c
index 56002a0..48d2b96 100644
--- a/src/tftpd.c
+++ b/src/tftpd.c
@@ -416,7 +416,7 @@ main (int argc, char *argv[])
 
 struct formats;
 int validate_access (char **, int);
-void send_file (struct formats *);
+void tftpd_sendfile (struct formats *);
 void recvfile (struct formats *);
 
 struct formats
@@ -428,8 +428,8 @@ struct formats
   int f_convert;
 } formats[] =
   {
-    {"netascii", validate_access, send_file, recvfile, 1},
-    {"octet", validate_access, send_file, recvfile, 0},
+    {"netascii", validate_access, tftpd_sendfile, recvfile, 1},
+    {"octet", validate_access, tftpd_sendfile, recvfile, 0},
     {0, NULL, NULL, NULL, 0}
   };
 
@@ -648,7 +648,7 @@ timer (int sig _GL_UNUSED_PARAMETER)
  * Send the requested file.
  */
 void
-send_file (struct formats *pf)
+tftpd_sendfile (struct formats *pf)
 {
   struct tftphdr *dp, *r_init (void);
   register struct tftphdr *ap;	/* ack packet */

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

Summary of changes:
 ChangeLog   |   10 ++++++++++
 src/tftp.c  |    8 ++++----
 src/tftpd.c |    8 ++++----
 3 files changed, 18 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 


