From nobody Sun Feb 27 23:54:11 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 0C8F919D8401 for ; Sun, 27 Feb 2022 23:54:14 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4K6L2Y2543z55Bg for ; Sun, 27 Feb 2022 23:54:13 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id v5so9147935qkj.4 for ; Sun, 27 Feb 2022 15:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:content-transfer-encoding:mime-version:subject :message-id:date:to; bh=mrM+AR/KzB+/jbFrv46pOA7TmA5gaJj6U3MxzY/iihY=; b=kdvROjB9pPZ+Sq/lmzRpEFpZbJFWyq7S5QHmZhM4Y9PS2fVKZcxOvugwtUOF8fKMrQ vZmvH8tismqndHtHERVp8P57/9RupH5c+/ClYQxN8w8sJX6TqsfUJ2TQA9HPQ7oWdTRA Rn4zc+OWao2SNtALywP1DNka01quc2bjoTyli067u+EOB4GmwsifLByWO9g/jicP5KQR tu+tmVdKjTv5noMpJIH72bKsPO9i/QU/wvK2e9zGIbmYrQ49QW0J8MPmCfhK4kVuqS/5 AIO5kChvdbIoAzrdnJN6irNvAJaA8HAvUymFbK2lli2aEqMpNLuSw2n32cXvxFskMB/y 2Qmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:content-transfer-encoding :mime-version:subject:message-id:date:to; bh=mrM+AR/KzB+/jbFrv46pOA7TmA5gaJj6U3MxzY/iihY=; b=sD4bXPYjADInQzlzPkYqEnmcaE8pehrOKaS38pL3HFu8EnHiTCPVKPE/wMGAmqW0Tw cFSzqtYM1AuORwpwA2mqfVVkQWsYHitl8cyp2ee8ZxGVGFlpE9LM9s1opWXTobjM3o2y d0o1RFTg46aWiw+gUU60PSQL31Jvj91FvyLG/G5roOimN9EdHJFxq1By1uuBGrJ3PQBk KGFy7baA0M4fSwRgGdbPGOXsoThdx2JB2WdzG0FXa7lqANemJswWHJ9E+czQge9HaGc7 6TUrtnffpF5Sbj+Ga1SScfUkGS06ufaY/RYBRFaGsfTJEEBGSiGnGyMTdmJL/B9w9XlZ tM+g== X-Gm-Message-State: AOAM531R96Dhh0oSO0J1ih1m+mp+kRnXoHLIwK4czvZbIBrmZb7EblUI 7wqIKdQaYu75mOYZ0Q0fciuDJv72ZhBstg== X-Google-Smtp-Source: ABdhPJxdph6k7eAbWD3hmlgdjd+/8TTX2NmTgbgfWIuLVKyvRt7VB/ez9h62yMzi7UmjVxIPC2y3hg== X-Received: by 2002:a05:620a:38d:b0:5f1:91db:9513 with SMTP id q13-20020a05620a038d00b005f191db9513mr9936484qkm.85.1646006052579; Sun, 27 Feb 2022 15:54:12 -0800 (PST) Received: from smtpclient.apple ([2601:19b:4400:1779::10c4]) by smtp.gmail.com with ESMTPSA id e8-20020ac85dc8000000b002de409f360fsm5938340qtx.76.2022.02.27.15.54.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Feb 2022 15:54:12 -0800 (PST) From: Matteo Riondato Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 15.0 \(3693.60.0.1.1\)) Subject: if_enc(4) and net.inet.ipcomp.ipcomp_enable Message-Id: <00EA8894-6B8C-4D21-8D5D-DA490FD24697@FreeBSD.org> Date: Sun, 27 Feb 2022 18:54:11 -0500 To: freebsd-net@freebsd.org X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Rspamd-Queue-Id: 4K6L2Y2543z55Bg X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=kdvROjB9; dmarc=none; spf=pass (mx1.freebsd.org: domain of rionda@gmail.com designates 2607:f8b0:4864:20::72a as permitted sender) smtp.mailfrom=rionda@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[matteo@FreeBSD.org,rionda@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[matteo@FreeBSD.org,rionda@gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72a:from]; MLMMJ_DEST(0.00)[freebsd-net]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hello net@, I am trying to use pf to filter packets in ipsec tunnels by filtering on = enc0 from if_enc(4). I have the following values for the net.enc sysctl subtree: net.enc.out.ipsec_bpf_mask: 1 net.enc.out.ipsec_filter_mask: 1 net.enc.in.ipsec_bpf_mask: 2 net.enc.in.ipsec_filter_mask: 2 and I have net.inet.ipsec.filtertunnel: 1 Everything works well when the tunnel does not use ipcomp, but when it = does, the incoming packets seem to ignore the value of the=20 net.enc.in.ipsec_filter_mask sysctl, thus they show up in pf = =E2=80=9Ctwice=E2=80=9D: once with both external and internall headers, = and once only with internal (the value of 2 for this sysctl should make = these packets show up only with internal headers). The same can be = observed with tcpdump on enc0. This behavior makes it hard to do = filtering. Is this behavior expected?=20 Thanks, Matteo