<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 - Problem with import of small iptables rule sets with multiport match"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1233">1233</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Problem with import of small iptables rule sets with multiport match
          </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>Debian GNU/Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>iptables over nftable
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>michael@mi-pietsch.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=531" name="attach_531" title="command in and output files">attachment 531</a> <a href="attachment.cgi?id=531&action=edit" title="command in and output files">[details]</a></span>
command in and output files

I found problems when importing iptables rules with iptables-compat-restore
<filename> if it contains multiport matches. 

Steps to reproduce:
1. import the iptables file X.in with `iptables-compat-restore X.in` 
2. run `nft list ruleset > x.out`
3. output for a.in, d.in, e.in, f.in contain unexpected output
The files with the used iptables rules and output are include in the bug.tar
attachment.

I found the following results:
* having an single rule containing `multiport` results in output of available
protocols (e.in, f.in)
* having two `multiport` rules with different match rules (eg. one with `-m
state`) results in garbage characters for the rules (a.in, d.in)
* having two `multiport` rules with same match and protocols works correctly
without garbage characters in output (b.in, g.in)

Order of the rules in the iptables file, the defined ports, define
single/multiple ports do not change the result.

Also noticable is that iptables-compat-save prints the imported iptables rules
correctly.

System: Debian Jessie (amd64) with current updates (14.03.2018)
nftables v0.7 (Scrooge McDuck)  (dpkg-version 0.7-1)
iptables-nftables-compat 1.6.0+snapshot2016117-6
libnftnl4  1.0.7-1
Linux 4.9.0-6</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>