-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix error deleting TCPMSS clamp rule in route agent
This warning was observed on route agent restart: 2024-10-15T18:30:34.752Z WRN ..etfilter/adapter.go:120 Packetfilter Unable to delete rule "packetfilter.Rule{Action: MSS, SrcCIDR: 172.31.0.0/16}" from table "Filter", chain "SUBMARINER-FWD-MSSCLAMP": error deleting rule "-s 172.31.0.0/16 -j TCPMSS" from table "filter", chain "SUBMARINER-FWD-MSSCLAMP": running [/usr/sbin/iptables -t filter -D SUBMARINER-FWD-MSSCLAMP -s 172.31.0.0/16 -j TCPMSS --wait 5]: exit status 2: iptables v1.8.8 (nf_tables): TCPMSS target: At least one parameter is required Try `iptables -h' or 'iptables --help' for more information. The problem is that we're not specifying either "--clamp-mss-to-pmtu" or "--set-mss" after "-j TCPMSS". This is due to incorrect parsing of the rule string returned from the iptables command. We're expecting "-p tcp -m tcp --tcp-flags SYN,RST SYN" to be right after "-j TCPMSS" the same as we write it out when appeneding but iptables returns the parameters in a different order with "--clamp-mss-to-pmtu" or "--set-mss" right after "-j TCPMSS", eg "-p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1500" So we miss parsing the TCPMSS parameter and thus don't set the MssClampType field correctly. Modify the parsing to handle the parameters in any order. Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
- Loading branch information
Showing
2 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters