kubernetes/pkg/proxy/iptables
Dan Winship 9cd0552ddd proxy/iptables: Remove unnecessary /32 and /128 in iptables rules
If you pass just an IP address to "-s" or "-d", the iptables command
will fill in the correct mask automatically.

Originally, the proxier was just hardcoding "/32" for all of these,
which was unnecessary but simple. But when IPv6 support was added, the
code was made more complicated to deal with the fact that the "/32"
needed to be "/128" in the IPv6 case, so it would parse the IPs to
figure out which family they were, which in turn involved adding some
checks in case the parsing fails (even though that "can't happen" and
the old code didn't check for invalid IPs, even though that would
break the iptables-restore if there had been any).

Anyway, all of that is unnecessary because we can just pass the IP
strings to iptables directly rather than parsing and unparsing them
first.

(The diff to proxier_test.go is just deleting "/32" everywhere.)
2021-11-09 09:32:50 -05:00
..
OWNERS pkg/proxy: add sig-network-approvers/sig-network-reviewers to OWNERS files 2019-05-13 10:30:29 -05:00
proxier_test.go proxy/iptables: Remove unnecessary /32 and /128 in iptables rules 2021-11-09 09:32:50 -05:00
proxier.go proxy/iptables: Remove unnecessary /32 and /128 in iptables rules 2021-11-09 09:32:50 -05:00