From nobody Wed Jul 17 01:19:53 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WNym45RNQz5QfYL for ; Wed, 17 Jul 2024 01:20:04 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WNym44hdPz4f0J; Wed, 17 Jul 2024 01:20:04 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721179204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70jfBbG1vIEgtquho8IAMH/iFHFbMA/OXCci8ZZa/PU=; b=GiF7fv1YMu+p+iC+EQHorp7Fx3BSTVpQQv8OxDncT8DD7dcJxn4oFhybwI1SCpqP4lm1Fq ALupByV+JXcDlX7P3N9CmzMVyoBJxxecWhFiSamFUhdNCS7LGXvPPxLTr0erWxRZ9/pOr4 CTrK6/Uhwxjat+5Z5e9PrTuHuokBeh085YPHHAIC/ovQkbisH/PPuqLE2gimoJZ+47n2na nMyUDO0VuO1spXlQafwMmIA9Lwi2bqMUBHIc/Nnhogr2xtZjwHbNi3hSLT7vzrq6JNrpa2 DBxBHtP6BTey7UvM/pSGMTpu/QaY37qy10hyeaqsqxOLo0l2DJoM84aXn6cWOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721179204; a=rsa-sha256; cv=none; b=sEngw0h8dXDMwWW3ELtDpjXzzm0fmCTgNLlkeoJJrgaocO6onVWS9q0fs80X89ShmMomNr aJCcF0JTxNhRJ6G3PeX4lZNLj6OniwoTVNdWQRepv0JTH9HtiB/NrPV7p74DVorL2N0Up2 vIrHf/UFDi7W0/yYGj6CNQ3bFSR6/MrKNvV/qiQpVG1tQYAk7jXlD7xWJ4/yZS3A8ZZhWN GO75w/BfA3ADVmm9oMXn0o90CwvHFU+ukP3jT61UHB5LHTze1PL62ymAQgQb+kCBYL1ZsU NWOnN4i60ZldNwEJwxyPgZbLoRTKuHkPyMJ7M66Ubd/uxmO/4WJ7NT61yYBtLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721179204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70jfBbG1vIEgtquho8IAMH/iFHFbMA/OXCci8ZZa/PU=; b=QVd4tHNqT/MSK/8KTFCUopmCbha5P0pysAYmc9HNQyeoIG1lngaHtAa7v5qdr+XpukeczG vLxB6r3nGCJdfSEabxZFHZCaN1P0SWOkS8X4j953H1//+IU40eeJhYIucBJGSDeUL/Blxf ihg8jEOj83Kbhkp0qpmk27CB4NyVMsH2hMLUudOgws/STUWMks3YkbGroy2q5HjoHm6SXV H+9PoIu3klsO2MM6LLDd39AUnMTJvVTYy2UqubavvYI+f3ZIaINybvWidcTJCAklWyM9qu iaf966WG3kxiqU5n8b+s1WcKuqRH5kL22k5OzqxCMaCc/OChHxqXhcMi3lNSNw== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WNym33xlYz144F; Wed, 17 Jul 2024 01:20:03 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: flushing default router list upon inet6 route flush From: Zhenlei Huang In-Reply-To: Date: Wed, 17 Jul 2024 09:19:53 +0800 Cc: freebsd-net@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: To: Mark Johnston X-Mailer: Apple Mail (2.3696.120.41.1.8) > On Jul 17, 2024, at 4:04 AM, Mark Johnston wrote: > > Hello, > > When IPv6 SLAAC is configured for an interface, the kernel will update > its default router list upon receipt of a router advertisement. In so > doing it may install a default route; in the kernel this happens in > defrouter_addreq(). > > If one uses "route flush" or "service routing restart" to reset the > routing tables, the default router list is not purged, so a subsequent > RA from the original default router does not update the list, and so > does not re-create the default route, even if one re-runs rtsol(8). > > This appears to be a bug, but I'm not sure where best to fix it. Should > "service routing restart" invoke "ndp -R" to flush the default router > list? That can be a workaround, but not the ideal fix. > Should route(8) handle this as part of a flush command? No, I do not think so. route(8) should handle the routing / FIB parts. IPv6 default route list is maintained as a per AF basis. Handling the default route list via route(8), aka the userland, seems to be more a HACK. > Or > something else? I'd propose that the kernel handle this situation, so that for other cases such as `route -6 delete default`, or route change event from NETLINK socket, the IPv6 SLAAC default router feature can also work as expected. To be precise, `sys/netinet6/nd6_rtr.c` listen on route events and clear the `installed` flag on deleting the previously installed default route, or maybe purge all default route list. Then the next time the kernel receives a RA it re-installs the default route. This IMO may have side effect that user may really want to delete the default route while not providing an explicit default route. I think for that case user should disable accepting RA on the interface ( aka ifconfig em0 inet6 no_radr, or turn on net.inet6.ip6.no_radr globally). How about this proposal ? Best regards, Zhenlei