Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/ipf/netinet Remove a few unused variables, ...



details:   https://anonhg.NetBSD.org/src/rev/891c9121c68a
branches:  trunk
changeset: 789958:891c9121c68a
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Sep 14 12:03:10 2013 +0000

description:
Remove a few unused variables, ifdef others like their use

diffstat:

 sys/external/bsd/ipf/netinet/ip_nat6.c |  41 ++++++++++++++-------------------
 1 files changed, 17 insertions(+), 24 deletions(-)

diffs (167 lines):

diff -r c9e72f492bd0 -r 891c9121c68a sys/external/bsd/ipf/netinet/ip_nat6.c
--- a/sys/external/bsd/ipf/netinet/ip_nat6.c    Sat Sep 14 11:51:47 2013 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_nat6.c    Sat Sep 14 12:03:10 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat6.c,v 1.4 2013/01/09 13:23:20 christos Exp $     */
+/*     $NetBSD: ip_nat6.c,v 1.5 2013/09/14 12:03:10 martin Exp $       */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -1141,9 +1141,6 @@
        ipf_nat_softc_t *softn = softc->ipf_nat_soft;
        u_32_t sum1, sum2, sumd;
        frentry_t *fr;
-       u_32_t flags;
-
-       flags = nat->nat_flags;
 
        switch (fin->fin_p)
        {
@@ -1371,8 +1368,8 @@
 {
        ipf_main_softc_t *softc = fin->fin_main_soft;
        ipf_nat_softc_t *softn = softc->ipf_nat_soft;
-       struct icmp6_hdr *icmp6, *orgicmp;
-       int flags = 0, type, minlen;
+       struct icmp6_hdr *orgicmp;
+       int flags = 0, minlen;
        nat_stat_side_t *nside;
        tcphdr_t *tcp = NULL;
        u_short data[2];
@@ -1381,8 +1378,6 @@
        u_int p;
 
        minlen = 40;
-       icmp6 = fin->fin_dp;
-       type = icmp6->icmp6_type;
        nside = &softn->ipf_nat_stats.ns_side6[fin->fin_out];
        /*
         * Does it at least have the return (basic) IP header ?
@@ -1516,9 +1511,8 @@
        i6addr_t l1, l2, d;
        u_short *s1, *s2, *ds;
        u_32_t r;
-       int i, neg;
-
-       neg = 0;
+       int i;
+
        l1 = *ip1;
        l2 = *ip2;
        s1 = (u_short *)&l1;
@@ -1535,7 +1529,6 @@
        }
        if (s2[0] > s1[0]) {
                ds[0] = s2[0] + 0x10000 - s1[0];
-               neg = 1;
        } else {
                ds[0] = s2[0] - s1[0];
        }
@@ -1885,9 +1878,6 @@
        ipf_main_softc_t *softc = fin->fin_main_soft;
        ipf_nat_softc_t *softn = softc->ipf_nat_soft;
        u_short sport, dport;
-       grehdr_t *gre;
-       ipnat_t *ipn;
-       u_int sflags;
        nat_t *nat;
        int nflags;
        i6addr_t dst;
@@ -1897,9 +1887,7 @@
        ifp = fin->fin_ifp;
        sport = 0;
        dport = 0;
-       gre = NULL;
        dst.in6 = *mapdst;
-       sflags = flags & NAT_TCPUDPICMP;
 
        switch (p)
        {
@@ -1978,9 +1966,8 @@
 
 
                if ((nat->nat_flags & IPN_TCPUDP) != 0) {
-                       ipn = nat->nat_ptr;
 #ifdef IPF_V6_PROXIES
-                       if ((ipn != NULL) && (nat->nat_aps != NULL))
+                       if ((nat->nat_ptr != NULL) && (nat->nat_aps != NULL))
                                if (appr_match(fin, nat) != 0)
                                        continue;
 #endif
@@ -2204,14 +2191,11 @@
        ipf_main_softc_t *softc = fin->fin_main_soft;
        ipf_nat_softc_t *softn = softc->ipf_nat_soft;
        u_short sport, dport;
-       u_int sflags;
-       ipnat_t *ipn;
        nat_t *nat;
        void *ifp;
        u_int hv;
 
        ifp = fin->fin_ifp;
-       sflags = flags & IPN_TCPUDPICMP;
        sport = 0;
        dport = 0;
 
@@ -2292,9 +2276,8 @@
                        break;
                }
 
-               ipn = nat->nat_ptr;
 #ifdef IPF_V6_PROXIES
-               if ((ipn != NULL) && (nat->nat_aps != NULL))
+               if ((nat->nat_ptr != NULL) && (nat->nat_aps != NULL))
                        if (appr_match(fin, nat) != 0)
                                continue;
 #endif
@@ -2580,7 +2563,9 @@
        ipf_nat_softc_t *softn = softc->ipf_nat_soft;
        struct icmp6_hdr *icmp6 = NULL;
        struct ifnet *ifp, *sifp;
+#ifdef IPF_V6_PROXIES
        tcphdr_t *tcp = NULL;
+#endif
        int rval, natfailed;
        ipnat_t *np = NULL;
        u_int nflags = 0;
@@ -2634,8 +2619,10 @@
                        break;
                }
 
+#ifdef IPF_V6_PROXIES
                if ((nflags & IPN_TCPUDP))
                        tcp = fin->fin_dp;
+#endif
        }
 
        ipa = fin->fin_src6;
@@ -2979,7 +2966,9 @@
        int rval, natfailed;
        struct ifnet *ifp;
        i6addr_t ipa, iph;
+#ifdef IPF_V6_PROXIES
        tcphdr_t *tcp;
+#endif
        u_short dport;
        ipnat_t *np;
        nat_t *nat;
@@ -2987,7 +2976,9 @@
        if (softn->ipf_nat_stats.ns_rules == 0 || softn->ipf_nat_lock != 0)
                return 0;
 
+#ifdef IPF_V6_PROXIES
        tcp = NULL;
+#endif
        icmp6 = NULL;
        dport = 0;
        natadd = 1;
@@ -3028,7 +3019,9 @@
                }
 
                if ((nflags & IPN_TCPUDP)) {
+#ifdef IPF_V6_PROXIES
                        tcp = fin->fin_dp;
+#endif
                        dport = fin->fin_data[1];
                }
        }



Home | Main Index | Thread Index | Old Index