Source-Changes-HG archive

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

[src/trunk]: src/sys/net KNF; replace white spaces with hard tabs



details:   https://anonhg.NetBSD.org/src/rev/c20334128a74
branches:  trunk
changeset: 347508:c20334128a74
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Aug 29 03:31:59 2016 +0000

description:
KNF; replace white spaces with hard tabs

No functional change.

diffstat:

 sys/net/if_bridge.c |  156 ++++++++++++++++++++++++++--------------------------
 1 files changed, 78 insertions(+), 78 deletions(-)

diffs (197 lines):

diff -r 4c17ad86829a -r c20334128a74 sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Mon Aug 29 02:48:56 2016 +0000
+++ b/sys/net/if_bridge.c       Mon Aug 29 03:31:59 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.129 2016/06/22 10:44:32 knakahara Exp $        */
+/*     $NetBSD: if_bridge.c,v 1.130 2016/08/29 03:31:59 ozaki-r Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.129 2016/06/22 10:44:32 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.130 2016/08/29 03:31:59 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -2506,17 +2506,17 @@
        /*
         * Check for SNAP/LLC.
         */
-        if (ether_type < ETHERMTU) {
-                struct llc *llc2 = (struct llc *)(eh1 + 1);
-
-                if ((*mp)->m_len >= ETHER_HDR_LEN + 8 &&
-                    llc2->llc_dsap == LLC_SNAP_LSAP &&
-                    llc2->llc_ssap == LLC_SNAP_LSAP &&
-                    llc2->llc_control == LLC_UI) {
-                       ether_type = htons(llc2->llc_un.type_snap.ether_type);
+       if (ether_type < ETHERMTU) {
+               struct llc *llc2 = (struct llc *)(eh1 + 1);
+
+               if ((*mp)->m_len >= ETHER_HDR_LEN + 8 &&
+                   llc2->llc_dsap == LLC_SNAP_LSAP &&
+                   llc2->llc_ssap == LLC_SNAP_LSAP &&
+                   llc2->llc_control == LLC_UI) {
+                       ether_type = htons(llc2->llc_un.type_snap.ether_type);
                        snap = 1;
-                }
-        }
+               }
+       }
 
        /*
         * If we're trying to filter bridge traffic, don't look at anything
@@ -2659,46 +2659,46 @@
                if (ip == NULL) goto bad;
        }
 
-        switch (m->m_pkthdr.csum_flags &
-                ((m_get_rcvif_NOMPSAFE(m)->if_csum_flags_rx & M_CSUM_IPv4) |
-                 M_CSUM_IPv4_BAD)) {
-        case M_CSUM_IPv4|M_CSUM_IPv4_BAD:
-                /* INET_CSUM_COUNTER_INCR(&ip_hwcsum_bad); */
-                goto bad;
-
-        case M_CSUM_IPv4:
-                /* Checksum was okay. */
-                /* INET_CSUM_COUNTER_INCR(&ip_hwcsum_ok); */
-                break;
-
-        default:
-                /* Must compute it ourselves. */
-                /* INET_CSUM_COUNTER_INCR(&ip_swcsum); */
-                if (in_cksum(m, hlen) != 0)
-                        goto bad;
-                break;
-        }
-
-        /* Retrieve the packet length. */
-        len = ntohs(ip->ip_len);
-
-        /*
-         * Check for additional length bogosity
-         */
-        if (len < hlen) {
+       switch (m->m_pkthdr.csum_flags &
+               ((m_get_rcvif_NOMPSAFE(m)->if_csum_flags_rx & M_CSUM_IPv4) |
+                M_CSUM_IPv4_BAD)) {
+       case M_CSUM_IPv4|M_CSUM_IPv4_BAD:
+               /* INET_CSUM_COUNTER_INCR(&ip_hwcsum_bad); */
+               goto bad;
+
+       case M_CSUM_IPv4:
+               /* Checksum was okay. */
+               /* INET_CSUM_COUNTER_INCR(&ip_hwcsum_ok); */
+               break;
+
+       default:
+               /* Must compute it ourselves. */
+               /* INET_CSUM_COUNTER_INCR(&ip_swcsum); */
+               if (in_cksum(m, hlen) != 0)
+                       goto bad;
+               break;
+       }
+
+       /* Retrieve the packet length. */
+       len = ntohs(ip->ip_len);
+
+       /*
+        * Check for additional length bogosity
+        */
+       if (len < hlen) {
                ip_statinc(IP_STAT_BADLEN);
-                goto bad;
-        }
-
-        /*
-         * Check that the amount of data in the buffers
-         * is as at least much as the IP header would have us expect.
-         * Drop packet if shorter than we expect.
-         */
-        if (m->m_pkthdr.len < len) {
+               goto bad;
+       }
+
+       /*
+        * Check that the amount of data in the buffers
+        * is as at least much as the IP header would have us expect.
+        * Drop packet if shorter than we expect.
+        */
+       if (m->m_pkthdr.len < len) {
                ip_statinc(IP_STAT_TOOSHORT);
-                goto bad;
-        }
+               goto bad;
+       }
 
        /* Checks out, proceed */
        *mp = m;
