From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 12 15:10:08 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DA0916A402 for ; Thu, 12 Apr 2007 15:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 133A813C484 for ; Thu, 12 Apr 2007 15:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3CFA74U085061 for ; Thu, 12 Apr 2007 15:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3CFA73t085060; Thu, 12 Apr 2007 15:10:07 GMT (envelope-from gnats) Resent-Date: Thu, 12 Apr 2007 15:10:07 GMT Resent-Message-Id: <200704121510.l3CFA73t085060@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thomas Karcher Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A167C16A401 for ; Thu, 12 Apr 2007 15:07:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 8E77913C487 for ; Thu, 12 Apr 2007 15:07:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l3CF76gf007166 for ; Thu, 12 Apr 2007 15:07:06 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l3CF25EK098105; Thu, 12 Apr 2007 15:02:05 GMT (envelope-from nobody) Message-Id: <200704121502.l3CF25EK098105@www.freebsd.org> Date: Thu, 12 Apr 2007 15:02:05 GMT From: Thomas Karcher To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: kern/111515: [patch] in6_setscope() sets scope flags wrong X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2007 15:10:08 -0000 >Number: 111515 >Category: kern >Synopsis: [patch] in6_setscope() sets scope flags wrong >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Apr 12 15:10:07 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Thomas Karcher >Release: RELENG_6_2_0_RELEASE >Organization: >Environment: >Description: In netinet6/scope6.c is a function called "in6_setscope()" which sets the appropriate scope flag for an IPv6 (in my case multicast) address. I think line 475 is not correct, it looks like this: 474 if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) 475 in6->s6_addr16[1] = htons(zoneid & 0xffff); The scope is usually just 8 bits after the 1111 1111 (FF) start of a multicast address. E. g. if I want to sent a multicast over a local link, the address should start with FF02 - the 2 is for link-local scope. Unfortunately, the code above sets 16 bits in the second 16-bit-part of the address, so it starts with FF00:0002 which is simply wrong. I didn't check other parts of the file for the same error. >How-To-Repeat: >Fix: To my extent, it should be as follows: 474 if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) 475 in6->s6_addr8[1] = htons(zoneid & 0xff); >Release-Note: >Audit-Trail: >Unformatted: