@@ -235,18 +235,26 @@ func (r *autoRedirect) cleanupIPTables() {
235
235
}
236
236
237
237
func (r * autoRedirect ) cleanupIPTablesForFamily (iptablesPath string ) {
238
+ tableNameInput := r .tableName + "-input"
238
239
tableNameOutput := r .tableName + "-output"
239
240
tableNameForward := r .tableName + "-forward"
240
241
tableNamePreRouteing := r .tableName + "-prerouting"
242
+
241
243
_ = r .runShell (iptablesPath , "-t nat -D OUTPUT -j" , tableNameOutput )
242
244
_ = r .runShell (iptablesPath , "-t nat -F" , tableNameOutput )
243
245
_ = r .runShell (iptablesPath , "-t nat -X" , tableNameOutput )
244
246
if runtime .GOOS == "android" {
245
247
return
246
248
}
249
+
250
+ _ = r .runShell (iptablesPath , "-D INPUT -j" , tableNameInput )
251
+ _ = r .runShell (iptablesPath , "-F" , tableNameInput )
252
+ _ = r .runShell (iptablesPath , "-X" , tableNameInput )
253
+
247
254
_ = r .runShell (iptablesPath , "-D FORWARD -j" , tableNameForward )
248
255
_ = r .runShell (iptablesPath , "-F" , tableNameForward )
249
256
_ = r .runShell (iptablesPath , "-X" , tableNameForward )
257
+
250
258
_ = r .runShell (iptablesPath , "-t nat -D PREROUTING -j" , tableNamePreRouteing )
251
259
_ = r .runShell (iptablesPath , "-t nat -F" , tableNamePreRouteing )
252
260
_ = r .runShell (iptablesPath , "-t nat -X" , tableNamePreRouteing )
0 commit comments