<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 - using old session data when piping multiple commands"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1158">1158</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>using old session data when piping multiple commands
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>ipset
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Ubuntu
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>default
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>netfilter-buglog@lists.netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitri.grischin@securepoint.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tried to pipe several commands to ipset but if one of them have a syntax
error then the following command will get the typename of the before.

What I did:

create ipset:
# ./ipset create test hash:net
# ./ipset create test_iface hash:net,iface


pipe commands:
Only the second command has a wrong syntax but the third command return an
error too.

# echo -e "add test 1.1.1.1\nadd test_iface 2.2.2.2\nadd test 3.3.3.3\n" |
./ipset -
ipset v6.32: Syntax error: Second element is missing from 2.2.2.2.
ipset v6.32: Syntax error: Second element is missing from 3.3.3.3.

# ./ipset list
Name: test
Type: hash:net
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 448
References: 0
Members:
1.1.1.1

Name: test_iface
Type: hash:net,iface
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 416
References: 0
Members:


Printing "setname" and "typename" in types.c:adt_type_get() shows that in the
third command "test" has the typename "hash:net,iface" instead of "hash:net".

# echo -e "add test 1.1.1.1\nadd test_iface 2.2.2.2\nadd test 3.3.3.3\n" |
./ipset -
ipset> setname: {test}
typename: {hash:net}
ipset> setname: {test_iface}
typename: {hash:net,iface}
ipset v6.32: Syntax error: Second element is missing from 2.2.2.2.
ipset> setname: {test}
typename: {hash:net,iface}
ipset v6.32: Syntax error: Second element is missing from 3.3.3.3.


# ./ipset -v
ipset v6.32, protocol version: 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>