Source-Changes-HG archive

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

[src/trunk]: src/sys/net fix my wrong modification



details:   https://anonhg.NetBSD.org/src/rev/55eb1af39533
branches:  trunk
changeset: 343284:55eb1af39533
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Thu Jan 28 00:28:11 2016 +0000

description:
fix my wrong modification

diffstat:

 sys/net/if_stf.c |  24 +++++++++++-------------
 sys/net/if_stf.h |   4 ++--
 2 files changed, 13 insertions(+), 15 deletions(-)

diffs (114 lines):

diff -r 397476867721 -r 55eb1af39533 sys/net/if_stf.c
--- a/sys/net/if_stf.c  Thu Jan 28 00:18:27 2016 +0000
+++ b/sys/net/if_stf.c  Thu Jan 28 00:28:11 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.c,v 1.86 2016/01/26 05:58:05 knakahara Exp $    */
+/*     $NetBSD: if_stf.c,v 1.87 2016/01/28 00:28:11 knakahara Exp $    */
 /*     $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
 
 /*
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.86 2016/01/26 05:58:05 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.87 2016/01/28 00:28:11 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -159,7 +159,7 @@
 
 static const struct encapsw in_stf_encapsw =
 {
-       .encapsw6 = {
+       .encapsw4 = {
                .pr_input       = in_stf_input,
                .pr_ctlinput    = NULL,
        }
@@ -552,8 +552,8 @@
        return 0;
 }
 
-int
-in_stf_input(struct mbuf **mp, int *offp, int proto)
+void
+in_stf_input(struct mbuf *m, int off, int proto)
 {
        int s;
        struct stf_softc *sc;
@@ -562,12 +562,10 @@
        uint8_t otos, itos;
        struct ifnet *ifp;
        size_t pktlen;
-       int off = *offp;
-       struct mbuf *m = *mp;
 
        if (proto != IPPROTO_IPV6) {
                m_freem(m);
-               return IPPROTO_DONE;
+               return;
        }
 
        ip = mtod(m, struct ip *);
@@ -576,7 +574,7 @@
 
        if (sc == NULL || (sc->sc_if.if_flags & IFF_UP) == 0) {
                m_freem(m);
-               return IPPROTO_DONE;
+               return;
        }
 
        ifp = &sc->sc_if;
@@ -588,7 +586,7 @@
        if (stf_checkaddr4(sc, &ip->ip_dst, NULL) < 0 ||
            stf_checkaddr4(sc, &ip->ip_src, m->m_pkthdr.rcvif) < 0) {
                m_freem(m);
-               return IPPROTO_DONE;
+               return;
        }
 
        otos = ip->ip_tos;
@@ -597,7 +595,7 @@
        if (m->m_len < sizeof(*ip6)) {
                m = m_pullup(m, sizeof(*ip6));
                if (!m)
-                       return IPPROTO_DONE;
+                       return;
        }
        ip6 = mtod(m, struct ip6_hdr *);
 
@@ -608,7 +606,7 @@
        if (stf_checkaddr6(sc, &ip6->ip6_dst, NULL) < 0 ||
            stf_checkaddr6(sc, &ip6->ip6_src, m->m_pkthdr.rcvif) < 0) {
                m_freem(m);
-               return IPPROTO_DONE;
+               return;
        }
 
        itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
@@ -640,7 +638,7 @@
        }
        splx(s);
 
-       return IPPROTO_DONE;
+       return;
 }
 
 /* ARGSUSED */
diff -r 397476867721 -r 55eb1af39533 sys/net/if_stf.h
--- a/sys/net/if_stf.h  Thu Jan 28 00:18:27 2016 +0000
+++ b/sys/net/if_stf.h  Thu Jan 28 00:28:11 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.h,v 1.5 2016/01/26 05:58:05 knakahara Exp $     */
+/*     $NetBSD: if_stf.h,v 1.6 2016/01/28 00:28:11 knakahara Exp $     */
 /*     $KAME: if_stf.h,v 1.3 2000/03/25 07:23:33 sumikawa Exp $        */
 
 /*
@@ -37,6 +37,6 @@
 #define        STF_MTU_MIN     (1280)  /* Minimum MTU */
 #define        STF_MTU_MAX     (8192)  /* Maximum MTU */
 
-int    in_stf_input(struct mbuf **, int *, int);
+void   in_stf_input(struct mbuf *, int, int);
 
 #endif /* !_NET_IF_STF_H_ */



Home | Main Index | Thread Index | Old Index