Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ip6tc): ipv6 interface name with 15 chars is too big #348

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oryaacov
Copy link

File "/home/zn-admin/.zn-internal/venv3/lib/python3.8/site-packages/iptc/easy.py", line 303, in encode_iptc_rule
    setattr(iptc_rule, name.replace('-', '_'), rule_d[name])
  File "/home/zn-admin/.zn-internal/venv3/lib/python3.8/site-packages/iptc/ip6tc.py", line 486, in set_out_interface
    raise ValueError("interface name %s too long" % (intf))
ValueError: interface name br-13786b5c3131\x00  too long

IPv4 and IPv6 code for getting in/out interface name is different, while IPv6 contained the following bug if the interface name is 15 characters:
for i in range(_IFNAMSIZ): will never run the else section which deletes the last null character using intf = intf[:-1]if the interface name is 15 chars.

I aligned the logic to use the same one as ipv4, since both function are doing the same thing, just in a different way

before the fix:
image
after the fix:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant