Mercurial > hg > Applications > TreeVNC
changeset 210:2132018b8c68
fix netmask
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Jul 2014 20:30:45 +0900 |
parents | 7b106b4a0c9f |
children | a106bbed1888 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java Wed Jul 02 19:06:03 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java Wed Jul 02 20:30:45 2014 +0900 @@ -49,9 +49,9 @@ byte[] netmask = ipaddress.getAddress().getAddress(); for(int i = 0; i < netmask.length; i++) { int bitpos = i * 8; - if (bitpos > prefix) { + if (bitpos+8 > prefix) { netmask[i] = 0; - } else if (bitpos+8 > prefix) { + } else if (bitpos > prefix) { // ex. bitpos = 0, prefix = 2 // bitpos+8-prefix // 1100 0000