From nobody Mon Oct 17 07:42:29 2022 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 4MrTVV3vnyz4f8PC for ; Mon, 17 Oct 2022 07:42:42 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MrTVT6BwQz3LdJ for ; Mon, 17 Oct 2022 07:42:41 +0000 (UTC) (envelope-from dfr@rabson.org) Received: by mail-vk1-xa31.google.com with SMTP id s185so4967298vkb.0 for ; Mon, 17 Oct 2022 00:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rabson-org.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=1YCMCggLtAuQUjPf3HABhYH1O7mBrH/exmuUBapQjFU=; b=RD3lTmf6Gy7rEwp465pqX3deQlaXnKMW4c4gbJPoqOflTKdFWt3QDXLBKWwFPLWj7X k+tJew7pnG9XJQ8w3SE0CiT1/9yviwxuUeF0LZm1wcYobg+9bG0HU8dVM5zYS2z6rAdi mbeYEMr1tUVM4E2CvlUjlYH7M5QaH0iZCwbE79yri5uYimxf9zQfKmTsSgDEOKQJJ2Ig fNHEDhld0EmOf2wVRIUTdJ7wTCgmJcf/eM3Z/SrdeKtID9YH8NbU1WQS0SvctVcQJ8H1 q6JX248loVudBqL87kELpdJ82r3sUDbVJ/8MsFZ+mzO2pkqtKXLf8GEhl1H5ATutl2G/ +Eew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1YCMCggLtAuQUjPf3HABhYH1O7mBrH/exmuUBapQjFU=; b=GpGqSxRdGlrlvDNNruziqr9KU0uzgv/9Dedkr3T0zG2XaJ1EQ6aNIZPk0jLpuLv1ad Me1HJMbfm6EtiAkYk6g2YVhb3umT0DEsP5CtB7gg6klzJavvhukHJmAKYsphgCYDAsKa SSpKCyIB/+mF8/S28nnHDqSe30OSJBEbuWkzmmYj/pLEraED0Xbv91Xu6hO/1n9aj76a /q5wbwlvtNNEpwwUPtC/0gOYc/MOCVpr5O5B0lUCBLt3lYrTeyCEvJ4PzlbM+67ZupA3 zq93dGnK+nciyMDYIwHV/BzQUvgzGqHn5Lssa/dp6XxVUBPYeRKzeBWxy9sXLMvxS2IP RCog== X-Gm-Message-State: ACrzQf2rrl/TwU5pVVAxdo1rIrJGQiqq03H7QRu+sLweeJF2tZzYkIg7 OI7HqnuELrZCbIFXHMeOxNTAEZULe1BuA0rQsHLXp82JhWk= X-Google-Smtp-Source: AMsMyM6wbHvHf6LrEGJnLIv10ZLFzI7OX67L+kK4rscv1ou8r7Q88Rbo1lToU6X94l/vXb68sbwAojCw1qjn2RN4lqo= X-Received: by 2002:a1f:3445:0:b0:3ab:c197:8f4f with SMTP id b66-20020a1f3445000000b003abc1978f4fmr3341113vka.13.1665992560058; Mon, 17 Oct 2022 00:42:40 -0700 (PDT) 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 From: Doug Rabson Date: Mon, 17 Oct 2022 08:42:29 +0100 Message-ID: Subject: Netlink and vnet To: FreeBSD Net Content-Type: multipart/alternative; boundary="000000000000bdb53605eb361ee3" X-Rspamd-Queue-Id: 4MrTVT6BwQz3LdJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rabson-org.20210112.gappssmtp.com header.s=20210112 header.b=RD3lTmf6; dmarc=none; spf=pass (mx1.freebsd.org: domain of dfr@rabson.org designates 2607:f8b0:4864:20::a31 as permitted sender) smtp.mailfrom=dfr@rabson.org X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[rabson-org.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a31:from]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[rabson-org.20210112.gappssmtp.com:+]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[dfr]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[rabson.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000bdb53605eb361ee3 Content-Type: text/plain; charset="UTF-8" In Linux container runtimes, typically netlink is used with network namespaces to manage the interfaces and addresses for a container. This typically involves briefly joining the network namespace to perform actions like socket(AF_NETLINK, ...). It would be nice to find a similar approach on FreeBSD to replace the 'jexec ifconfig ...' approach which I'm using now. Is there any way to get a netlink socket that connects to a specific vnet? This would be cleaner, more efficient and would simplify porting the Linux runtimes to FreeBSD. --000000000000bdb53605eb361ee3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In Linux container runtimes, typically netlink is used wit= h network namespaces to manage the interfaces and addresses for a container= . This typically involves briefly joining the network namespace to perform = actions like socket(AF_NETLINK, ...).

It would be nice t= o find a similar approach on FreeBSD to replace the 'jexec ifconfig ...= ' approach which I'm using now. Is there any way to get a netlink s= ocket that connects to a specific vnet? This would be cleaner, more efficie= nt and would simplify porting the Linux runtimes to FreeBSD.

=
--000000000000bdb53605eb361ee3--