[pkg-netfilter-team] Bug#981857: [Bug Report] [python3-nftables]
Rémi Cabandé
remi.cabande at epitech.eu
Thu Feb 4 16:20:22 GMT 2021
Subject: python3-nftables: nftables.Nftables class instance repeatedly returns -1 after single error occurs
Package: python3-nftables
Version: 0.9.3-2
Severity: normal
Dear Maintainer,
I am using the python wrapper in a program and faced a problem.
Trying to list a Table while the Ruleset is empty returns an error, no problem yet.
Every subsequent call to json_cmd() on the same nftables.Nftables class instance returns -1 in return code.
Here is a short script reproducing the error :
###### testNFTABLES.py ++
import nftables
import json
nft = nftables.Nftables()
nft.set_json_output(True)
flushRulesetCMD = '{ "nftables": [ { "flush": { "ruleset": null }} ]}'
getTableCMD = '{ "nftables": [ { "list": { "table": { "family": "inet", "name": "FooTable" }}} ]}'
addTableCMD = '{ "nftables": [ { "add": { "table": { "family": "inet", "name": "FooTable" }}} ]}'
result = nft.json_cmd(json.loads(flushRulesetCMD))
print(result)
result = nft.json_cmd(json.loads(getTableCMD))
print(result)
# Resetting Nftables class instance makes it work
# nft = nftables.Nftables()
result = nft.json_cmd(json.loads(addTableCMD))
print(result)
###### testNFTABLES.py --
Am I mistaken or is this a real bug ?
-- System Information:
Debian Release: bullseye/sid
APT prefers focal-updates
APT policy: (500, 'focal-updates'), (500, 'focal-security'), (500, 'focal'), (100, 'focal-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.8.0-41-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-nftables depends on:
ii libnftables1 0.9.3-2
ii python3 3.8.2-0ubuntu2
python3-nftables recommends no packages.
python3-nftables suggests no packages.
-- no debconf information
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-netfilter-team/attachments/20210204/ebb68659/attachment.html>
More information about the pkg-netfilter-team
mailing list