OpenWRT - ICMP types

Ever wondered what ICMP types the OpenWRT firewall recognizes? If so, read on. Having purchased a lovely new TP-Link 1043ND 802.11ng wireless router to upgrade my trusty WRT54GL, I found myself installing the bleeding edge version of OpenWRT, Attitude Adjustement. And as always, when (re)installing an OS, I tend to re-evaluate the current software configurations I'm using. When sniffing through the firewall config I decided to make some changes to the way ICMP is handled by the router. But I could not find a list of the ICMP types that OpenWRT is familiar with. Not much later I found the answer in the firewall script /lib/firewall/fw.sh , in the function called fw_check_icmptype4 . The following piece of script in that function generates the list of ICMP types:

iptables -p icmp -h 2>/dev/null | \
sed -n -e '/^Valid ICMP Types:/ {
n; :r; s/[()]/ /g; s/[[:space:]]\+/\n/g; p; n; b r
}' | sort -u

The output on my machine is as follows.

TOS-host-redirect
TOS-host-unreachable
TOS-network-redirect
TOS-network-unreachable
address-mask-reply
address-mask-request
any
communication-prohibited
destination-unreachable
echo-reply
echo-request
fragmentation-needed
host-precedence-violation
host-prohibited
host-redirect
host-unknown
host-unreachable
ip-header-bad
network-prohibited
network-redirect
network-unknown
network-unreachable
parameter-problem
ping
pong
port-unreachable
precedence-cutoff
protocol-unreachable
redirect
required-option-missing
router-advertisement
router-solicitation
source-quench
source-route-failed
time-exceeded
timestamp-reply
timestamp-request
ttl-exceeded
ttl-zero-during-reassembly
ttl-zero-during-transit

So now we know. The end.