]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
remove #if 0 code
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 23 Nov 2022 03:01:23 +0000 (19:01 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 23 Nov 2022 03:01:23 +0000 (19:01 -0800)
Let's not keep unused code. The YAGNI means that this dead
code doesn't work now, and if it did it would have to change.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipmroute.c
ip/xfrm_state.c
tc/p_icmp.c
tc/q_gred.c
tc/tc_class.c

index 981baf2acd946dc622215dd215ff4655fd5734f9..32019c944c5229475c320e41c2417b2fcb3ab2d2 100644 (file)
@@ -39,9 +39,6 @@ static void usage(void)
                "Usage: ip mroute show [ [ to ] PREFIX ] [ from PREFIX ] [ iif DEVICE ]\n"
                "                      [ table TABLE_ID ]\n"
                "TABLE_ID := [ local | main | default | all | NUMBER ]\n"
-#if 0
-       "Usage: ip mroute [ add | del ] DESTINATION from SOURCE [ iif DEVICE ] [ oif DEVICE ]\n"
-#endif
        );
        exit(-1);
 }
@@ -322,14 +319,7 @@ int do_multiroute(int argc, char **argv)
 {
        if (argc < 1)
                return mroute_list(0, NULL);
-#if 0
-       if (matches(*argv, "add") == 0)
-               return mroute_modify(RTM_NEWADDR, argc-1, argv+1);
-       if (matches(*argv, "delete") == 0)
-               return mroute_modify(RTM_DELADDR, argc-1, argv+1);
-       if (matches(*argv, "get") == 0)
-               return mroute_get(argc-1, argv+1);
-#endif
+
        if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0
            || matches(*argv, "lst") == 0)
                return mroute_list(argc-1, argv+1);
index 6fee7efd18c70739504bca68ce605b5ed391218c..b2294d9fe58f01bef9e596bebaab1286242470ce 100644 (file)
@@ -124,11 +124,6 @@ static int xfrm_algo_parse(struct xfrm_algo *alg, enum xfrm_attr_type_t type,
        int len;
        int slen = strlen(key);
 
-#if 0
-       /* XXX: verifying both name and key is required! */
-       fprintf(stderr, "warning: ALGO-NAME/ALGO-KEYMAT values will be sent to the kernel promiscuously! (verifying them isn't implemented yet)\n");
-#endif
-
        strlcpy(alg->alg_name, name, sizeof(alg->alg_name));
 
        if (slen > 2 && strncmp(key, "0x", 2) == 0) {
@@ -791,12 +786,6 @@ static int xfrm_state_allocspi(int argc, char **argv)
                .n.nlmsg_flags = NLM_F_REQUEST,
                .n.nlmsg_type = XFRM_MSG_ALLOCSPI,
                .xspi.info.family = preferred_family,
-#if 0
-               .xspi.lft.soft_byte_limit = XFRM_INF,
-               .xspi.lft.hard_byte_limit = XFRM_INF,
-               .xspi.lft.soft_packet_limit = XFRM_INF,
-               .xspi.lft.hard_packet_limit = XFRM_INF,
-#endif
        };
        char *idp = NULL;
        char *minp = NULL;
index 15ce32309e398b94ae7042afb5f018740f250949..933ca8a5ff1e28bce127c34e319ff3f96e998502 100644 (file)
@@ -27,31 +27,7 @@ static int
 parse_icmp(int *argc_p, char ***argv_p,
           struct m_pedit_sel *sel, struct m_pedit_key *tkey)
 {
-       int res = -1;
-#if 0
-       int argc = *argc_p;
-       char **argv = *argv_p;
-
-       if (argc < 2)
-               return -1;
-
-       if (strcmp(*argv, "type") == 0) {
-               NEXT_ARG();
-               res = parse_u8(&argc, &argv, 0);
-               goto done;
-       }
-       if (strcmp(*argv, "code") == 0) {
-               NEXT_ARG();
-               res = parse_u8(&argc, &argv, 1);
-               goto done;
-       }
        return -1;
-
-done:
-       *argc_p = argc;
-       *argv_p = argv;
-#endif
-       return res;
 }
 
 struct m_pedit_util p_pedit_icmp = {
index 89aeb086038f39d2dddfa46eb5575c383128dc24..01f12eeeffada0d258d5aecd7a665f00f7cb7dd1 100644 (file)
@@ -27,8 +27,7 @@
 
 #include "tc_red.h"
 
-
-#if 0
+#ifdef DEBUG
 #define DPRINTF(format, args...) fprintf(stderr, format, ##args)
 #else
 #define DPRINTF(format, args...)
index 39bea9712dda7bcb5c8724081a31b72a261e8e48..b3e7c92491e079e373055f678332ac981fb4c28b 100644 (file)
@@ -474,10 +474,6 @@ int do_class(int argc, char **argv)
                return tc_class_modify(RTM_NEWTCLASS, NLM_F_CREATE, argc-1, argv+1);
        if (matches(*argv, "delete") == 0)
                return tc_class_modify(RTM_DELTCLASS, 0,  argc-1, argv+1);
-#if 0
-       if (matches(*argv, "get") == 0)
-               return tc_class_get(RTM_GETTCLASS, 0,  argc-1, argv+1);
-#endif
        if (matches(*argv, "list") == 0 || matches(*argv, "show") == 0
            || matches(*argv, "lst") == 0)
                return tc_class_list(argc-1, argv+1);