From owner-freebsd-arch@freebsd.org Thu Mar 5 16:29:52 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 801BC26DD11 for ; Thu, 5 Mar 2020 16:29:52 +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 48YGRy5WzNz3R2W for ; Thu, 5 Mar 2020 16:29:50 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from [192.168.177.3] (D4B295F2.static.ziggozakelijk.nl [212.178.149.242]) (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 DDED29CE59; Thu, 5 Mar 2020 17:29:37 +0100 (CET) From: Nick Hibma Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: change divert socket to use a sockaddr_div struct Date: Thu, 5 Mar 2020 17:29:36 +0100 In-Reply-To: <8181583419268@vla1-c477e3898c96.qloud-c.yandex.net> Cc: FreeBSD Architecture Mailing List To: "Alexander V. Chernikov" References: <8181583419268@vla1-c477e3898c96.qloud-c.yandex.net> X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48YGRy5WzNz3R2W 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 [-1.12 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.59)[-0.594,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[van-laarhoven.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-0.83)[ipnet: 2a01:4f8::/29(-2.55), asn: 24940(-1.56), 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:~]; 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, 05 Mar 2020 16:29:52 -0000 Thanks for the prod. I've created a diff in Phabricator: https://reviews.freebsd.org/D23972 I would appreciate comments on this. Nick Hibma nick@van-laarhoven.org -- Open Source: We stand on the shoulders of giants. > On 05/03 /2020, at 15:42, Alexander V. Chernikov = wrote: >=20 > 27.02.2020, 09:16, "Nick Hibma" : >> Folks, > Hi Nick, >>=20 >> 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. > It looks like the patch got stripped by the mailing list. > Could you please publish it on https://reviews.freebsd.org ? >>=20 >> 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. >>=20 >> Thanks in advance. >>=20 >> Nick Hibma >> nick@van-laarhoven.org >>=20 >> -- Open Source: We stand on the shoulders of giants. >>=20 >> _______________________________________________ >> freebsd-arch@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-arch >> To unsubscribe, send any mail to = "freebsd-arch-unsubscribe@freebsd.org" >=20