From owner-freebsd-arch@freebsd.org Thu Feb 27 09:15:16 2020 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31013259E3B for ; Thu, 27 Feb 2020 09:15:16 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from violet.van-laarhoven.org (violet.van-laarhoven.org [IPv6:2a01:4f8:1c0c:72ba::3]) by mx1.freebsd.org (Postfix) with ESMTP id 48Sn7j0NTnz42fb for ; Thu, 27 Feb 2020 09:15:11 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from [IPv6:2a02:58:4c:6601:892:71b2:497f:a2d5] (unknown [IPv6:2a02:58:4c:6601:892:71b2:497f:a2d5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by violet.van-laarhoven.org (Postfix) with ESMTPSA id 001159CD28 for ; Thu, 27 Feb 2020 10:15:01 +0100 (CET) From: Nick Hibma Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: change divert socket to use a sockaddr_div struct Message-Id: Date: Thu, 27 Feb 2020 10:15:01 +0100 To: FreeBSD Architecture Mailing List X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48Sn7j0NTnz42fb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of nick@van-laarhoven.org designates 2a01:4f8:1c0c:72ba::3 as permitted sender) smtp.mailfrom=nick@van-laarhoven.org X-Spamd-Result: default: False [-2.52 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain,multipart/mixed]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[van-laarhoven.org]; TO_DN_ALL(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-0.82)[ipnet: 2a01:4f8::/29(-2.54), asn: 24940(-1.55), country: DE(-0.02)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~,5:~]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 09:15:16 -0000 Folks, We would like to use FIBs for routing, but currently cannot because the = FIB is lost when the packet goes through a divert socket for processing. = I've attached a patch that should fix this situation, and while there = fix the limit of 7 characters for the interface name which some people = got bitten by. This fix was suggested some time ago by Warner Losh. I've changed the sockaddr_in to a sockaddr_di struct to pass the FIB = number and the complete interface, and other info in and out. But this = seems to lead to memory corruption. Perhaps someone who knows the API = can tell me where I should look for memory corruption issues, because = this patch causes random crashes. I assume it's because of overwriting = random memory. Thanks in advance. Nick Hibma nick@van-laarhoven.org -- Open Source: We stand on the shoulders of giants.