]> granicus.if.org Git - transmission/commitdiff
(squash later) fix pflen handling in cidr
authorMingye Wang <arthur200126@gmail.com>
Sun, 14 Oct 2018 16:44:01 +0000 (12:44 -0400)
committerMingye Wang <arthur200126@gmail.com>
Sun, 14 Oct 2018 16:44:01 +0000 (12:44 -0400)
libtransmission/blocklist.c

index 33064aaded4effe9e952ca461b7fb5868ca1a214..28115b7fc44e9e1803564e0a7179aad908681145 100644 (file)
@@ -320,7 +320,7 @@ static bool parseLine3(char const* line, struct tr_ipv4_range* range) {
     }
 
     /* do it in the network order */
-    mask <<= pflen;
+    mask <<= 32 - pflen;
     ip_u = ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3];
 
     /* fill the non-prefix bits the way we need it */