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-13-g13c195


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-13-g13c1955
Date: Thu, 20 Mar 2014 20:44:38 +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  13c195583c3bbc922ff59a61dde336e708851e1d (commit)
      from  34b3d3d7e439eca9e59564bae2dd93993d5d5474 (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=13c195583c3bbc922ff59a61dde336e708851e1d


commit 13c195583c3bbc922ff59a61dde336e708851e1d
Author: Mats Erik Andersson <address@hidden>
Date:   Thu Mar 20 19:42:45 2014 +0100

    ifconfig: Command line parsing.
    
    Implement flag parsing for BSD and Solaris.
    Accept only changeable flags on GNU/Linux.

diff --git a/ChangeLog b/ChangeLog
index 42c5a59..ea5a2d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2014-03-20  Mats Erik Andersson  <address@hidden>
+
+       ifconfig: Command line parsing.
+       Implement flag parsing for BSD and Solaris.
+       Accept only changeable flags on GNU/Linux.
+
+       * ifconfig/system/linux.c (system_parse_opt_rest):
+       Accept only masks which correspond to changeable flags,
+       using IU_IFF_CANTCHANGE.
+       * ifconfig/system/bsd.c, ifconfig/system/solaris.c
+       (system_parse_opt_rest): New variables MASK and REV.
+       Check if the command line argument can be interpreted
+       as a changeable flag argument.
+
 2014-03-15  Mats Erik Andersson  <address@hidden>
 
        ifconfig: Changeable flags on GNU/Linux.
diff --git a/ifconfig/system/bsd.c b/ifconfig/system/bsd.c
index a30a972..278cf6e 100644
--- a/ifconfig/system/bsd.c
+++ b/ifconfig/system/bsd.c
@@ -60,7 +60,7 @@ system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
 int
 system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
 {
-  int i = 0;
+  int i = 0, mask, rev;
   enum
   {
     EXPECT_NOTHING,
@@ -110,11 +110,13 @@ system_parse_opt_rest (struct ifconfig **ifp, int argc, 
char *argv[])
        parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
       else if (!strcmp (argv[i], "down"))
        parse_opt_set_flag (*ifp, IFF_UP, 1);
+      else if (((mask = if_nameztoflag (argv[i], &rev))
+               & ~IU_IFF_CANTCHANGE) != 0)
+       parse_opt_set_flag (*ifp, mask, rev);
       else
        {
          /* Recognize AF here.  */
-         /* Also alias, -alias, promisc, -promisc,
-            create, destroy, monitor, -monitor.  */
+         /* Also alias, -alias, create, destroy.  */
          if (!((*ifp)->valid & IF_VALID_ADDR))
            parse_opt_set_address (*ifp, argv[i]);
          else if (!((*ifp)->valid & IF_VALID_DSTADDR))
diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c
index 653a315..733b1c8 100644
--- a/ifconfig/system/linux.c
+++ b/ifconfig/system/linux.c
@@ -833,7 +833,8 @@ system_parse_opt_rest (struct ifconfig **ifp, int argc, 
char *argv[])
        parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
       else if (!strcmp (argv[i], "down"))
        parse_opt_set_flag (*ifp, IFF_UP, 1);
-      else if ((mask = if_nameztoflag (argv[i], &rev)) != 0)
+      else if (((mask = if_nameztoflag (argv[i], &rev))
+               & ~IU_IFF_CANTCHANGE) != 0)
        parse_opt_set_flag (*ifp, mask, rev);
       else
        parse_opt_set_address (*ifp, argv[i]);
diff --git a/ifconfig/system/solaris.c b/ifconfig/system/solaris.c
index 4c40616..317579e 100644
--- a/ifconfig/system/solaris.c
+++ b/ifconfig/system/solaris.c
@@ -74,7 +74,7 @@ system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
 int
 system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
 {
-  int i = 0;
+  int i = 0, mask, rev;
   enum
   {
     EXPECT_NOTHING,
@@ -124,11 +124,13 @@ system_parse_opt_rest (struct ifconfig **ifp, int argc, 
char *argv[])
        parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
       else if (!strcmp (argv[i], "down"))
        parse_opt_set_flag (*ifp, IFF_UP, 1);
+      else if (((mask = if_nameztoflag (argv[i], &rev))
+               & ~IU_IFF_CANTCHANGE) != 0)
+       parse_opt_set_flag (*ifp, mask, rev);
       else
        {
          /* Recognize AF here.  */
-         /* Also auto-revarp, trailers, -trailers,
-            private, -private, arp, -arp, plumb, unplumb.  */
+         /* Also auto-revarp, plumb, unplumb.  */
          if (!((*ifp)->valid & IF_VALID_ADDR))
            parse_opt_set_address (*ifp, argv[i]);
          else if (!((*ifp)->valid & IF_VALID_DSTADDR))

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

Summary of changes:
 ChangeLog                 |   14 ++++++++++++++
 ifconfig/system/bsd.c     |    8 +++++---
 ifconfig/system/linux.c   |    3 ++-
 ifconfig/system/solaris.c |    8 +++++---
 4 files changed, 26 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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