From owner-cvs-src-old@FreeBSD.ORG Fri Dec 26 19:50:36 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B4A106564A for ; Fri, 26 Dec 2008 19:50:36 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EC80C8FC13 for ; Fri, 26 Dec 2008 19:50:35 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBQJoZ5h076292 for ; Fri, 26 Dec 2008 19:50:35 GMT (envelope-from qingli@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBQJoZlj076291 for cvs-src-old@freebsd.org; Fri, 26 Dec 2008 19:50:35 GMT (envelope-from qingli@repoman.freebsd.org) Message-Id: <200812261950.mBQJoZlj076291@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to qingli@repoman.freebsd.org using -f From: Qing Li Date: Fri, 26 Dec 2008 19:45:24 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/net route.h rtsock.c src/sys/netinet in.c src/sys/netinet6 in6.c src/usr.sbin/arp arp.c src/usr.sbin/ndp ndp.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Dec 2008 19:50:36 -0000 qingli 2008-12-26 19:45:24 UTC FreeBSD src repository Modified files: sys/net route.h rtsock.c sys/netinet in.c sys/netinet6 in6.c usr.sbin/arp arp.c usr.sbin/ndp ndp.c Log: SVN rev 186500 on 2008-12-26 19:45:24Z by qingli This checkin addresses a couple of issues: 1. The "route" command allows route insertion through the interface-direct option "-iface". During if_attach(), an sockaddr_dl{} entry is created for the interface and is part of the interface address list. This sockaddr_dl{} entry describes the interface in detail. The "route" command selects this entry as the "gateway" object when the "-iface" option is present. The "arp" and "ndp" commands also interact with the kernel through the routing socket when adding and removing static L2 entries. The static L2 information is also provided through the "gateway" object with an AF_LINK family type, similar to what is provided by the "route" command. In order to differentiate between these two types of operations, a RTF_LLDATA flag is introduced. This flag is set by the "arp" and "ndp" commands when issuing the add and delete commands. This flag is also set in each L2 entry returned by the kernel. The "arp" and "ndp" command follows a convention where a RTM_GET is issued first followed by a RTM_ADD/DELETE. This RTM_GET request fills in the fields for a "rtm" object, which is reinjected into the kernel by a subsequent RTM_ADD/DELETE command. The entry returend from RTM_GET is a prefix route, so the RTF_LLDATA flag must be specified when issuing the RTM_ADD/DELETE messages. 2. Enforce the convention that NET_RT_FLAGS with a 0 w_arg is the specification for retrieving L2 information. Also optimized the code logic. Reviewed by: julian Revision Changes Path 1.78 +1 -0 src/sys/net/route.h 1.159 +21 -7 src/sys/net/rtsock.c 1.113 +1 -1 src/sys/netinet/in.c 1.93 +1 -1 src/sys/netinet6/in6.c 1.70 +2 -1 src/usr.sbin/arp/arp.c 1.25 +2 -1 src/usr.sbin/ndp/ndp.c