calculate prefix len from netmask (bnc #865199)