- if (ro->ro_rt == 0 || (ifp = ro->ro_rt->rt_ifp) == 0) {
- extern int ipprintfs;
-
- if (ipprintfs)
- printf("no route to %x (from %x, len %d)\n",
- ip->ip_dst.s_addr, ip->ip_src.s_addr, ip->ip_len);
- error = ENETUNREACH;
- goto bad;
- }
- dst = ro->ro_rt->rt_flags & RTF_DIRECT ?
- (struct sockaddr *)&ro->ro_dst : &ro->ro_rt->rt_gateway;
- if (ro == &iproute)
- RTFREE(ro->ro_rt);
- if (!allowbroadcast && (ifp->if_flags & IFF_BROADCAST)) {
- struct sockaddr_in *sin;
+ if (ro->ro_rt == 0 || (ifp = ro->ro_rt->rt_ifp) == 0)
+ goto unreachable;
+ ro->ro_rt->rt_use++;
+ if (ro->ro_rt->rt_flags & RTF_GATEWAY)
+ dst = &ro->ro_rt->rt_gateway;
+gotif:
+#ifndef notdef
+ /*
+ * If source address not specified yet, use address
+ * of outgoing interface.
+ */
+ if (in_lnaof(ip->ip_src) == INADDR_ANY)
+ ip->ip_src.s_addr =
+ ((struct sockaddr_in *)&ifp->if_addr)->sin_addr.s_addr;
+#endif