Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 more whitespace/comment sync with kame



details:   https://anonhg.NetBSD.org/src/rev/a2cd4d206129
branches:  trunk
changeset: 516108:a2cd4d206129
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Oct 16 06:24:44 2001 +0000

description:
more whitespace/comment sync with kame

diffstat:

 sys/netinet6/in6_src.c    |   4 +-
 sys/netinet6/in6_var.h    |   4 +-
 sys/netinet6/ip6_input.c  |  28 +++++++++++------------
 sys/netinet6/ip6_mroute.c |  55 +++++++++++++++++++++++-----------------------
 sys/netinet6/ipsec.c      |  12 +++++-----
 sys/netinet6/ipsec.h      |  10 ++++----
 sys/netinet6/mld6.c       |   5 ++-
 sys/netinet6/nd6.c        |  48 ++++++++++++++++++++++------------------
 sys/netinet6/nd6_nbr.c    |  23 +++++++++++++-----
 sys/netinet6/nd6_rtr.c    |  14 +++++-----
 sys/netinet6/route6.c     |   4 +-
 11 files changed, 110 insertions(+), 97 deletions(-)

diffs (truncated from 563 to 300 lines):

diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c    Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/in6_src.c    Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_src.c,v 1.7 2001/06/06 06:07:06 mrg Exp $  */
+/*     $NetBSD: in6_src.c,v 1.8 2001/10/16 06:24:44 itojun Exp $       */
 /*     $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $        */
 
 /*
@@ -458,7 +458,7 @@
                        if (scopeid < 0 || if_index < scopeid)
                                return ENXIO;  /* XXX EINVAL? */
                        ifp = ifindex2ifnet[scopeid];
