From: Matt Corallo Date: Sun, 4 Apr 2021 16:46:28 +0000 (-0400) Subject: Improve drop count printing X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=262b3b5dc1aaa6f46546f653a7fd8dcb3792fa5a;p=flowspec-xdp Improve drop count printing --- diff --git a/dropcount.sh b/dropcount.sh index f67abf7..3cfc4ab 100755 --- a/dropcount.sh +++ b/dropcount.sh @@ -10,7 +10,17 @@ bpftool map dump id "$(bpftool map show | grep drop_cnt_map | awk '{ print $1 }' "Found "*) ;; *) if [ "$KEY" != "" ]; then - echo "$KEY: $CNT" + if [ "$KEY" = "0x00000000" ]; then + echo "Invalid packet length: $CNT" + elif [ "$KEY" = "0x00000001" ]; then + echo "Invalid VLAN tag: $CNT" + elif [ "$KEY" = "0x00000002" ]; then + echo "Invalid/rejected IHL IPv4 field: $CNT" + elif [ "$KEY" = "0x00000003" ]; then + echo "Rejected IPv6 fragments: $CNT" + else + echo "$KEY: $CNT" + fi fi KEY=$(echo "$LINE" | awk '{ print "0x" $4 $3 $2 $1 }') CNT=0