From owner-freebsd-hackers Thu Jul 25 0:25:26 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4A6137B400 for ; Thu, 25 Jul 2002 00:25:22 -0700 (PDT) Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79F2843E72 for ; Thu, 25 Jul 2002 00:25:22 -0700 (PDT) (envelope-from Qing.Li@windriver.com) Received: from heavygear (heavygear [147.11.38.42]) by mail.wrs.com (8.9.3/8.9.1) with SMTP id AAA02416 for ; Thu, 25 Jul 2002 00:23:36 -0700 (PDT) From: "Qing Li" To: "FreeBSD-Hackers" Subject: questions about some code in route.c Date: Thu, 25 Jul 2002 00:24:21 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Please help me try to understand some of the code in route.c. 1. In function "rtrequest1", ========================================= case RTM_DELETE: /* * Now search what's left of the subtree for any cloned * routes which might have been formed from this node. */ if ((rt->rt_flags & (RTF_CLONING | RTF_PRCLONING)) && rt_mask(rt)) { ========================================= Question: under what situation would a route entry that is clone-able but having a (rt_mask(rt) == 0) ?? 2. A related question is, in the same function, ========================================= /* * We repeat the same procedure from rt_setgate() here because * it doesn't fire when we call it there because the node * hasn't been added to the tree yet. */ if (!(rt->rt_flags & RTF_HOST) && rt_mask(rt) != 0) { struct rtfc_arg arg; arg.rnh = rnh; arg.rt0 = rt; rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt), rt_fixchange, &arg); } ========================================= Question: wouldn't the 1st check for "not a host route" be sufficient ?? 3. In function "rtredirect", ========================================== /* * Create a new entry if we just got back a wildcard entry * or the the lookup failed. This is necessary for hosts * which use routing redirects generated by smart gateways * to dynamically build the routing tables. */ if ((rt == 0) || (rt_mask(rt) && rt_mask(rt)->sa_len < 2)) goto create; ============================================ Question: I am guessing (sa_len < 2) is checking for a mask of all 0's based on what in_socktrim does, is this correct ?? Why is the magic number "2" ? Any help/pointer on these would be greatly appreciated. -- Qing To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message