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?

I'm sure something is wrong in my understanding can
somebody please point out.


Regards
Kshitij



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to