Lines Matching refs:ifp

100 #define	PREF(p, ifp) ((p) <= (uint32_t)(ifp)->int_metric ? ((p) != 0 ? 1 : 0) \
101 : (p) - ((ifp)->int_metric))
112 struct interface *ifp,
129 ifp ? ifp->int_name : "?",
146 ifp ? ifp->int_name : "?",
216 set_rdisc_mg(struct interface *ifp,
227 if ((ifp->int_state & IS_NO_RDISC) == IS_NO_RDISC ||
233 if (!(ifp->int_if_flags & IFF_MULTICAST)) {
235 ifp->int_state &= ~(IS_ALL_HOSTS | IS_ALL_ROUTERS);
239 dosupply = should_supply(ifp);
242 m.imr_interface.s_addr = ((ifp->int_if_flags & IFF_POINTOPOINT) &&
243 (ifp->int_dstaddr != 0) ? ifp->int_dstaddr : ifp->int_addr);
244 if (dosupply || (ifp->int_state & IS_NO_ADV_IN) || !on) {
246 if (ifp->int_state & IS_ALL_HOSTS) {
252 ifp->int_state &= ~IS_ALL_HOSTS;
255 } else if (!(ifp->int_state & IS_ALL_HOSTS)) {
262 ifp->int_state |= IS_ALL_HOSTS;
266 if (!dosupply || (ifp->int_state & IS_NO_ADV_OUT) ||
267 !IS_IFF_ROUTING(ifp->int_if_flags) || !on) {
269 if (ifp->int_state & IS_ALL_ROUTERS) {
275 ifp->int_state &= ~IS_ALL_ROUTERS;
278 } else if (!(ifp->int_state & IS_ALL_ROUTERS)) {
285 ifp->int_state |= IS_ALL_ROUTERS;
297 struct interface *ifp;
336 for (ifp = ifnet; ifp; ifp = ifp->int_next) {
337 if (ifp->int_state & IS_BROKE)
339 ifp->int_rdisc_cnt = 0;
340 ifp->int_rdisc_timer.tv_usec = rdisc_timer.tv_usec;
341 ifp->int_rdisc_timer.tv_sec = now.tv_sec+MIN_WAITTIME;
342 set_rdisc_mg(ifp, 1);
449 * This should only be called when !(ifp->int_state & IS_DUP)
454 if_bad_rdisc(struct interface *ifp)
459 if (drp->dr_ifp != ifp)
494 if_ok_rdisc(struct interface *ifp)
496 set_rdisc_mg(ifp, 1);
498 ifp->int_rdisc_cnt = 0;
499 ifp->int_rdisc_timer.tv_sec = now.tv_sec +
500 ((ifp->int_state & IS_NO_ADV_OUT) ?
502 if (timercmp(&rdisc_timer, &ifp->int_rdisc_timer, > /* cstyle */))
503 rdisc_timer = ifp->int_rdisc_timer;
512 struct interface *ifp;
542 ifp = drp->dr_ifp;
544 if (drp->dr_ts != 0 && drp->dr_ifp == ifp)
556 naddr_ntoa(gate), ifp->int_name, i);
557 } else if (ifp->int_rdisc_cnt >= MAX_SOLICITATIONS) {
560 naddr_ntoa(gate), ifp->int_name);
561 ifp->int_rdisc_cnt = 0;
562 ifp->int_rdisc_timer.tv_sec = 0;
567 naddr_ntoa(gate), ifp->int_name);
579 struct interface *ifp;
636 ifp = drp->dr_ifp;
650 drp->dr_pref = PREF(drp->dr_recv_pref, ifp);
879 struct interface *ifp)
899 if (!on_net(gate, ifp->int_net, ifp->int_mask)) {
917 if ((drp->dr_gate == gate) && (drp->dr_ifp == ifp)) {
931 if ((!(ifp->int_state & IS_SICK) &&
934 !((ifp->int_state ^ drp->dr_ifp->int_state) &
966 new_drp->dr_ifp = ifp;
972 new_drp->dr_pref = PREF(pref, ifp);
975 if (!(ifp->int_state & IS_SICK))
976 ifp->int_rdisc_cnt = MAX_SOLICITATIONS;
1006 struct interface *ifp,
1020 if (ifp->int_state & IS_DUP)
1035 if (ifp->int_if_flags & IFF_POINTOPOINT) {
1037 if (ifp->int_dstaddr == 0)
1040 sin.sin_addr.s_addr = ifp->int_dstaddr;
1043 sin.sin_addr.s_addr = ifp->int_brdaddr;
1056 ifindex = (type != mcast && ifp->int_phys != NULL) ?
1057 ifp->int_phys->phyi_index : 0;
1059 if (rdisc_sock_interface != ifp) {
1065 addr.s_addr = (ifp->int_if_flags & IFF_POINTOPOINT) ?
1066 ifp->int_dstaddr : ifp->int_addr;
1073 rdisc_sock_interface = ifp;
1076 trace_rdisc(msg, ifp->int_addr, sin.sin_addr.s_addr, ifp, p, p_size);
1079 if (!(ifp->int_state & IS_BROKE))
1081 ifp->int_name, ", ",
1084 if (ifp != NULL)
1085 if_sick(ifp, _B_FALSE);
1092 send_adv(struct interface *ifp,
1098 if ((ifp->int_state & (IS_SUPPRESS_RDISC|IS_FLUSH_RDISC)) ==
1109 u.ad.icmp_ad_life = (stopint || !should_supply(ifp) ||
1110 (ifp->int_state & IS_SUPPRESS_RDISC)) ? 0 :
1111 htons(ifp->int_rdisc_int*3);
1114 u.ad.icmp_ad_info[0].icmp_ad_pref = htonl(ifp->int_rdisc_pref);
1116 u.ad.icmp_ad_info[0].icmp_ad_addr = ifp->int_addr;
1120 send_rdisc(&u, sizeof (u.ad), ifp, dst, type);
1122 if (ifp->int_state & IS_SUPPRESS_RDISC)
1123 ifp->int_state &= ~IS_FLUSH_RDISC;
1131 struct interface *ifp;
1138 for (ifp = ifnet; ifp; ifp = ifp->int_next) {
1139 if ((ifp->int_state & (IS_NO_ADV_OUT | IS_BROKE)) ||
1140 (!forceadv && !IS_IFF_ROUTING(ifp->int_if_flags)))
1144 if (IS_IFF_QUIET(ifp->int_if_flags))
1147 if (!timercmp(&ifp->int_rdisc_timer, &now, > /* cstyle */) ||
1149 send_adv(ifp, htonl(INADDR_ALLHOSTS_GROUP),
1150 (ifp->int_state & IS_BCAST_RDISC) ? 1 : 2);
1151 ifp->int_rdisc_cnt++;
1153 intvl_random(&ifp->int_rdisc_timer,
1154 (ifp->int_rdisc_int*3)/4, ifp->int_rdisc_int);
1155 if (ifp->int_rdisc_cnt < MAX_INITIAL_ADVERTS &&
1156 (ifp->int_rdisc_timer.tv_sec >
1158 ifp->int_rdisc_timer.tv_sec =
1161 timevaladd(&ifp->int_rdisc_timer, &now);
1163 if (timercmp(&rdisc_timer, &ifp->int_rdisc_timer,
1165 rdisc_timer = ifp->int_rdisc_timer;
1174 struct interface *ifp;
1182 for (ifp = ifnet; ifp; ifp = ifp->int_next) {
1183 if (0 != (ifp->int_state & (IS_NO_SOL_OUT | IS_BROKE)) ||
1184 ifp->int_rdisc_cnt >= MAX_SOLICITATIONS)
1188 if (IS_IFF_QUIET(ifp->int_if_flags))
1191 if (!timercmp(&ifp->int_rdisc_timer, &now, > /* cstyle */)) {
1196 send_rdisc(&u, sizeof (u.so), ifp,
1198 ((ifp->int_state&IS_BCAST_RDISC) ? bcast : mcast));
1200 if (++ifp->int_rdisc_cnt >= MAX_SOLICITATIONS)
1203 ifp->int_rdisc_timer.tv_sec = SOLICITATION_INTERVAL;
1204 ifp->int_rdisc_timer.tv_usec = 0;
1205 timevaladd(&ifp->int_rdisc_timer, &now);
1208 if (timercmp(&rdisc_timer, &ifp->int_rdisc_timer,
1210 rdisc_timer = ifp->int_rdisc_timer;
1222 struct interface *ifp,
1246 trace_rdisc(act, from, to, ifp, p, len);
1248 if (ifp == NULL)
1252 return (ifp);
1273 struct interface *ifp;
1307 ifp = receiving_interface(&msg, _B_FALSE);
1308 ifp = ck_icmp("Recv", from.sin_addr.s_addr, ifp,
1310 if (ifp == NULL)
1313 if (IS_IFF_QUIET(ifp->int_if_flags)) {
1315 ifp->int_name, ifp->int_if_flags);
1327 if (!remote_address_ok(ifp, from.sin_addr.s_addr)) {
1330 ifp->int_name);
1336 if (ifp->int_state & IS_NO_ADV_IN)
1365 ntohs(p->ad.icmp_ad_life), ifp);
1372 if (!should_supply(ifp))
1374 if ((ifp->int_state & IS_NO_ADV_OUT) ||
1375 !IS_IFF_ROUTING(ifp->int_if_flags))
1386 send_adv(ifp, from.sin_addr.s_addr, 0);
1406 rdisc_suppress(struct interface *ifp)
1408 if (ifp->int_state & IS_ADV_OUT) {
1410 "suppress rdisc adv", ifp->int_name);
1412 if (ifp->int_state & IS_SUPPRESS_RDISC)
1414 ifp->int_state |= (IS_SUPPRESS_RDISC|IS_FLUSH_RDISC);
1415 trace_misc("suppress rdisc adv on %s", ifp->int_name);
1421 rdisc_restore(struct interface *ifp)
1423 if ((ifp->int_state & IS_SUPPRESS_RDISC) == 0)
1425 ifp->int_state &= ~(IS_SUPPRESS_RDISC|IS_FLUSH_RDISC);
1426 trace_misc("restoring rdisc adv on %s", ifp->int_name);