-                       /*XXX assignment to 16bit from 32bit variable */
+                       /* XXX assignment to 16bit from 32bit variable */
                        in6->s6_addr16[1] = htons(scopeid & 0xffff);
                }
 
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h    Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/in6_var.h    Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_var.h,v 1.19 2001/07/18 13:12:28 itojun Exp $      */
+/*     $NetBSD: in6_var.h,v 1.20 2001/10/16 06:24:44 itojun Exp $      */
 /*     $KAME: in6_var.h,v 1.53 2001/02/10 02:44:27 itojun Exp $        */
 
 /*
@@ -491,7 +491,7 @@
 
 /*
  * Structure used by macros below to remember position when stepping through
- * all of eht in6_multi records.
+ * all of the in6_multi records.
  */
 struct in6_multistep {
        struct  in6_ifaddr *i_ia;
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c  Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/ip6_input.c  Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_input.c,v 1.43 2001/10/15 09:51:17 itojun Exp $    */
+/*     $NetBSD: ip6_input.c,v 1.44 2001/10/16 06:24:44 itojun Exp $    */
 /*     $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $     */
 
 /*
@@ -250,7 +250,7 @@
 #endif
 
        /*
-        * mbuf statistics by kazu
+        * mbuf statistics
         */
        if (m->m_flags & M_EXT) {
                if (m->m_next)
@@ -261,7 +261,7 @@
 #define M2MMAX (sizeof(ip6stat.ip6s_m2m)/sizeof(ip6stat.ip6s_m2m[0]))
                if (m->m_next) {
                        if (m->m_flags & M_LOOP) {
-                               ip6stat.ip6s_m2m[loif[0].if_index]++;   /*XXX*/
+                               ip6stat.ip6s_m2m[loif[0].if_index]++; /* XXX */
                        } else if (m->m_pkthdr.rcvif->if_index < M2MMAX)
                                ip6stat.ip6s_m2m[m->m_pkthdr.rcvif->if_index]++;
                        else
@@ -324,11 +324,9 @@
        }
 #endif /* PFIL_HOOKS */
 
-
        ip6stat.ip6s_nxthist[ip6->ip6_nxt]++;
 
 #ifdef ALTQ
-       /* XXX Temporary until ALTQ is changed to use a pfil hook */
        if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) {
                /* packet is dropped by traffic conditioner */
                return;
@@ -336,7 +334,7 @@
 #endif
 
        /*
-        * Scope check
+        * Check against address spoofing/corruption.
         */
        if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src) ||
            IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst)) {
@@ -345,16 +343,16 @@
                goto bad;
        }
        /*
-        * The following check is not documented in the spec.  Malicious party
-        * may be able to use IPv4 mapped addr to confuse tcp/udp stack and
-        * bypass security checks (act as if it was from 127.0.0.1 by using
-        * IPv6 src ::ffff:127.0.0.1).  Be cautious.
+        * The following check is not documented in specs.  A malicious
+        * party may be able to use IPv4 mapped addr to confuse tcp/udp stack
+        * and bypass security checks (act as if it was from 127.0.0.1 by using
+        * IPv6 src ::ffff:127.0.0.1).  Be cautious.
         *
-        * This check chokes if we are in SIIT cloud.  As none of BSDs support
-        * IPv4-less kernel compilation, we cannot support SIIT environment
-        * at all.  So, it makes more sense for us to reject any malicious
-        * packets for non-SIIT environment, than try to do a partical support
-        * for SIIT environment.
+        * This check chokes if we are in an SIIT cloud.  As none of BSDs
+        * support IPv4-less kernel compilation, we cannot support SIIT
+        * environment at all.  So, it makes more sense for us to reject any
+        * malicious packets for non-SIIT environment, than try to do a
+        * partical support for SIIT environment.
         */
        if (IN6_IS_ADDR_V4MAPPED(&ip6->ip6_src) ||
            IN6_IS_ADDR_V4MAPPED(&ip6->ip6_dst)) {
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/ip6_mroute.c Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_mroute.c,v 1.22 2001/07/25 09:23:46 itojun Exp $   */
+/*     $NetBSD: ip6_mroute.c,v 1.23 2001/10/16 06:24:44 itojun Exp $   */
 /*     $KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $     */
 
 /*
@@ -240,15 +240,15 @@
                return EACCES;
 
        switch (cmd) {
-        case MRT6_OINIT:     return ip6_mrouter_init(so, m, cmd);
-        case MRT6_INIT:      return ip6_mrouter_init(so, m, cmd);
-        case MRT6_DONE:      return ip6_mrouter_done();
-        case MRT6_ADD_MIF:   return add_m6if(mtod(m, struct mif6ctl *));
-        case MRT6_DEL_MIF:   return del_m6if(mtod(m, mifi_t *));
-        case MRT6_ADD_MFC:   return add_m6fc(mtod(m, struct mf6cctl *));
-        case MRT6_DEL_MFC:   return del_m6fc(mtod(m, struct mf6cctl *));
-        case MRT6_PIM:       return set_pim6(mtod(m, int *));
-        default:            return EOPNOTSUPP;
+       case MRT6_OINIT:        return ip6_mrouter_init(so, m, cmd);
+       case MRT6_INIT:         return ip6_mrouter_init(so, m, cmd);
+       case MRT6_DONE:         return ip6_mrouter_done();
+       case MRT6_ADD_MIF:      return add_m6if(mtod(m, struct mif6ctl *));
+       case MRT6_DEL_MIF:      return del_m6if(mtod(m, mifi_t *));
+       case MRT6_ADD_MFC:      return add_m6fc(mtod(m, struct mf6cctl *));
+       case MRT6_DEL_MFC:      return del_m6fc(mtod(m, struct mf6cctl *));
+       case MRT6_PIM:          return set_pim6(mtod(m, int *));
+       default:                return EOPNOTSUPP;
        }
 }
 
@@ -268,10 +268,11 @@
        *m = mb = m_get(M_WAIT, MT_SOOPTS);
 
        switch (cmd) {
-        case MRT6_PIM:       return get_pim6(mb);
-        default:
-                m_free(mb);
-                return EOPNOTSUPP;
+       case MRT6_PIM:
+               return get_pim6(mb);
+       default:
+               m_free(mb);
+               return EOPNOTSUPP;
        }
 }
 
@@ -283,20 +284,20 @@
        int cmd;
        caddr_t data;
 {
-    int error = 0;
+       int error = 0;
 
-    switch (cmd) {
-     case SIOCGETSGCNT_IN6:
-            return(get_sg_cnt((struct sioc_sg_req6 *)data));
-            break;             /* for safety */
-     case SIOCGETMIFCNT_IN6:
-            return(get_mif6_cnt((struct sioc_mif_req6 *)data));
-            break;             /* for safety */
-     default:
-            return (EINVAL);
-            break;
-    }
-    return error;
+       switch (cmd) {
+       case SIOCGETSGCNT_IN6:
+               return(get_sg_cnt((struct sioc_sg_req6 *)data));
+               break;          /* for safety */
+       case SIOCGETMIFCNT_IN6:
+               return(get_mif6_cnt((struct sioc_mif_req6 *)data));
+               break;          /* for safety */
+       default:
+               return (EINVAL);
+               break;
+       }
+       return error;
 }
 
 /*
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/ipsec.c
--- a/sys/netinet6/ipsec.c      Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/ipsec.c      Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.c,v 1.39 2001/09/16 16:34:40 wiz Exp $   */
+/*     $NetBSD: ipsec.c,v 1.40 2001/10/16 06:24:44 itojun Exp $        */
 /*     $KAME: ipsec.c,v 1.125 2001/09/12 23:01:16 sakane Exp $ */
 
 /*
@@ -320,7 +320,7 @@
  *             0       : bypass
  *             EACCES  : discard packet.
  *             ENOENT  : ipsec_acquire() in progress, maybe.
- *             others  : error occurred.
+ *             others  : error occured.
  *     others: a pointer to SP
  *
  * NOTE: IPv6 mapped adddress concern is implemented here.
@@ -512,7 +512,7 @@
  *             0       : bypass
  *             EACCES  : discard packet.
  *             ENOENT  : ipsec_acquire() in progress, maybe.
- *             others  : error occurred.
+ *             others  : error occured.
  */
 struct secpolicy *
 ipsec4_getpolicybyaddr(m, dir, flag, error)
