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 move variable definition/set in...



details:   https://anonhg.NetBSD.org/src/rev/031ccbb80876
branches:  trunk
changeset: 791028:031ccbb80876
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Nov 01 06:42:23 2013 +0000

description:
move variable definition/set inside the same #ifdef of the usage.

diffstat:

 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 9bf5522ad800 -r 031ccbb80876 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Fri Nov 01 06:41:56 2013 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Fri Nov 01 06:42:23 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil_netbsd.c,v 1.6 2013/09/14 11:39:08 martin Exp $ */
+/*     $NetBSD: ip_fil_netbsd.c,v 1.7 2013/11/01 06:42:23 mrg Exp $    */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.6 2013/09/14 11:39:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.7 2013/11/01 06:42:23 mrg Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -843,13 +843,14 @@
 int
 ipf_send_icmp_err(int type, fr_info_t *fin, int dst)
 {
-       int err, hlen, xtra, iclen, ohlen, avail, code;
+       int err, hlen, xtra, iclen, ohlen, avail;
        struct in_addr dst4;
        struct icmp *icmp;
        struct mbuf *m;
        i6addr_t dst6;
        void *ifp;
 #ifdef USE_INET6
+       int code;
        ip6_t *ip6;
 #endif
        ip_t *ip, *ip2;
@@ -857,8 +858,8 @@
        if ((type < 0) || (type > ICMP_MAXTYPE))
                return -1;
 
+#ifdef USE_INET6
        code = fin->fin_icode;
-#ifdef USE_INET6
        if ((code < 0) || (code >= sizeof(icmptoicmp6unreach)/sizeof(int)))
                return -1;
 #endif



Home | Main Index | Thread Index | Old Index