diff options
author | ume <ume@FreeBSD.org> | 2000-07-14 08:33:10 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2000-07-14 08:33:10 +0000 |
commit | 7d6550f6888be671e35c1cf39bafd48a7ebc103d (patch) | |
tree | f690bf659f886857937b4c91d0f2e8f2cccbd7bb /usr.sbin/sade/config.c | |
parent | e0c8d1d42639e253a12dff647ad580908cf27acd (diff) | |
download | FreeBSD-src-7d6550f6888be671e35c1cf39bafd48a7ebc103d.zip FreeBSD-src-7d6550f6888be671e35c1cf39bafd48a7ebc103d.tar.gz |
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
Diffstat (limited to 'usr.sbin/sade/config.c')
-rw-r--r-- | usr.sbin/sade/config.c | 21 |
1 files changed, 17 insertions, 4 deletions
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()) |