From owner-svn-src-all@freebsd.org Tue Apr 28 07:23:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B42DE2AF0E2; Tue, 28 Apr 2020 07:23:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49BCms4MVnz4MdC; Tue, 28 Apr 2020 07:23:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90FA720802; Tue, 28 Apr 2020 07:23:41 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03S7NfBa062889; Tue, 28 Apr 2020 07:23:41 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03S7NfZO062888; Tue, 28 Apr 2020 07:23:41 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202004280723.03S7NfZO062888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 28 Apr 2020 07:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360429 - head/sys/nfs X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/nfs X-SVN-Commit-Revision: 360429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2020 07:23:41 -0000 Author: melifaro Date: Tue Apr 28 07:23:41 2020 New Revision: 360429 URL: https://svnweb.freebsd.org/changeset/base/360429 Log: Remove rtable dumping code from bootp. This debugging code printing routing table data was introduced in rS25723, 22+ years ago. The last functional commit to this code was rS67534, 19 years ago. The code has been turned off by default all this time. Lastly, this code directly iterates radix tree and rtentries, which is not not a proper interaction with routing system. Differential Revision: https://reviews.freebsd.org/D24554 Modified: head/sys/nfs/bootp_subr.c Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Tue Apr 28 05:10:34 2020 (r360428) +++ head/sys/nfs/bootp_subr.c Tue Apr 28 07:23:41 2020 (r360429) @@ -68,9 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef BOOTP_DEBUG -#include -#endif #include #include @@ -263,10 +260,6 @@ static void bootpc_tag_helper(struct bootpc_tagcontext unsigned char *start, int len, int tag); #ifdef BOOTP_DEBUG -void bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma); -void bootpboot_p_rtentry(struct rtentry *rt); -void bootpboot_p_tree(struct radix_node *rn); -void bootpboot_p_rtlist(void); void bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa); void bootpboot_p_iflist(void); #endif @@ -299,95 +292,6 @@ static __inline int bootpc_ifctx_isfailed(struct bootp */ #ifdef BOOTP_DEBUG -void -bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma) -{ - - if (sa == NULL) { - printf("(sockaddr *) "); - return; - } - switch (sa->sa_family) { - case AF_INET: - { - struct sockaddr_in *sin; - - sin = (struct sockaddr_in *) sa; - printf("inet "); - print_sin_addr(sin); - if (ma != NULL) { - sin = (struct sockaddr_in *) ma; - printf(" mask "); - print_sin_addr(sin); - } - } - break; - case AF_LINK: - { - struct sockaddr_dl *sli; - int i; - - sli = (struct sockaddr_dl *) sa; - printf("link %.*s ", sli->sdl_nlen, sli->sdl_data); - for (i = 0; i < sli->sdl_alen; i++) { - if (i > 0) - printf(":"); - printf("%x", ((unsigned char *) LLADDR(sli))[i]); - } - } - break; - default: - printf("af%d", sa->sa_family); - } -} - -void -bootpboot_p_rtentry(struct rtentry *rt) -{ - - bootpboot_p_sa(rt_key(rt), rt_mask(rt)); - printf(" "); - bootpboot_p_sa(rt->rt_gateway, NULL); - printf(" "); - printf("flags %x", (unsigned short) rt->rt_flags); - printf(" %d", (int) rt->rt_expire); - printf(" %s\n", rt->rt_ifp->if_xname); -} - -void -bootpboot_p_tree(struct radix_node *rn) -{ - - while (rn != NULL) { - if (rn->rn_bit < 0) { - if ((rn->rn_flags & RNF_ROOT) != 0) { - } else { - bootpboot_p_rtentry((struct rtentry *) rn); - } - rn = rn->rn_dupedkey; - } else { - bootpboot_p_tree(rn->rn_left); - bootpboot_p_tree(rn->rn_right); - return; - } - } -} - -void -bootpboot_p_rtlist(void) -{ - RIB_RLOCK_TRACKER; - struct rib_head *rnh; - - printf("Routing table:\n"); - rnh = rt_tables_get_rnh(0, AF_INET); - if (rnh == NULL) - return; - RIB_RLOCK(rnh); /* could sleep XXX */ - bootpboot_p_tree(rnh->rnh_treetop); - RIB_RUNLOCK(rnh); -} - void bootpboot_p_if(struct ifnet *ifp, struct ifaddr *ifa) {