From owner-freebsd-arch Fri Oct 25 16:28: 5 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E176637B401 for ; Fri, 25 Oct 2002 16:28:03 -0700 (PDT) Received: from stash.attlabs.att.com (mpfg.attlabs.net [12.106.35.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id D486C43E6E for ; Fri, 25 Oct 2002 16:28:02 -0700 (PDT) (envelope-from fenner@research.att.com) Received: from stash.attlabs.att.com (localhost [IPv6:::1]) by stash.attlabs.att.com (8.12.6/8.12.6) with ESMTP id g9PNRuHZ001127 for ; Fri, 25 Oct 2002 16:27:56 -0700 (PDT) (envelope-from fenner@stash.attlabs.att.com) Received: (from fenner@localhost) by stash.attlabs.att.com (8.12.6/8.12.6/Submit) id g9PNRtUw001126 for arch@freebsd.org; Fri, 25 Oct 2002 16:27:55 -0700 (PDT) (envelope-from fenner) Date: Fri, 25 Oct 2002 16:27:55 -0700 (PDT) From: Bill Fenner Message-Id: <200210252327.g9PNRtUw001126@stash.attlabs.att.com> To: arch@freebsd.org Subject: Renumbering IPPROTO_DIVERT Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'd like to move IPPROTO_DIVERT out of the legitimate space of IP protocol numbers. Here's the patch: Index: in.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/in.h,v retrieving revision 1.72 diff -u -r1.72 in.h --- in.h 21 Oct 2002 20:40:02 -0000 1.72 +++ in.h 25 Oct 2002 21:13:20 -0000 @@ -236,12 +236,12 @@ #define IPPROTO_PIM 103 /* Protocol Independent Mcast */ #define IPPROTO_PGM 113 /* PGM */ /* 255: Reserved */ -/* BSD Private, local use, namespace incursion */ -#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */ #define IPPROTO_MAX 256 /* last return value of *_input(), meaning "all job for this pkt is done". */ #define IPPROTO_DONE 257 + +#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */ /* * Local port number conventions: Yup, it Just Works. Even better, with a patch to raw_ip.c, divert-using applications can now get an error from their socket() call when DIVERT isn't compiled in, as opposed to the current behavior where socket() would succeed but provide the normal raw IP semantics. Now, the backwards compatability question: applications using the old DIVERT interface will now start getting real raw IP sockets with protocol 254. This will generally cause silent failures, or possibly unexpected behavior (just like if DIVERT wasn't compiled into the kernel). Should there be e.g. a kernel printf when an application uses the old divert number, warning that an application is using the old divert interface and needs to be recompiled? Or is it OK to fail silently, as there are few DIVERT consumers and it's the same failure mode as if DIVERT isn't present in the kernel? Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message