@@ -4718,6 +4718,36 @@ my %accept_blocks = (
47184718 ' host 192.168.170.211' ,
47194719 ' src or dst 192.168.170.211' ,
47204720 ' src or dst host 192.168.170.211' ,
4721+ ' ip host 0xc0a8aad3' ,
4722+ ' ip src or dst 0xc0a8aad3' ,
4723+ ' ip src or dst host 0xc0a8aad3' ,
4724+ ' host 0xc0a8aad3' ,
4725+ ' src or dst 0xc0a8aad3' ,
4726+ ' src or dst host 0xc0a8aad3' ,
4727+ ' ip host 3232279251' ,
4728+ ' ip src or dst 3232279251' ,
4729+ ' ip src or dst host 3232279251' ,
4730+ ' host 3232279251' ,
4731+ ' src or dst 3232279251' ,
4732+ ' src or dst host 3232279251' ,
4733+ # No aliases for 030052125323, which matches a MAC address.
4734+ # "net" without an explicit netmask defaults to /32.
4735+ ' ip net 192.168.170.211/32' ,
4736+ ' ip src or dst net 192.168.170.211/ 32' ,
4737+ ' net 192.168.170.211 /32' ,
4738+ ' src or dst net 192.168.170.211 / 32' ,
4739+ ' ip net 192.168.170.211' ,
4740+ ' ip src or dst net 192.168.170.211' ,
4741+ ' net 192.168.170.211' ,
4742+ ' src or dst net 192.168.170.211' ,
4743+ ' ip net 0xc0a8aad3' ,
4744+ ' ip src or dst net 0xc0a8aad3' ,
4745+ ' net 0xc0a8aad3' ,
4746+ ' src or dst net 0xc0a8aad3' ,
4747+ ' ip net 3232279251' ,
4748+ ' ip src or dst net 3232279251' ,
4749+ ' net 3232279251' ,
4750+ ' src or dst net 3232279251' ,
47214751 ],
47224752 opt => '
47234753 (000) ldb [0]
@@ -4799,6 +4829,35 @@ my %accept_blocks = (
47994829 ' ip src 10.0.0.2' ,
48004830 ' src host 10.0.0.2' ,
48014831 ' src 10.0.0.2' ,
4832+ ' ip src host 0x0a000002' ,
4833+ ' ip src 0x0A000002' ,
4834+ ' src host 0X0a000002' ,
4835+ ' src 0X0A000002' ,
4836+ ' ip src host 0xa000002' ,
4837+ ' ip src 0xA000002' ,
4838+ ' src host 0Xa000002' ,
4839+ ' src 0XA000002' ,
4840+ ' ip src host 167772162' ,
4841+ ' ip src 167772162' ,
4842+ ' src host 167772162' ,
4843+ ' src 167772162' ,
4844+ ' ip src host 01200000002' ,
4845+ ' ip src 01200000002' ,
4846+ ' src host 01200000002' ,
4847+ ' src 01200000002' ,
4848+ # "net" /32
4849+ ' ip src net 10.0.0.2/ 32' ,
4850+ ' src net 10.0.0.2 /32' ,
4851+ ' ip src net 10.0.0.2' ,
4852+ ' src net 10.0.0.2' ,
4853+ ' ip src net 0x0a000002' ,
4854+ ' src net 0X0a000002' ,
4855+ ' ip src net 0xa000002' ,
4856+ ' src net 0Xa000002' ,
4857+ ' ip src net 167772162' ,
4858+ ' src net 167772162' ,
4859+ ' ip src net 01200000002' ,
4860+ ' src net 01200000002' ,
48024861 ],
48034862 opt => '
48044863 (000) ldb [0]
@@ -4862,6 +4921,24 @@ my %accept_blocks = (
48624921 ' ip dst 172.17.89.30' ,
48634922 ' dst host 172.17.89.30' ,
48644923 ' dst 172.17.89.30' ,
4924+ ' ip dst host 0xac11591e' ,
4925+ ' ip dst 0xAC11591E' ,
4926+ ' dst host 0Xac11591e' ,
4927+ ' dst 0XAC11591E' ,
4928+ ' ip dst host 2886818078' ,
4929+ ' ip dst 2886818078' ,
4930+ ' dst host 2886818078' ,
4931+ ' dst 2886818078' ,
4932+ # No aliases for 025404254436, which matches a MAC address.
4933+ # "net" /32
4934+ ' ip dst net 172.17.89.30 / 32' ,
4935+ ' dst net 172.17.89.30 / 32' ,
4936+ ' ip dst net 172.17.89.30' ,
4937+ ' dst net 172.17.89.30' ,
4938+ ' ip dst net 0xac11591e' ,
4939+ ' dst net 0Xac11591e' ,
4940+ ' ip dst net 2886818078' ,
4941+ ' dst net 2886818078' ,
48654942 ],
48664943 opt => '
48674944 (000) ldb [0]
@@ -4922,8 +4999,33 @@ my %accept_blocks = (
49224999 snaplen => 2000,
49235000 aliases => [
49245001 ' ip net 192.168.0.0/16' ,
5002+ ' ip src or dst net 192.168.0.0/16' ,
49255003 ' net 192.168.0.0/16' ,
49265004 ' src or dst net 192.168.0.0/16' ,
5005+ ' ip net 192.168/16' ,
5006+ ' ip src or dst net 192.168/16' ,
5007+ ' net 192.168/16' ,
5008+ ' src or dst net 192.168/16' ,
5009+ ' ip net 192.168.0.0 mask 255.255.0.0' ,
5010+ ' ip src or dst net 192.168.0.0 mask 255.255.0.0' ,
5011+ ' net 192.168.0.0 mask 255.255.0.0' ,
5012+ ' src or dst net 192.168.0.0 mask 255.255.0.0' ,
5013+ ' ip net 192.168.0.0 mask 255.255' ,
5014+ ' ip src or dst net 192.168.0.0 mask 255.255' ,
5015+ ' net 192.168.0.0 mask 255.255' ,
5016+ ' src or dst net 192.168.0.0 mask 255.255' ,
5017+ ' ip net 192.168 mask 255.255.0.0' ,
5018+ ' ip src or dst net 192.168 mask 255.255.0.0' ,
5019+ ' net 192.168 mask 255.255.0.0' ,
5020+ ' src or dst net 192.168 mask 255.255.0.0' ,
5021+ ' ip net 192.168 mask 255.255' ,
5022+ ' ip src or dst net 192.168 mask 255.255' ,
5023+ ' net 192.168 mask 255.255' ,
5024+ ' src or dst net 192.168 mask 255.255' ,
5025+ ' ip net 192.168' ,
5026+ ' ip src or dst net 192.168' ,
5027+ ' net 192.168' ,
5028+ ' src or dst net 192.168' ,
49275029 ],
49285030 # Only the optimized bytecode is equivalent!
49295031 opt => '
@@ -4946,6 +5048,18 @@ my %accept_blocks = (
49465048 aliases => [
49475049 ' ip src net 10.0.1.0/24' ,
49485050 ' src net 10.0.1.0/24' ,
5051+ ' ip src net 10.0.1/24' ,
5052+ ' src net 10.0.1/24' ,
5053+ ' ip src net 10.0.1.0 mask 255.255.255.0' ,
5054+ ' src net 10.0.1.0 mask 255.255.255.0' ,
5055+ ' ip src net 10.0.1.0 mask 255.255.255' ,
5056+ ' src net 10.0.1.0 mask 255.255.255' ,
5057+ ' ip src net 10.0.1 mask 255.255.255.0' ,
5058+ ' src net 10.0.1 mask 255.255.255.0' ,
5059+ ' ip src net 10.0.1 mask 255.255.255' ,
5060+ ' src net 10.0.1 mask 255.255.255' ,
5061+ ' ip src net 10.0.1' ,
5062+ ' src net 10.0.1' ,
49495063 ],
49505064 # Only the optimized bytecode is equivalent!
49515065 opt => '
@@ -4963,17 +5077,23 @@ my %accept_blocks = (
49635077 DLT => ' RAW' ,
49645078 snaplen => 2000,
49655079 aliases => [
4966- ' ip dst net 10.0.2.0/24' ,
4967- ' dst net 10.0.2.0/24' ,
5080+ ' ip dst net 10.0.0.0/8' ,
5081+ ' dst net 10.0.0.0/8' ,
5082+ ' ip dst net 10.0.0.0 mask 255.0.0.0' ,
5083+ ' dst net 10.0.0.0 mask 255.0.0.0' ,
5084+ # "net 10/<any masklength>", "net 10 mask <any mask>" and
5085+ # "net <any net> mask 255" are invalid syntax.
5086+ ' ip dst net 10' ,
5087+ ' dst net 10' ,
49685088 ],
49695089 # Only the optimized bytecode is equivalent!
49705090 opt => '
49715091 (000) ldb [0]
49725092 (001) and #0xf0
49735093 (002) jeq #0x40 jt 3 jf 7
49745094 (003) ld [16]
4975- (004) and #0xffffff00
4976- (005) jeq #0xa000200 jt 6 jf 7
5095+ (004) and #0xff000000
5096+ (005) jeq #0xa000000 jt 6 jf 7
49775097 (006) ret #2000
49785098 (007) ret #0
49795099 ' ,
@@ -8986,6 +9106,36 @@ my %reject_tests = (
89869106 expr => ' ip6 host fe80:0:0:0:0:0:0:0' ,
89879107 errstr => ' not supported' ,
89889108 },
9109+ ip_net_bits1 => {
9110+ DLT => ' RAW' ,
9111+ expr => ' net 192.168/8' ,
9112+ errstr => ' non-network bits set in' ,
9113+ },
9114+ ip_net_bits2 => {
9115+ DLT => ' RAW' ,
9116+ expr => ' net 192.168 mask 255.0.0.0' ,
9117+ errstr => ' non-network bits set in' ,
9118+ },
9119+ ip_net_nonhid1 => {
9120+ DLT => ' RAW' ,
9121+ expr => ' net 10 mask 255.0.0.0' ,
9122+ errstr => ' syntax error' ,
9123+ },
9124+ ip_net_nonhid2 => {
9125+ DLT => ' RAW' ,
9126+ expr => ' net 10/8' ,
9127+ errstr => ' syntax error' ,
9128+ },
9129+ ip_net_mask_nonhid => {
9130+ DLT => ' RAW' ,
9131+ expr => ' net 10.0.0.0 mask 255' ,
9132+ errstr => ' syntax error' ,
9133+ },
9134+ ip_net_nonhid_mask_nonhid => {
9135+ DLT => ' RAW' ,
9136+ expr => ' net 10 mask 255' ,
9137+ errstr => ' syntax error' ,
9138+ },
89899139 ip6_net_prefix => {
89909140 skip => skip_config_undef (' INET6' ),
89919141 DLT => ' RAW' ,
0 commit comments