Source-Changes-HG archive

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

[src/trunk]: src/sys/net Per discussion with Jason, change flags filter to



details:   https://anonhg.NetBSD.org/src/rev/cc9c72a156aa
branches:  trunk
changeset: 499278:cc9c72a156aa
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Nov 15 18:15:11 2000 +0000

description:
Per discussion with Jason, change flags filter to
(IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_ALLMULTI | IFF_SIMPLEX)
Also, put the ifp->if_opackets++ at the rigth place so that the counter is
incremented even when the parent is OACTIVE.
Fix a bug in vlan_input where the ethernet src and dst addrs would not be
correct because we only memmove() only ifv->ifv_encaplen instead of
sizeof(struct ether_header).

diffstat:

 sys/net/if_vlan.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 5273ded712dd -r cc9c72a156aa sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Wed Nov 15 16:15:01 2000 +0000
+++ b/sys/net/if_vlan.c Wed Nov 15 18:15:11 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vlan.c,v 1.22 2000/11/15 01:02:15 thorpej Exp $     */
+/*     $NetBSD: if_vlan.c,v 1.23 2000/11/15 18:15:11 bouyer Exp $      */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -313,7 +313,7 @@
        ifv->ifv_p = p;
        ifv->ifv_if.if_mtu = p->if_mtu - ifv->ifv_mtufudge;
        ifv->ifv_if.if_flags = p->if_flags &
-           (IFF_UP | IFF_BROADCAST | IFF_RUNNING | IFF_ALLMULTI | IFF_SIMPLEX);
+           (IFF_UP | IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
 
        /*
         * Inherit the if_type from the parent.  This allows us
@@ -738,9 +738,9 @@
                }
        
                IF_ENQUEUE(&p->if_snd, m);
+               ifp->if_opackets++;
                if ((p->if_flags & IFF_OACTIVE) == 0) {
                        (*p->if_start)(p);
-                       ifp->if_opackets++;
                }
        }
 
@@ -809,7 +809,7 @@
         * header has already been fixed up above.
         */
        memmove(mtod(m, caddr_t) + ifv->ifv_encaplen, mtod(m, caddr_t),
-           ifv->ifv_encaplen);
+           sizeof(struct ether_header));
        m_adj(m, ifv->ifv_encaplen);
 
        m->m_pkthdr.rcvif = &ifv->ifv_if;



Home | Main Index | Thread Index | Old Index