From 7d6550f6888be671e35c1cf39bafd48a7ebc103d Mon Sep 17 00:00:00 2001 From: ume Date: Fri, 14 Jul 2000 08:33:10 +0000 Subject: IPv6 support. IPv6 configuration is only done by rtsol. Does someone really need manual configuration? :-) You can specify IPv6 DNS server as well. We have only one server ftp7.jp.freebsd.org that speaks IPv6 in this time. ftp7.jp speaks IPv4 as well and also listed as Japan #7. Approved by: jkh --- usr.sbin/sade/config.c | 21 +++++++++++++++++---- usr.sbin/sade/install.c | 1 + usr.sbin/sade/menus.c | 4 ++++ usr.sbin/sade/sade.h | 4 ++++ 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'usr.sbin/sade') diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 503679f..c0320c6 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -677,7 +677,7 @@ int configResolv(dialogMenuItem *ditem) { FILE *fp; - char *cp, *dp, *hp; + char *cp, *c6p, *dp, *hp; cp = variable_get(VAR_NAMESERVER); if (!cp || !*cp) @@ -696,18 +696,25 @@ configResolv(dialogMenuItem *ditem) skip: dp = variable_get(VAR_DOMAINNAME); cp = variable_get(VAR_IPADDR); + c6p = variable_get(VAR_IPV6ADDR); hp = variable_get(VAR_HOSTNAME); /* Tack ourselves into /etc/hosts */ fp = fopen("/etc/hosts", "w"); if (!fp) return DITEM_FAILURE; /* Add an entry for localhost */ + if (!variable_cmp(VAR_IPV6_ENABLE, "YES")) { + if (dp) + fprintf(fp, "::1\t\t\tlocalhost.%s localhost\n", dp); + else + fprintf(fp, "::1\t\t\tlocalhost\n"); + } if (dp) fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp); else fprintf(fp, "127.0.0.1\t\tlocalhost\n"); /* Now the host entries, if applicable */ - if (cp && cp[0] != '0' && hp) { + if (((cp && cp[0] != '0') || (c6p && c6p[0] != '0')) && hp) { char cp2[255]; if (!index(hp, '.')) @@ -716,8 +723,14 @@ skip: SAFE_STRCPY(cp2, hp); *(index(cp2, '.')) = '\0'; } - fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); - fprintf(fp, "%s\t\t%s.\n", cp, hp); + if (c6p && c6p[0] != '0') { + fprintf(fp, "%s\t%s %s\n", c6p, hp, cp2); + fprintf(fp, "%s\t%s.\n", c6p, hp); + } + if (cp && cp[0] != '0') { + fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); + fprintf(fp, "%s\t\t%s.\n", cp, hp); + } } fclose(fp); if (isDebug()) diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 655991d..ac3b013 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -1086,6 +1086,7 @@ installVarDefaults(dialogMenuItem *self) variable_set2(VAR_INSTALL_ROOT, "/", 0); variable_set2(VAR_INSTALL_CFG, "install.cfg", 0); variable_set2(VAR_TRY_DHCP, "NO", 0); /* For now */ + variable_set2(VAR_TRY_RTSOL, "NO", 0); /* For now */ cp = getenv("EDITOR"); if (!cp) cp = "/usr/bin/ee"; diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 7c8c984..15f51fb 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -553,6 +553,8 @@ DMenu MenuMediaFTP = { VAR_FTP_PATH _AS("=ftp://current.freebsd.org/pub/FreeBSD/snapshots/") }, { " 4.0 SNAP Server", "releng4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://releng4.freebsd.org/pub/FreeBSD/snapshots/") }, + { " IPv6 Ready", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH _AP("=ftp://ftp7.jp.freebsd.org") }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ar.freebsd.org") }, { " Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, @@ -639,6 +641,8 @@ DMenu MenuMediaFTP = { VAR_FTP_PATH _AP("=ftp://ftp5.jp.freebsd.org") }, { " Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.jp.freebsd.org") }, + { " Japan #7", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, + VAR_FTP_PATH _AP("=ftp://ftp7.jp.freebsd.org") }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.kr.freebsd.org") }, { " Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 0563473..e34735a 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -123,6 +123,8 @@ #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" +#define VAR_IPV6_ENABLE "ipv6_enable" +#define VAR_IPV6ADDR "ipv6addr" #define VAR_KEYMAP "keymap" #define VAR_KGET "kget" #define VAR_LABEL "label" @@ -167,6 +169,7 @@ #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_TRY_DHCP "tryDHCP" +#define VAR_TRY_RTSOL "tryRTSOL" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" @@ -327,6 +330,7 @@ typedef int (*commandFunc)(char *key, void *data); /* This is the structure that Network devices carry around in their private, erm, structures */ typedef struct _devPriv { + int use_rtsol; int use_dhcp; char ipaddr[IPADDR_FIELD_LEN]; char netmask[IPADDR_FIELD_LEN]; -- cgit v1.1