@@ -2721,37 +2721,37 @@
        struct mbuf *m = *mp;
        struct ip6_hdr *ip6;
 
-        /*
-         * If the IPv6 header is not aligned, slurp it up into a new
-         * mbuf with space for link headers, in the event we forward
-         * it.  Otherwise, if it is aligned, make sure the entire base
-         * IPv6 header is in the first mbuf of the chain.
-         */
-        if (IP6_HDR_ALIGNED_P(mtod(m, void *)) == 0) {
-                struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
-                if ((m = m_copyup(m, sizeof(struct ip6_hdr),
-                                  (max_linkhdr + 3) & ~3)) == NULL) {
-                        /* XXXJRT new stat, please */
+       /*
+        * If the IPv6 header is not aligned, slurp it up into a new
+        * mbuf with space for link headers, in the event we forward
+        * it.  Otherwise, if it is aligned, make sure the entire base
+        * IPv6 header is in the first mbuf of the chain.
+        */
+       if (IP6_HDR_ALIGNED_P(mtod(m, void *)) == 0) {
+               struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
+               if ((m = m_copyup(m, sizeof(struct ip6_hdr),
+                                 (max_linkhdr + 3) & ~3)) == NULL) {
+                       /* XXXJRT new stat, please */
                        ip6_statinc(IP6_STAT_TOOSMALL);
-                        in6_ifstat_inc(inifp, ifs6_in_hdrerr);
-                        goto bad;
-                }
-        } else if (__predict_false(m->m_len < sizeof(struct ip6_hdr))) {
-                struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
-                if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {
+                       in6_ifstat_inc(inifp, ifs6_in_hdrerr);
+                       goto bad;
+               }
+       } else if (__predict_false(m->m_len < sizeof(struct ip6_hdr))) {
+               struct ifnet *inifp = m_get_rcvif_NOMPSAFE(m);
+               if ((m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) {
                        ip6_statinc(IP6_STAT_TOOSMALL);
-                        in6_ifstat_inc(inifp, ifs6_in_hdrerr);
-                        goto bad;
-                }
-        }
-
-        ip6 = mtod(m, struct ip6_hdr *);
-
-        if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
+                       in6_ifstat_inc(inifp, ifs6_in_hdrerr);
+                       goto bad;
+               }
+       }
+
+       ip6 = mtod(m, struct ip6_hdr *);
+
+       if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
                ip6_statinc(IP6_STAT_BADVERS);
-                in6_ifstat_inc(m_get_rcvif_NOMPSAFE(m), ifs6_in_hdrerr);
-                goto bad;
-        }
+               in6_ifstat_inc(m_get_rcvif_NOMPSAFE(m), ifs6_in_hdrerr);
+               goto bad;
+       }
 
        /* Checks out, proceed */
        *mp = m;



Home | Main Index | Thread Index | Old Index