From owner-freebsd-net@FreeBSD.ORG Thu Jun 2 09:11:30 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FFEC16A41C for ; Thu, 2 Jun 2005 09:11:30 +0000 (GMT) (envelope-from qing.li@bluecoat.com) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6D5643D1F for ; Thu, 2 Jun 2005 09:11:29 +0000 (GMT) (envelope-from qing.li@bluecoat.com) Received: from bcs-mail.bluecoat.com (bcs-mail.bluecoat.com [216.52.23.69]) by whisker.bluecoat.com (8.13.0/8.13.0) with ESMTP id j529BRbx011409 for ; Thu, 2 Jun 2005 02:11:27 -0700 (PDT) Received: from bcs-mail3.bluecoat.com ([10.2.2.59]) by bcs-mail.bluecoat.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 2 Jun 2005 02:11:10 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 2 Jun 2005 02:11:09 -0700 Message-ID: <48D44BB27BDE3840BDF18E59CB169A5C010AF780@bcs-mail3.internal.cacheflow.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: issue with route Thread-Index: AcVnDS0rn+p7NrA8QnOJNrdxqTKxDAARb+PAAAAAL/A= From: "Li, Qing" To: X-OriginalArrivalTime: 02 Jun 2005 09:11:10.0001 (UTC) FILETIME=[042E3210:01C56753] X-Scanned-By: MIMEDefang 2.49 on 216.52.23.28 Subject: issue with route X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2005 09:11:30 -0000 =20 When I issued the following command by accident today: =20 route add default -inet6 fe80:20d:56ff:fe8d:d4b0%fxp0 The netstat shows the following: Internet: Destination Gateway Flags Refs Use Netif Expire default fe80:20d:56ff:fe8d:d4b0%fxp0 UGS 0 0 fxp0 10.9.44/24 link#1 U 1 0 fxp0 10.9.44.175 127.0.0.1 UGHS 0 0 lo0 127.0.0.1 link#4 UH 1 4 lo0 So I went ahead and issued route add 10.1.1.1 -inet6 fe80::1%fxp0=20 Internet: Destination Gateway Flags Refs Use Netif Expire default fe80:20d:56ff:fe8d:d4b0%fxp0 UGS 0 0 fxp0 10.1.1.1 fe80::1%fxp0 UGHS 0 0 fxp0 10.9.44/24 link#1 U 1 0 fxp0 10.9.44.175 127.0.0.1 UGHS 0 0 lo0 127.0.0.1 link#4 UH 1 4 lo0 I verified this behavior on both FreeBSD 5.4 Release and 6.0-CURRENT. I think this behavior is probably not intended and should be treated as a bug. I did a quick patch in sys/net/route.c (it's just as easy in sbin/route.c). ------------- heavygear# cvs diff route.c Index: route.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.108 diff -r1.108 route.c 746c747,748 < if ((flags & RTF_GATEWAY) && !gateway) --- > if (flags & RTF_GATEWAY) { > if (!gateway) 747a750,752 > if (dst && (dst->sa_family !=3D = gateway->sa_family)) > senderr(EPERM); > } ------------- After the patch, ------------- heavygear# route add 10.1.1.1 -inet6 fe80::1%fxp0 route: writing to routing socket: Operation not permitted =20 Comments ? Thanks, -- Qing