@@ -572,7 +572,7 @@
  *             0       : bypass
  *             EACCES  : discard packet.
  *             ENOENT  : ipsec_acquire() in progress, maybe.
- *             others  : error occurred.
+ *             others  : error occured.
  *     others: a pointer to SP
  */
 struct secpolicy *
@@ -742,7 +742,7 @@
  *             0       : bypass
  *             EACCES  : discard packet.
  *             ENOENT  : ipsec_acquire() in progress, maybe.
- *             others  : error occurred.
+ *             others  : error occured.
  */
 #ifndef IP_FORWARDING
 #define IP_FORWARDING 1
@@ -3848,4 +3848,4 @@
        }
        /* NOTREACHED */
 }
-#endif /*INET6*/
+#endif /* INET6 */
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/ipsec.h
--- a/sys/netinet6/ipsec.h      Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/ipsec.h      Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipsec.h,v 1.22 2001/08/06 10:25:01 itojun Exp $        */
+/*     $NetBSD: ipsec.h,v 1.23 2001/10/16 06:24:45 itojun Exp $        */
 /*     $KAME: ipsec.h,v 1.51 2001/08/05 04:52:58 itojun Exp $  */
 
 /*
@@ -365,7 +365,7 @@
 extern int ipsec6_get_policy __P((struct in6pcb *in6p, caddr_t request,
        size_t len, struct mbuf **mp));
 extern int ipsec6_in_reject __P((struct mbuf *, struct in6pcb *));
-#endif /*INET6*/
+#endif /* INET6 */
 
 struct secas;
 struct tcpcb;
@@ -417,7 +417,7 @@
 extern int ipsec_sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
 extern int ipsec6_sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
 
-#endif /*_KERNEL*/
+#endif /* _KERNEL */
 
 #ifndef _KERNEL
 extern caddr_t ipsec_set_policy __P((char *, int));
@@ -425,6 +425,6 @@
 extern char *ipsec_dump_policy __P((caddr_t, char *));
 
 extern const char *ipsec_strerror __P((void));
-#endif /*!_KERNEL*/
+#endif /* !_KERNEL */
 
-#endif /*_NETINET6_IPSEC_H_*/
+#endif /* _NETINET6_IPSEC_H_ */
diff -r 30c0b7984603 -r a2cd4d206129 sys/netinet6/mld6.c
--- a/sys/netinet6/mld6.c       Tue Oct 16 05:56:23 2001 +0000
+++ b/sys/netinet6/mld6.c       Tue Oct 16 06:24:44 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mld6.c,v 1.13 2001/02/10 04:14:29 itojun Exp $ */
+/*     $NetBSD: mld6.c,v 1.14 2001/10/16 06:24:45 itojun Exp $ */
 /*     $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $   */
 
 /*
@@ -435,7 +435,8 @@
        mldh->mld6_addr = in6m->in6m_addr;
        if (IN6_IS_ADDR_MC_LINKLOCAL(&mldh->mld6_addr))
                mldh->mld6_addr.s6_addr16[1] = 0; /* XXX */
-       mldh->mld6_cksum = in6_cksum(mh, IPPROTO_ICMPV6, sizeof(struct ip6_hdr),
+       mldh->mld6_cksum = in6_cksum(mh, IPPROTO_ICMPV6,
+                                    sizeof(struct ip6_hdr),
                                     sizeof(struct mld6_hdr));
 
        /* construct multicast option */



Home | Main Index | Thread Index | Old Index