fix comparison and the double allocation it uncovers
tc->vlport = (vlport ? vlport : AFS_VLPORT);
afs_stats_cmperf.numCellsVisible++;
newc++;
- if (!aflags & CAlias) {
+ if (!(aflags & CAlias)) {
tc->realcellIndex = afs_realcellindex++;
} else {
tc->realcellIndex = -1;
tc->timeout = timeout;
/* Allow converting an alias into a real cell */
- if (!(aflags & CAlias)) {
+ if ((!(aflags & CAlias)) && (tc->states & CAlias)) {
tc->states &= ~CAlias;
tc->realcellIndex = afs_realcellindex++;
}