- /*
- * Case 1: This route may come from a route to iface with mask
- * or from a default IS.
- */
- rt->rt_gateway = ifp->if_addrlist->ifa_addr;
- } else if ((rt->rt_flags & RTF_GATEWAY == 0) &&
- gate->sdl.sdl_family == AF_LINK) {
- /*
- * Case 2: This route may come from ESIS or a manual route
- * add with a LL address.
- */
- insque(lc, &llinfo_llc);
- if (gate->sdl.sdl_alen == sizeof(struct esis_req) + addrlen) {
- gate->sdl.sdl_alen -= sizeof(struct esis_req);
- bcopy(addrlen + LLADDR(&gate->sdl),
- (caddr_t)&lc->lc_er, sizeof(lc->lc_er));
- } else if (gate->sdl.sdl_alen == addrlen)
- lc->lc_flags = (SNPA_ES | SNPA_VALID | SNPA_PERM);
- } else {
- /*
- * Case 3: Told to add route via a gateway;
- * try to provoke LL route to exist for gateway by cloning.
- */
- if (gate->siso.siso_family == AF_ISO &&
- (rt->rt_flags & RTF_GATEWAY) &&
- (rt2 = rtalloc1(&gate->sa, 1)) &&
- (lc2 = (struct llinfo_llc *)rt2->rt_llinfo)) {
- lc->lc_rtgate = rt2;
- rt2->rt_use++;
- if (lc2->lc_rtgate == 0) {
- lc->lc_prev = lc->lc_next = lc;
- lc2->lc_rtgate = rt;
- rt->rt_use++;
- } else {
- if (lc2->lc_rtgate->rt_llinfo == 0)
- panic("llc_rtrequest 2");
- insque(lc, lc2->lc_rtgate->rt_llinfo);
- }
- }
+ rt_setgate(rt, rt_key(rt), &blank_dl);
+ return;
+ }
+ if (lc != 0)
+ return; /* happens on a route change */
+ /* FALLTHROUGH */
+ case RTM_RESOLVE:
+ /*
+ * Case 2: This route may come from cloning, or a manual route
+ * add with a LL address.
+ */
+ if (gate->sdl.sdl_family != AF_LINK) {
+ log(LOG_DEBUG, "llc_rtrequest: got non-link non-gateway route\n");
+ break;
+ }
+ R_Malloc(lc, struct llinfo_llc *, sizeof (*lc));
+ rt->rt_llinfo = (caddr_t)lc;
+ if (lc == 0) {
+ log(LOG_DEBUG, "llc_rtrequest: malloc failed\n");
+ break;