NetBSD Problem Report #34276

From bad@atsec.com  Thu Aug 24 18:59:59 2006
Return-Path: <bad@atsec.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 82A6763B8F2
	for <gnats-bugs@gnats.netbsd.org>; Thu, 24 Aug 2006 18:59:59 +0000 (UTC)
Message-Id: <20060824171120.85980A67A@limiting-factor.atsec.com>
Date: Thu, 24 Aug 2006 19:11:20 +0200 (MEST)
From: bad@bsd.de
Reply-To: bad@bsd.de
To: gnats-bugs@NetBSD.org
Subject: inconsistent code in ether_input()
X-Send-Pr-Version: 3.95

>Number:         34276
>Category:       kern
>Synopsis:       ether_input() refernces ec_nvlans inconsitently
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 24 19:00:01 +0000 2006
>Originator:     Christoph Badura
>Release:        NetBSD 3.0_STABLE
>Organization:

>Environment:


System: NetBSD limiting-factor 3.0_STABLE NetBSD 3.0_STABLE (GENERIC_LAPTOP) #1: Fri Aug 11 00:20:07 MEST 2006 root@limiting-factor:/u/2/obj/u/1/src/sys/arch/i386/compile/GENERIC_LAPTOP i386
Architecture: i386
Machine: i386
>Description:

sys/net/if_ethersubr.c contains the following lines in ether_input():

if (ec->ec_nvlans && m_tag_find(m, PACKET_TAG_VLAN, NULL) != NULL) {

and right after that:

if (((struct ethercom *)ifp)->ec_nvlans != 0)

Only one of these lines can be correct because ifp may have been modified
after assigning ec by the bridge code.

I haven't looked at other parts of the code for similar errors.

>How-To-Repeat:

code inspection
>Fix:

not sure. maybe recompute "ec" in the bridge case.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.