From owner-cvs-src-old@FreeBSD.ORG Thu Sep 9 06:44:42 2010 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 8D93310656E1 for ; Thu, 9 Sep 2010 06:44:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 61EEF8FC16 for ; Thu, 9 Sep 2010 06:44:42 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o896igR8021437 for ; Thu, 9 Sep 2010 06:44:42 GMT (envelope-from bz@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o896igN0021436 for cvs-src-old@freebsd.org; Thu, 9 Sep 2010 06:44:42 GMT (envelope-from bz@repoman.freebsd.org) Message-Id: <201009090644.o896igN0021436@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to bz@repoman.freebsd.org using -f From: "Bjoern A. Zeeb" Date: Thu, 9 Sep 2010 06:44:22 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/netinet ip_input.c ip_var.h src/sys/netinet6 ip6_input.c ip6_var.h 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: Thu, 09 Sep 2010 06:44:42 -0000 bz 2010-09-09 06:44:22 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/netinet ip_input.c ip_var.h sys/netinet6 ip6_input.c ip6_var.h Log: SVN rev 212352 on 2010-09-09 06:44:22Z by bz MFC r212155: MFp4 CH=183052 183053 183258: In protosw we define pr_protocol as short, while on the wire it is an uint8_t. That way we can have "internal" protocols like DIVERT, SEND or gaps for modules (PROTO_SPACER). Switch ipproto_{un,}register to accept a short protocol number(*) and do an upfront check for valid boundries. With this we also consistently report EPROTONOSUPPORT for out of bounds protocols, as we did for proto == 0. This allows a caller to not error for this case, which is especially important if we want to automatically call these from domain handling. (*) the functions have been without any in-tree consumer since the initial introducation, so this is considered save. Implement ip6proto_{un,}register() similarly to their legacy IP counter parts to allow modules to hook up dynamically. Reviewed by: philip, will Revision Changes Path 1.332.2.6 +6 -10 src/sys/netinet/ip_input.c 1.101.2.2 +2 -2 src/sys/netinet/ip_var.h 1.95.2.9 +58 -0 src/sys/netinet6/ip6_input.c 1.39.2.8 +3 -0 src/sys/netinet6/ip6_var.h