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 connection resets during firewall sync #807

Merged
merged 1 commit into from Dec 9, 2019

Conversation

djboris9
Copy link
Contributor

For very busy tcp connections there is a small possibility to receive
a TCP RST during the iptables sync. It happens only when --run-firewall=true is set.

In function NetworkPolicyController.syncPodFirewallChains a default REJECT
rule is chronologically added before the accept-RELATED,ESTABLISHED rule for ingress and
egress connections. In between of the creation of these two rules a connection reset can happen for already established connections.

The solution is to add the allow-RELATED,ESTABLISHED rule before the REJECT and
jumps to this iptables chain. I see no reason the REJECT rule is inserted before the ACCEPT rule,
but maybe I miss something.

For very busy tcp connections there is a small possibility to receive
a TCP RST during the iptables sync.

A default `REJECT` rule is chronologically added before the allow-`RELATED,ESTABLISHED` rule for ingress and
egress connections.
In between of the creation of these two rules a connection reset can happen for already established connections.

This commits swaps the order of rule insertion.
@murali-reddy
Copy link
Member

good catch @djboris9 thanks for your PR

Changes LGTM

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.

None yet

2 participants