<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - nftables.py cmd doesn't read updated counter values after first read"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1386">1386</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>nftables.py cmd doesn't read updated counter values after first read
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Gentoo
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>nft
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pablo@netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>karel@unitednetworks.cz
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=577" name="attach_577" title="example of nftables.py not reading updated counter state">attachment 577</a> <a href="attachment.cgi?id=577&action=edit" title="example of nftables.py not reading updated counter state">[details]</a></span>
example of nftables.py not reading updated counter state

System:

Gentoo 5.4.1 x86_64
nft up to date from GIT as of 4.12.2019
CPython 3.6.9


Overview:

nft commands which read named counters actually read counter values only first
time, subsequent reads returns values from first read.


Detailed info:

Consider this ruleset:

add table ip table1
add counter ip table1 counter1
add chain ip table1 chain1 { type filter hook input priority 0; }
add rule ip table1 chain1 counter name counter1

Then ping several times localhost, after that call nftables.py cmd:

list counter table1 counter1

and you will see some packets added to this counter. Ping localhost several
times again and call nftables.py cmd again:

list counter table1 counter1

and you will see same counter values as in first call without adding some
packets from second pinging. But when running nft from shell:

nft list counter table1 counter1

the values returned will be different from second call through nftables.py cmd
and will account packets from second pinging.


See attached example.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>