Skip to content

Commit

Permalink
Implement packet access for protocols igmp, pim, igrp, vrrp and sctp
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed Mar 11, 2015
1 parent 81db9d0 commit 1b23fa0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion src/pf/expand.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ local PROTO_VRRP = 112 -- 0x70
local ip_min_payloads = {
[PROTO_ICMP] = 8,
[PROTO_UDP] = 8,
[PROTO_TCP] = 20
[PROTO_TCP] = 20,
[PROTO_IGMP] = 8,
[PROTO_IGRP] = 8,
[PROTO_PIM] = 8,
[PROTO_SCTP] = 8,
[PROTO_VRRP] = 8
}

-- ISO protocols
Expand Down Expand Up @@ -1039,6 +1044,16 @@ local function expand_offset(level, dlt)
return ipv4_payload_offset(PROTO_UDP)
elseif level == 'tcp' then
return ipv4_payload_offset(PROTO_TCP)
elseif level == 'igmp' then
return ipv4_payload_offset(PROTO_IGMP)
elseif level == 'igrp' then
return ipv4_payload_offset(PROTO_IGRP)
elseif level == 'pim' then
return ipv4_payload_offset(PROTO_PIM)
elseif level == 'sctp' then
return ipv4_payload_offset(PROTO_SCTP)
elseif level == 'vrrp' then
return ipv4_payload_offset(PROTO_VRRP)
end
error('invalid level '..level)
end
Expand Down
3 changes: 2 additions & 1 deletion src/pf/parse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ end

local addressables = set(
'arp', 'rarp', 'wlan', 'ether', 'fddi', 'tr', 'ppp',
'slip', 'link', 'radio', 'ip', 'ip6', 'tcp', 'udp', 'icmp'
'slip', 'link', 'radio', 'ip', 'ip6', 'tcp', 'udp', 'icmp',
'igmp', 'pim', 'igrp', 'vrrp', 'sctp'
)

local function nullary()
Expand Down

0 comments on commit 1b23fa0

Please sign in to comment.