Date: Mon, 29 Apr 2002 02:06:52 -0700 (PDT) From: kshitij gunjikar <kshitijgunjikar@yahoo.com> To: freebsd-net@freebsd.org Subject: IP options related question Message-ID: <20020429090652.92612.qmail@web12201.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? 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 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?20020429090652.92612.qmail>