coreos / go-iptables

Go wrapper around iptables utility
Apache License 2.0
1.11k stars 257 forks source link

Fix the 1.8.9 version check #117

Closed skitt closed 9 months ago

skitt commented 10 months ago

The current version check fails for any version where the patch version is 9 or greater. 1.4.21 is still in use e.g. on RHEL 7:

ipt.v1 == 1 && ipt.v2 <= 8 && ipt.v3 < 9

fails there because 21 >= 9.

To handle this, the check needs to distinguish ipt.v2 < 8 (v3 is not significant then) and ipt.v2 == 8 (v3 needs to be compared).