From owner-freebsd-net@freebsd.org Fri Mar 1 02:57:15 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 581C215008B3 for ; Fri, 1 Mar 2019 02:57:15 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670050.outbound.protection.outlook.com [40.107.67.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88C86701D5; Fri, 1 Mar 2019 02:57:13 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM (52.132.89.15) by QB1PR01MB3091.CANPRD01.PROD.OUTLOOK.COM (52.132.88.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.16; Fri, 1 Mar 2019 02:57:11 +0000 Received: from QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM ([fe80::609b:1ecd:c908:d44c]) by QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM ([fe80::609b:1ecd:c908:d44c%6]) with mapi id 15.20.1643.022; Fri, 1 Mar 2019 02:57:11 +0000 From: Rick Macklem To: "Bjoern A. Zeeb" CC: FreeBSD Net , "rgrimes@freebsd.org" Subject: Re: use of #ifdef INET and #ifdef INET6 in the kernel sources Thread-Topic: use of #ifdef INET and #ifdef INET6 in the kernel sources Thread-Index: AQHUzwGwHmKnVmR//0yzd/zC2ycfBaX0bvqAgAGlN+0= Date: Fri, 1 Mar 2019 02:57:11 +0000 Message-ID: References: , <8EDE90B3-0C33-47B5-88D8-964B131AEE2E@FreeBSD.org> In-Reply-To: <8EDE90B3-0C33-47B5-88D8-964B131AEE2E@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6f273af4-b8b0-45ae-5180-08d69df199f6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:QB1PR01MB3091; x-ms-traffictypediagnostic: QB1PR01MB3091: x-microsoft-exchange-diagnostics: =?Windows-1252?Q?1; QB1PR01MB3091; 23:eOZYGKOlT6Xu4IG6bjpHWQ4euwjEEXvTq9B/c?= =?Windows-1252?Q?zeGxEFC+1A32FpePKbSVjiFXdzWnoy4mINe8kTIB7BObtQd1yD+xa5H8?= =?Windows-1252?Q?oj61iB1WAd4milp5WAQz9vGJ+7/53OnJHkbadEZxcvJDRih0LdqubD+4?= =?Windows-1252?Q?yiUlRbUy0nv0symjW8HEZ4IpikMovI97KkPgbRxgXZOCe/2RO6M4uoH8?= =?Windows-1252?Q?tOm+zp/ZY4TclciWZwhNVVhFm7o9EAaVL2dlpxT0cZ06HiX0dcheG7gk?= =?Windows-1252?Q?kHnFk8ECxIj5yHZnjt/5m22H6gjHW3Qfg2ZrXPc9Xr+8PUQ0oZq8HLyY?= =?Windows-1252?Q?MuVgWT9CRddYfqAxNYGOGTWOp3+DfL/HWIcmnMC5o7v5KQFysoksMISM?= =?Windows-1252?Q?DK0287fb32a4Q/jZazmEp4cNLZwjLo6SXsO3I9xbRMauXGAi8HZOk3m2?= =?Windows-1252?Q?ONLeuQ+QnrZ2v19jPsMu3/PmM3+zZLu026DNAOAwszrFETSR9MNkG6K4?= =?Windows-1252?Q?1fU/LxNBZqKqITxkrgNWb4DiJtqGGPfI6UqYAi0eIrMWSR/lXPt37oFj?= =?Windows-1252?Q?aKfIWjW1EAFa4Ve4HiZW3dFieyTg5XPFlXwJ8bQLG+M5RJQYy+bE5yMe?= =?Windows-1252?Q?azQSqt7xrWvWOqQ2vk/mMB5qEGfG7QPaR0CJAhJxyrzwIPgJgQeGGWZ2?= =?Windows-1252?Q?KofEryFDvn3Asilbly46sVTNE04VEmPtgner79fHPSxRe866PrcdH6+R?= =?Windows-1252?Q?/L9FV6NDLMD5EGwq3Ml6M0SBSKeA/mRoELO8niQqcGlGS/8HclpR8GK1?= =?Windows-1252?Q?Jw8lj1j+3+A+pKJpxDcaJG1g7gRSof6bw9aUTAfBrfQZHKRcur3rwkRw?= =?Windows-1252?Q?yoekTAv1F7GMXS44KQGMxo9UMqZo09j6F/v0DqXJXnTRhufgNjUsMZOG?= =?Windows-1252?Q?WgCBoXa3aTMDgHKFB0hA1I2NClU9ZGHgxbshSbzYuH9MRhvMkKLvem1w?= =?Windows-1252?Q?b823IxMj3/yC2LT10RILNtSW5SOrlA2mVlxyUxKC3X4cWdD95ULKYubj?= =?Windows-1252?Q?0QTozepMO0Ygzw6Bzj7kp05tniKV/G9Kh5mVtNQ7PlnveH8/dc6/fMn4?= =?Windows-1252?Q?87YdKag2CP37j5Sdy6I50LbmmcwQh90M9fg/XjbctXRS5luL19spMqWB?= =?Windows-1252?Q?azRt2n6zsfX6ScI9JegrvUKwsqrKzMKZQvW8lPJO6+nbKLW44634NOa0?= =?Windows-1252?Q?J1yfvYHGqzC3rUQJ2w2dj5lm74pdJiHyTxuq0E=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09634B1196 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(376002)(346002)(396003)(366004)(189003)(199004)(74316002)(81166006)(2906002)(316002)(786003)(54906003)(81156014)(6246003)(450100002)(4326008)(25786009)(8936002)(8676002)(74482002)(305945005)(6916009)(5660300002)(486006)(71190400001)(71200400001)(68736007)(256004)(99286004)(476003)(9686003)(55016002)(86362001)(33656002)(11346002)(106356001)(6436002)(7696005)(76176011)(229853002)(446003)(105586002)(102836004)(6506007)(97736004)(14454004)(478600001)(53936002)(186003)(46003); DIR:OUT; SFP:1101; SCL:1; SRVR:QB1PR01MB3091; H:QB1PR01MB3537.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7ckjeCUxzrVpISTOhH1QOGidAqAiqw0ZV6W6SrboicYm+mfm+s7D0icAgK+x4/rGqtawftI3xVm39J74+qVMTzad3IS8RIDg21dT3W8IwKjV6axNyp0s9wcgx0ar2DiLJGXJJ06xjOTUAAWbj3CCu1jS16WTdIeaZtrl+w+QIEusYJbGawgo90QcfslI2MHRo+ThGqUXmHOLVDDNCBJizayQdp9URMaTbbQI3FpDat4sDS7yO0DNAgiolwkVsIDHtG3WyUJP4IoTuQjbkd5/shj7NBQuGan6VwVJOU6S9VmW76U9PWhI2O5jJ1X3ZCqP8Q4MKW+lsQSj1WoQBsC5gem8j3+UoRBx63qQTF/e359cwqaaqQXCqxBv0Ye2Ck0S6DcwK0cjYsAh/jfKZp4qMdow1b00ElgVdj8TdZ7EUdQ= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 6f273af4-b8b0-45ae-5180-08d69df199f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2019 02:57:11.4909 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: QB1PR01MB3091 X-Rspamd-Queue-Id: 88C86701D5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 40.107.67.50 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-3.63 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.90)[ipnet: 40.64.0.0/10(-2.22), asn: 8075(-2.21), country: US(-0.07)]; MX_GOOD(-0.01)[mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com,mx2.hc184-76.ca.iphmx.com,mx1.hc184-76.ca.iphmx.com]; NEURAL_HAM_SHORT(-0.42)[-0.420,0]; RCVD_IN_DNSWL_NONE(0.00)[50.67.107.40.list.dnswl.org : 127.0.3.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 02:57:15 -0000 Bjoern A. Zeeb wrote: [stuff snipped] I wrote: >> So, is this still recommended for blocks of code that only execute for >> the version >> of IP, but will build for kernels that do not have the particular >> "options INET{6}" >> in the kernel config? > >Yes. Ok, I'll do it. >> If it is still recommended, I will do it, but I'll admit I don't >> understand why it should >> be done? (All it does is reduce the size of the executable by a small >> amount and >> that doesn't seem significant to me.) > >That small amount is still relevant on some devices where people go to >great lengths to fit our constantly growing base into a tiny small >thingy. I doubt NFS gets squeezed into such devices and, yes, it is a small amount. Using source line counts via "wc" (ir includes comments, etc): - This will reduce the # of lines by about 6 for a module of about 7700 li= nes which is loaded when either the nfscl or nfsserver modules are loaded. (These are both about 25000 lines and require the krpc, which is another= 10000. I haven't included the Kerberos stuff, because I can't remember if tha= t gets loaded unless Kerberos mounts get used.) --> A savings of 6 lines in something like 43000. >And it allows you to lose code from your kernel that you don=92t >need/want, such as if you=92d want to rip out all INET sources from a >tree. Ok, I can buy into this argument. I doubt I'll see IPv4 removed in my lifet= ime, but it does document where the code is. (In Canada, network providers only give out IPv4 addresses to end users, fr= om what I've seen.) >I know both of these groups still do exist. > >Also every code not compiled in is not an attack surface, where you >think it=92s executed or not. rick