From owner-cvs-all@FreeBSD.ORG Thu May 4 18:33:37 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFCCE16A405; Thu, 4 May 2006 18:33:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FF6A43D48; Thu, 4 May 2006 18:33:37 +0000 (GMT) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k44IXbL0020148; Thu, 4 May 2006 18:33:37 GMT (envelope-from bz@repoman.freebsd.org) Received: (from bz@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k44IXbSW020147; Thu, 4 May 2006 18:33:37 GMT (envelope-from bz) Message-Id: <200605041833.k44IXbSW020147@repoman.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 4 May 2006 18:33:37 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/net route.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2006 18:33:38 -0000 bz 2006-05-04 18:33:37 UTC FreeBSD src repository Modified files: sys/net route.c Log: In rtrequest and rtinit check for sa_len != 0 for the given destination. These checks are needed so we do not install a route looking like this: (0) 192.0.2.200 UH tun0 => When removing this route the kernel will start to walk the address space which looks like a hang on 64bit platforms because it'll take ages while on 32bit you should see a panic when kernel debugging options are turned on. The problem is in rtrequest1: if (netmask) { rt_maskedcopy(dst, ndst, netmask); } else bcopy(dst, ndst, dst->sa_len); In both cases the len might be 0 if the application forgot to set it. If so ndst will be all-zero leading to above mentioned strange routes. This is an application error but we must not fail/hang/panic because of this. Looks ok: gnn No objections: net@ (silence) MFC after: 8 weeks Revision Changes Path 1.115 +6 -0 src/sys/net/route.c