bootp_subr.c (102052) | bootp_subr.c (108172) |
---|---|
1/* 2 * Copyright (c) 1995 Gordon Ross, Adam Glass 3 * Copyright (c) 1992 Regents of the University of California. 4 * All rights reserved. 5 * 6 * This software was developed by the Computer Systems Engineering group 7 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * contributed to Berkeley. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 * 38 * based on: 39 * nfs/krpc_subr.c 40 * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ 41 */ 42 43#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1995 Gordon Ross, Adam Glass 3 * Copyright (c) 1992 Regents of the University of California. 4 * All rights reserved. 5 * 6 * This software was developed by the Computer Systems Engineering group 7 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 8 * contributed to Berkeley. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 * 38 * based on: 39 * nfs/krpc_subr.c 40 * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ 41 */ 42 43#include <sys/cdefs.h> |
44__FBSDID("$FreeBSD: head/sys/nfsclient/bootp_subr.c 102052 2002-08-18 07:05:00Z sobomax $"); | 44__FBSDID("$FreeBSD: head/sys/nfsclient/bootp_subr.c 108172 2002-12-22 05:35:03Z hsu $"); |
45 46#include "opt_bootp.h" 47 48#include <sys/param.h> 49#include <sys/systm.h> 50#include <sys/kernel.h> 51#include <sys/sockio.h> 52#include <sys/malloc.h> --- 343 unchanged lines hidden (view full) --- 396 397void 398bootpboot_p_iflist(void) 399{ 400 struct ifnet *ifp; 401 struct ifaddr *ifa; 402 403 printf("Interface list:\n"); | 45 46#include "opt_bootp.h" 47 48#include <sys/param.h> 49#include <sys/systm.h> 50#include <sys/kernel.h> 51#include <sys/sockio.h> 52#include <sys/malloc.h> --- 343 unchanged lines hidden (view full) --- 396 397void 398bootpboot_p_iflist(void) 399{ 400 struct ifnet *ifp; 401 struct ifaddr *ifa; 402 403 printf("Interface list:\n"); |
404 IFNET_RLOCK(); /* could sleep, but okay for debugging XXX */ |
|
404 for (ifp = TAILQ_FIRST(&ifnet); 405 ifp != NULL; 406 ifp = TAILQ_NEXT(ifp, if_link)) { 407 for (ifa = TAILQ_FIRST(&ifp->if_addrhead); 408 ifa != NULL; 409 ifa = TAILQ_NEXT(ifa, ifa_link)) 410 if (ifa->ifa_addr->sa_family == AF_INET) 411 bootpboot_p_if(ifp, ifa); 412 } | 405 for (ifp = TAILQ_FIRST(&ifnet); 406 ifp != NULL; 407 ifp = TAILQ_NEXT(ifp, if_link)) { 408 for (ifa = TAILQ_FIRST(&ifp->if_addrhead); 409 ifa != NULL; 410 ifa = TAILQ_NEXT(ifa, ifa_link)) 411 if (ifa->ifa_addr->sa_family == AF_INET) 412 bootpboot_p_if(ifp, ifa); 413 } |
414 IFNET_RUNLOCK(); |
|
413} 414#endif /* defined(BOOTP_DEBUG) */ 415 416static void 417clear_sinaddr(struct sockaddr_in *sin) 418{ 419 420 bzero(sin, sizeof(*sin)); --- 1263 unchanged lines hidden (view full) --- 1684 /* 1685 * Find a network interface. 1686 */ 1687#ifdef BOOTP_WIRED_TO 1688 printf("bootpc_init: wired to interface '%s'\n", 1689 __XSTRING(BOOTP_WIRED_TO)); 1690#endif 1691 bzero(&ifctx->ireq, sizeof(ifctx->ireq)); | 415} 416#endif /* defined(BOOTP_DEBUG) */ 417 418static void 419clear_sinaddr(struct sockaddr_in *sin) 420{ 421 422 bzero(sin, sizeof(*sin)); --- 1263 unchanged lines hidden (view full) --- 1686 /* 1687 * Find a network interface. 1688 */ 1689#ifdef BOOTP_WIRED_TO 1690 printf("bootpc_init: wired to interface '%s'\n", 1691 __XSTRING(BOOTP_WIRED_TO)); 1692#endif 1693 bzero(&ifctx->ireq, sizeof(ifctx->ireq)); |
1694 IFNET_RLOCK(); |
|
1692 for (ifp = TAILQ_FIRST(&ifnet); 1693 ifp != NULL; 1694 ifp = TAILQ_NEXT(ifp, if_link)) { 1695 snprintf(ifctx->ireq.ifr_name, sizeof(ifctx->ireq.ifr_name), 1696 "%s%d", ifp->if_name, ifp->if_unit); 1697#ifdef BOOTP_WIRED_TO 1698 if (strcmp(ifctx->ireq.ifr_name, 1699 __XSTRING(BOOTP_WIRED_TO)) != 0) --- 7 unchanged lines hidden (view full) --- 1707 if (gctx->interfaces != NULL) 1708 gctx->lastinterface->next = ifctx; 1709 else 1710 gctx->interfaces = ifctx; 1711 ifctx->ifp = ifp; 1712 gctx->lastinterface = ifctx; 1713 ifctx = allocifctx(gctx); 1714 } | 1695 for (ifp = TAILQ_FIRST(&ifnet); 1696 ifp != NULL; 1697 ifp = TAILQ_NEXT(ifp, if_link)) { 1698 snprintf(ifctx->ireq.ifr_name, sizeof(ifctx->ireq.ifr_name), 1699 "%s%d", ifp->if_name, ifp->if_unit); 1700#ifdef BOOTP_WIRED_TO 1701 if (strcmp(ifctx->ireq.ifr_name, 1702 __XSTRING(BOOTP_WIRED_TO)) != 0) --- 7 unchanged lines hidden (view full) --- 1710 if (gctx->interfaces != NULL) 1711 gctx->lastinterface->next = ifctx; 1712 else 1713 gctx->interfaces = ifctx; 1714 ifctx->ifp = ifp; 1715 gctx->lastinterface = ifctx; 1716 ifctx = allocifctx(gctx); 1717 } |
1718 IFNET_RUNLOCK(); |
|
1715 free(ifctx, M_TEMP); 1716 1717 if (gctx->interfaces == NULL) { 1718#ifdef BOOTP_WIRED_TO 1719 panic("bootpc_init: Could not find interface specified " 1720 "by BOOTP_WIRED_TO: " 1721 __XSTRING(BOOTP_WIRED_TO)); 1722#else --- 294 unchanged lines hidden --- | 1719 free(ifctx, M_TEMP); 1720 1721 if (gctx->interfaces == NULL) { 1722#ifdef BOOTP_WIRED_TO 1723 panic("bootpc_init: Could not find interface specified " 1724 "by BOOTP_WIRED_TO: " 1725 __XSTRING(BOOTP_WIRED_TO)); 1726#else --- 294 unchanged lines hidden --- |