| version 1.95, 2000/01/31 14:18:54 |
version 1.96, 2000/02/01 00:07:09 |
|
|
| */ |
*/ |
| bcopy((caddr_t)(cp + off), (caddr_t)&ipaddr.sin_addr, |
bcopy((caddr_t)(cp + off), (caddr_t)&ipaddr.sin_addr, |
| sizeof(ipaddr.sin_addr)); |
sizeof(ipaddr.sin_addr)); |
| if (opt == IPOPT_SSRR) { |
if (opt == IPOPT_SSRR) |
| #define INA struct in_ifaddr * |
ia = ifatoia(ifa_ifwithaddr(sintosa(&ipaddr))); |
| #define SA struct sockaddr * |
else |
| ia = (INA)ifa_ifwithladdr((SA)&ipaddr); |
|
| } else |
|
| ia = ip_rtaddr(ipaddr.sin_addr); |
ia = ip_rtaddr(ipaddr.sin_addr); |
| if (ia == 0) { |
if (ia == 0) { |
| type = ICMP_UNREACH; |
type = ICMP_UNREACH; |
| Line 1033 ip_dooptions(m) |
|
| Line 1031 ip_dooptions(m) |
|
| * locate outgoing interface; if we're the destination, |
* locate outgoing interface; if we're the destination, |
| * use the incoming interface (should be same). |
* use the incoming interface (should be same). |
| */ |
*/ |
| if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 && |
if ((ia = ifatoia(ifa_ifwithaddr(sintosa(&ipaddr)))) |
| (ia = ip_rtaddr(ipaddr.sin_addr)) == 0) { |
== NULL && |
| |
(ia = ip_rtaddr(ipaddr.sin_addr)) == NULL) { |
| type = ICMP_UNREACH; |
type = ICMP_UNREACH; |
| code = ICMP_UNREACH_HOST; |
code = ICMP_UNREACH_HOST; |
| goto bad; |
goto bad; |
| Line 1065 ip_dooptions(m) |
|
| Line 1064 ip_dooptions(m) |
|
| sizeof(struct in_addr) > ipt->ipt_len) |
sizeof(struct in_addr) > ipt->ipt_len) |
| goto bad; |
goto bad; |
| ipaddr.sin_addr = dst; |
ipaddr.sin_addr = dst; |
| ia = (INA)ifaof_ifpforaddr((SA)&ipaddr, |
ia = ifatoia(ifaof_ifpforaddr(sintosa(&ipaddr), |
| m->m_pkthdr.rcvif); |
m->m_pkthdr.rcvif)); |
| if (ia == 0) |
if (ia == 0) |
| continue; |
continue; |
| bcopy((caddr_t)&ia->ia_addr.sin_addr, |
bcopy((caddr_t)&ia->ia_addr.sin_addr, |
| Line 1080 ip_dooptions(m) |
|
| Line 1079 ip_dooptions(m) |
|
| goto bad; |
goto bad; |
| bcopy((caddr_t)sin, (caddr_t)&ipaddr.sin_addr, |
bcopy((caddr_t)sin, (caddr_t)&ipaddr.sin_addr, |
| sizeof(struct in_addr)); |
sizeof(struct in_addr)); |
| if (ifa_ifwithaddr((SA)&ipaddr) == 0) |
if (ifatoia(ifa_ifwithaddr(sintosa(&ipaddr))) |
| |
== NULL) |
| continue; |
continue; |
| ipt->ipt_ptr += sizeof(struct in_addr); |
ipt->ipt_ptr += sizeof(struct in_addr); |
| break; |
break; |