commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-8-ge2fbb2c


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-8-ge2fbb2c
Date: Sat, 15 Feb 2014 15:38:28 +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 <address@hidden>
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  <address@hidden>
 
+       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  <address@hidden>
+
        * 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 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]