]> granicus.if.org Git - transmission/commitdiff
(squash later) blocklist cidr endianness
authorMingye Wang <arthur200126@gmail.com>
Wed, 17 Oct 2018 13:41:19 +0000 (09:41 -0400)
committerMingye Wang <arthur200126@gmail.com>
Wed, 17 Oct 2018 13:41:19 +0000 (09:41 -0400)
libtransmission/blocklist.c

index 28115b7fc44e9e1803564e0a7179aad908681145..c6e37ae82492d29e15c69ca3348f526fa3504e10 100644 (file)
@@ -319,13 +319,13 @@ static bool parseLine3(char const* line, struct tr_ipv4_range* range) {
         return false;
     }
 
-    /* do it in the network order */
+    /* this is host order */
     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 */
-    range->begin = ntohl(ip_u & mask);
-    range->end = ntohl(ip_u | (~mask));
+    range->begin = ip_u & mask;
+    range->end = ip_u | (~mask);
 
     return true;
 }