| version 1.14, 1994/06/29 06:38:19 |
version 1.15, 1995/04/13 06:33:21 |
| Line 98 static struct ip_srcrt { |
|
| Line 98 static struct ip_srcrt { |
|
| |
|
| #ifdef GATEWAY |
#ifdef GATEWAY |
| extern int if_index; |
extern int if_index; |
| u_long *ip_ifmatrix; |
u_int32_t *ip_ifmatrix; |
| #endif |
#endif |
| |
|
| static void save_rte __P((u_char *, struct in_addr)); |
static void save_rte __P((u_char *, struct in_addr)); |
|
|
| ip_id = time.tv_sec & 0xffff; |
ip_id = time.tv_sec & 0xffff; |
| ipintrq.ifq_maxlen = ipqmaxlen; |
ipintrq.ifq_maxlen = ipqmaxlen; |
| #ifdef GATEWAY |
#ifdef GATEWAY |
| i = (if_index + 1) * (if_index + 1) * sizeof (u_long); |
i = (if_index + 1) * (if_index + 1) * sizeof (u_int32_t); |
| ip_ifmatrix = (u_long *) malloc(i, M_RTABLE, M_WAITOK); |
ip_ifmatrix = (u_int32_t *) malloc(i, M_RTABLE, M_WAITOK); |
| bzero((char *)ip_ifmatrix, i); |
bzero((char *)ip_ifmatrix, i); |
| #endif |
#endif |
| } |
} |
|
|
| ia->ia_ifp == m->m_pkthdr.rcvif && |
ia->ia_ifp == m->m_pkthdr.rcvif && |
| #endif |
#endif |
| (ia->ia_ifp->if_flags & IFF_BROADCAST)) { |
(ia->ia_ifp->if_flags & IFF_BROADCAST)) { |
| u_long t; |
u_int32_t t; |
| |
|
| if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr == |
if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr == |
| ip->ip_dst.s_addr) |
ip->ip_dst.s_addr) |
|
|
| } |
} |
| goto ours; |
goto ours; |
| } |
} |
| if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST) |
if (ip->ip_dst.s_addr == (u_int32_t)INADDR_BROADCAST) |
| goto ours; |
goto ours; |
| if (ip->ip_dst.s_addr == INADDR_ANY) |
if (ip->ip_dst.s_addr == INADDR_ANY) |
| goto ours; |
goto ours; |
|
|
| ipt = (struct ip_timestamp *)cp; |
ipt = (struct ip_timestamp *)cp; |
| if (ipt->ipt_len < 5) |
if (ipt->ipt_len < 5) |
| goto bad; |
goto bad; |
| if (ipt->ipt_ptr > ipt->ipt_len - sizeof (long)) { |
if (ipt->ipt_ptr > ipt->ipt_len - sizeof (int32_t)) { |
| if (++ipt->ipt_oflw == 0) |
if (++ipt->ipt_oflw == 0) |
| goto bad; |
goto bad; |
| break; |
break; |
| Line 1074 ip_forward(m, srcrt) |
|
| Line 1074 ip_forward(m, srcrt) |
|
| satosin(rt_key(rt))->sin_addr.s_addr != 0 && |
satosin(rt_key(rt))->sin_addr.s_addr != 0 && |
| ipsendredirects && !srcrt) { |
ipsendredirects && !srcrt) { |
| #define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa)) |
#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa)) |
| u_long src = ntohl(ip->ip_src.s_addr); |
u_int32_t src = ntohl(ip->ip_src.s_addr); |
| |
|
| if (RTA(rt) && |
if (RTA(rt) && |
| (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) { |
(src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) { |
| Line 1087 ip_forward(m, srcrt) |
|
| Line 1087 ip_forward(m, srcrt) |
|
| code = ICMP_REDIRECT_HOST; |
code = ICMP_REDIRECT_HOST; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf("redirect (%d) to %lx\n", code, (u_long)dest); |
printf("redirect (%d) to %lx\n", code, (u_int32_t)dest); |
| #endif |
#endif |
| } |
} |
| } |
} |