Superconductivity and magnetism of the R6Ni2Sn (R=Y and rare earth) compounds