Date: Wed, 24 Apr 2002 04:12:42 -0700 (PDT) From: kshitij gunjikar <kshitijgunjikar@yahoo.com> To: freebsd-net@freebsd.org Subject: Record Routes Message-ID: <20020424111242.77223.qmail@web12208.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi All,
I have a question related to record routes in the
FreeBSD code. In the
ip_dooptions() fn in ip_input.c there is this code in
the Record Route
option.
/*
* If no space remains, ignore.
*/
off--; /* 0 origin */
if (off > optlen - (int)sizeof(struct in_addr))
break;
(void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
sizeof(ipaddr.sin_addr));
/*
* locate outgoing interface; if we're the destination,
* use the incoming interface (should be same).
*/
if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == 0 &&
(ia = ip_rtaddr(ipaddr.sin_addr)) == 0) {
type = ICMP_UNREACH;
code = ICMP_UNREACH_HOST;
goto bad;
}
1. Why is the ICMP_UNREACH_HOST generated?
2. Because if a route is not found, then am I wrong
in saying
ICMP_UNREACH_NETWORK must be generated. Also, how does
ip_rtaddr() find out
that the IP address is not of the directly connected
networks?
Thanks in advance.
Regards
Kshitij
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020424111242.77223.qmail>
