Coder Social home page Coder Social logo

Comments (5)

squeed avatar squeed commented on June 23, 2024

Taking a look at this.

from go-iptables.

squeed avatar squeed commented on June 23, 2024

Ideally we switch List to use the output of iptables-save, which has a more stable output. Let's see if that breaks anything.

from go-iptables.

squeed avatar squeed commented on June 23, 2024

Really, we should move the whole library over to using iptables-save...

from go-iptables.

squeed avatar squeed commented on June 23, 2024

More immediately, when using iptables in standard (legacy) mode, iptables -S returns the exact output that would result in a chain, e.g.

$ iptables -t filter  -S foo1
-N foo1
-A foo1 -p tcp -m tcp --dport 1337 -j ACCEPT

However, when it is in nftables mode, the output includes the counters in iptables-save format:

$ iptables -t filter -S foo1
-N foo1
[0:0] -A foo1 -p tcp -m tcp --dport 1337 -j ACCEPT

So we just have to detect that and work around.

from go-iptables.

erig0 avatar erig0 commented on June 23, 2024

FWIW, I just posted a fix for the counters upstream.

edit: Applied upstream, ed30b9311d2b ("nft: don't print rule counters unless verbose")

from go-iptables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.