+ if ((!have_na && na_mode == IA_MODE_FORCE) ||
+ (!have_pd && pd_mode == IA_MODE_FORCE))
+ return -1;
+
+ if (na_mode != IA_MODE_NONE && !have_na) {
+ cand.has_noaddravail = true;
+ cand.preference -= 1000;
+ }
+
+ if (pd_mode != IA_MODE_NONE) {
+ if (have_pd)
+ cand.preference += 2000;
+ else
+ cand.preference -= 2000;
+ }
+