blob: 4f74cb599a9e69091670fd8bc0476812f6fa44eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
--[[
TCP MSS clamping module for Alpine Wall
Copyright (C) 2012 Kaarle Ritvanen
Licensed under the terms of GPL2
]]--
module(..., package.seeall)
require 'awall.model'
local model = awall.model
local ClampMSSRule = model.class(model.ForwardOnlyRule)
function ClampMSSRule:checkzoneoptfrag(ofrag)
if ofrag['in'] then
self:error('Cannot specify inbound interface ('..ofrag['in']..')')
end
end
function ClampMSSRule:table() return 'mangle' end
function ClampMSSRule:chain() return 'POSTROUTING' end
function ClampMSSRule:servoptfrags()
return {{opts='-p tcp --tcp-flags SYN,RST SYN'}}
end
function ClampMSSRule:target()
return 'TCPMSS --'..(self.mss and 'set-mss '..self.mss or 'clamp-mss-to-pmtu')
end
classes = {{'clamp-mss', ClampMSSRule}}
defrules = {}
|