Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jan Kasprzak <kas@fi.muni.cz>
To: Kerin Millar <kfm@plushkava.net>
Cc: netfilter@vger.kernel.org
Subject: Re: Logging SNAT'ed connections
Date: Mon, 8 Jun 2026 22:11:17 +0200	[thread overview]
Message-ID: <aich5cMiSFlr1pcH@fi.muni.cz> (raw)
In-Reply-To: <90d53169-3ae6-40a6-a01d-7fae27d24c8f@app.fastmail.com>

	Hi, Kerin,

Kerin Millar wrote:
> Unfortunately, it appears to be a bug affecting ICMP. Possibly here:
> 
> https://git.netfilter.org/libnetfilter_conntrack/tree/src/conntrack/objopt.c?id=7e5397b9167bdd7597be809b8f088ff333e1ad31#n189
> 
> For now, I would suggest filtering with something else.
> 
> conntrack -E -o id,timestamp |
> perl -ne 'print if /\bsrc=(\S+).*\bdst=(\S+)/ && $1 ne $2'

Oh, I did not expect it to be a bug.

Anyway, you probably mean src= in both cases. Using backreferences,
I did it this way:

perl -nE 'print if /\bsrc=(\S+)\s.*\bsrc=(?!\1\s)/'

Thanks!

-Yenya

-- 
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| https://www.fi.muni.cz/~kas/                        GPG: 4096R/A45477D5 |
    I don't like Python; its lack of inline, anonymous, multi-statement
    functions makes me sad.                                --Eric Wastl

  reply	other threads:[~2026-06-08 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 16:38 Logging SNAT'ed connections Jan Kasprzak
2026-06-08 17:53 ` Kerin Millar
2026-06-08 20:11   ` Jan Kasprzak [this message]
2026-06-08 20:47     ` Kerin Millar
2026-06-09  6:17       ` Jan Kasprzak
2026-06-10 11:18   ` Pablo Neira Ayuso
2026-06-10 12:04     ` Kerin Millar
2026-06-10 15:31       ` Pablo Neira Ayuso
2026-06-10 16:16         ` Kerin Millar
2026-06-10 11:28 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aich5cMiSFlr1pcH@fi.muni.cz \
    --to=kas@fi.muni.cz \
    --cc=kfm@plushkava.net \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox