| version 1.37, 1996/09/21 19:44:33 |
version 1.38, 1996/10/10 23:12:49 |
| Line 898 save_rte(option, dst) |
|
| Line 898 save_rte(option, dst) |
|
| olen = option[IPOPT_OLEN]; |
olen = option[IPOPT_OLEN]; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf("save_rte: olen %d\n", olen); |
kprintf("save_rte: olen %d\n", olen); |
| #endif |
#endif |
| if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) |
if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) |
| return; |
return; |
|
|
| OPTSIZ; |
OPTSIZ; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len); |
kprintf("ip_srcroute: nhops %d mlen %d", ip_nhops, m->m_len); |
| #endif |
#endif |
| |
|
| /* |
/* |
|
|
| *(mtod(m, struct in_addr *)) = *p--; |
*(mtod(m, struct in_addr *)) = *p--; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf(" hops %x", ntohl(mtod(m, struct in_addr *)->s_addr)); |
kprintf(" hops %x", ntohl(mtod(m, struct in_addr *)->s_addr)); |
| #endif |
#endif |
| |
|
| /* |
/* |
|
|
| while (p >= ip_srcrt.route) { |
while (p >= ip_srcrt.route) { |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf(" %x", ntohl(q->s_addr)); |
kprintf(" %x", ntohl(q->s_addr)); |
| #endif |
#endif |
| *q++ = *p--; |
*q++ = *p--; |
| } |
} |
|
|
| *q = ip_srcrt.dst; |
*q = ip_srcrt.dst; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf(" %x\n", ntohl(q->s_addr)); |
kprintf(" %x\n", ntohl(q->s_addr)); |
| #endif |
#endif |
| return (m); |
return (m); |
| } |
} |
| Line 1042 ip_forward(m, srcrt) |
|
| Line 1042 ip_forward(m, srcrt) |
|
| dest = 0; |
dest = 0; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf("forward: src %x dst %x ttl %x\n", |
kprintf("forward: src %x dst %x ttl %x\n", |
| ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl); |
ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl); |
| #endif |
#endif |
| if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) { |
if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) { |
| Line 1106 ip_forward(m, srcrt) |
|
| Line 1106 ip_forward(m, srcrt) |
|
| code = ICMP_REDIRECT_HOST; |
code = ICMP_REDIRECT_HOST; |
| #ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
| if (ipprintfs) |
if (ipprintfs) |
| printf("redirect (%d) to %x\n", code, (u_int32_t)dest); |
kprintf("redirect (%d) to %x\n", code, (u_int32_t)dest); |
| #endif |
#endif |
| } |
} |
| } |
} |