Browse code

- bitlen mask fixes

Andrei Pelinescu-Onciul authored on 22/09/2001 02:20:24
Showing 2 changed files
... ...
@@ -267,7 +267,7 @@ net4:	ipv4 SLASH ipv4	{ $$=mk_net($1, $3); }
267 267
 								yyerror("invalid bit number in netmask");
268 268
 								$$=0;
269 269
 							}else{
270
-								$$=mk_net($1, ((1<<$3)-1));
270
+								$$=mk_net($1, htonl( ($3)?~( (1<<32-$3)-1 ):0 ) );
271 271
 							}
272 272
 						}
273 273
 	| ipv4				{ $$=mk_net($1, 0xffffffff); }
... ...
@@ -16,7 +16,7 @@ debug=1
16 16
 dns=true #comment on the same line
17 17
 
18 18
 route{
19
-	(method==invite and src_ip==1.2.3.4 or (src_ip==4.3.2.1 and src_ip==11.12.13.14/24) ) log("test log\n"); forward("ape");
19
+	(method==invite and src_ip==1.2.3.4/32 or (src_ip==4.3.2.1 and src_ip==11.12.13.14/24) ) log("test log\n"); forward("ape");
20 20
 	( uri~="test\n" &  ! src_ip~="dorian") forward(dorian.fokus.gmd.de);
21 21
 
22 22
 	(src_ip==192.168.0.0/255.255.0.0 or dst_ip==127.0.0.1 and uri~="s$") \