diff options
author | tegge <tegge@FreeBSD.org> | 1998-03-14 04:13:56 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 1998-03-14 04:13:56 +0000 |
commit | 9ac0a4296a0f23bdf81b9ddcc86b59b60e266405 (patch) | |
tree | 860b07eab1e0a706d6733880bd3eba931d6495f7 | |
parent | 3483aa429fc32f1e613bff2b2f885f0ef7335433 (diff) | |
download | FreeBSD-src-9ac0a4296a0f23bdf81b9ddcc86b59b60e266405.zip FreeBSD-src-9ac0a4296a0f23bdf81b9ddcc86b59b60e266405.tar.gz |
Add a BOOTP_WIRED_TO option, for use on machines with multiple network
cards where the first detected card should not be used for bootp.
Submitted by: Doug Ambrisko <ambrisko@whistle.com>
-rw-r--r-- | sys/conf/NOTES | 3 | ||||
-rw-r--r-- | sys/conf/options | 3 | ||||
-rw-r--r-- | sys/i386/conf/LINT | 3 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 3 | ||||
-rw-r--r-- | sys/nfs/bootp_subr.c | 17 | ||||
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 17 |
6 files changed, 36 insertions, 10 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 3dbbc26..071a91b 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.415 1998/03/09 22:09:10 eivind Exp $ +# $Id: LINT,v 1.416 1998/03/10 15:42:13 eivind Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1375,6 +1375,7 @@ options BOOTP # Use BOOTP to obtain IP address/hostname options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info options "BOOTP_NFSV3" # Use NFS v3 to NFS mount root options BOOTP_COMPAT # Workaround for broken bootp daemons. +options "BOOTP_WIRED_TO=fxp0" # Use interface fxp0 for BOOTP # # An obsolete option to test kern_opt.c. diff --git a/sys/conf/options b/sys/conf/options index c7c6c8d..f47a87b 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -1,4 +1,4 @@ -# $Id: options,v 1.65 1998/03/08 09:56:21 julian Exp $ +# $Id: options,v 1.66 1998/03/10 15:55:38 eivind Exp $ # # On the handling of kernel options # @@ -161,6 +161,7 @@ BOOTP opt_bootp.h BOOTP_COMPAT opt_bootp.h BOOTP_NFSROOT opt_bootp.h BOOTP_NFSV3 opt_bootp.h +BOOTP_WIRED_TO opt_bootp.h GATEWAY opt_defunct.h MROUTING opt_mrouting.h INET opt_inet.h diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 3dbbc26..071a91b 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.415 1998/03/09 22:09:10 eivind Exp $ +# $Id: LINT,v 1.416 1998/03/10 15:42:13 eivind Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1375,6 +1375,7 @@ options BOOTP # Use BOOTP to obtain IP address/hostname options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info options "BOOTP_NFSV3" # Use NFS v3 to NFS mount root options BOOTP_COMPAT # Workaround for broken bootp daemons. +options "BOOTP_WIRED_TO=fxp0" # Use interface fxp0 for BOOTP # # An obsolete option to test kern_opt.c. diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 3dbbc26..071a91b 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.415 1998/03/09 22:09:10 eivind Exp $ +# $Id: LINT,v 1.416 1998/03/10 15:42:13 eivind Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -1375,6 +1375,7 @@ options BOOTP # Use BOOTP to obtain IP address/hostname options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info options "BOOTP_NFSV3" # Use NFS v3 to NFS mount root options BOOTP_COMPAT # Workaround for broken bootp daemons. +options "BOOTP_WIRED_TO=fxp0" # Use interface fxp0 for BOOTP # # An obsolete option to test kern_opt.c. diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index 4053bc3..7dbcd9e 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1,4 +1,4 @@ -/* $Id: bootp_subr.c,v 1.9 1998/02/09 06:10:32 eivind Exp $ */ +/* $Id: bootp_subr.c,v 1.10 1998/03/14 03:25:14 tegge Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -774,14 +774,25 @@ bootpc_init(void) /* * Find a network interface. */ +#ifdef BOOTP_WIRED_TO + printf("bootpc_init: wired to interface '%s'\n", + __XSTRING(BOOTP_WIRED_TO)); +#endif + bzero(&ireq, sizeof(ireq)); for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link)) + { + sprintf(ireq.ifr_name, "%s%d", ifp->if_name, ifp->if_unit); +#ifdef BOOTP_WIRED_TO + if (strcmp(ireq.ifr_name, __XSTRING(BOOTP_WIRED_TO)) == 0) + break; +#else if ((ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0) break; +#endif + } if (ifp == NULL) panic("bootpc_init: no suitable interface"); - bzero(&ireq,sizeof(ireq)); - sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit); strcpy(nd->myif.ifra_name,ireq.ifr_name); printf("bootpc_init: using network interface '%s'\n", ireq.ifr_name); diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 4053bc3..7dbcd9e 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -1,4 +1,4 @@ -/* $Id: bootp_subr.c,v 1.9 1998/02/09 06:10:32 eivind Exp $ */ +/* $Id: bootp_subr.c,v 1.10 1998/03/14 03:25:14 tegge Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -774,14 +774,25 @@ bootpc_init(void) /* * Find a network interface. */ +#ifdef BOOTP_WIRED_TO + printf("bootpc_init: wired to interface '%s'\n", + __XSTRING(BOOTP_WIRED_TO)); +#endif + bzero(&ireq, sizeof(ireq)); for (ifp = TAILQ_FIRST(&ifnet); ifp != 0; ifp = TAILQ_NEXT(ifp,if_link)) + { + sprintf(ireq.ifr_name, "%s%d", ifp->if_name, ifp->if_unit); +#ifdef BOOTP_WIRED_TO + if (strcmp(ireq.ifr_name, __XSTRING(BOOTP_WIRED_TO)) == 0) + break; +#else if ((ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0) break; +#endif + } if (ifp == NULL) panic("bootpc_init: no suitable interface"); - bzero(&ireq,sizeof(ireq)); - sprintf(ireq.ifr_name, "%s%d", ifp->if_name,ifp->if_unit); strcpy(nd->myif.ifra_name,ireq.ifr_name); printf("bootpc_init: using network interface '%s'\n", ireq.ifr_name); |