From ben at decadent.org.uk Wed Dec 11 10:00:05 2019 From: ben at decadent.org.uk (klibc-bot for Ben Hutchings) Date: Wed, 11 Dec 2019 10:00:05 -0800 Subject: [klibc] [klibc:master] ipconfig: Document support for DNS server addresses Message-ID: Commit-ID: 607dae881e39572e0a0aa6a55a8b750a0b89165f Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=607dae881e39572e0a0aa6a55a8b750a0b89165f Author: Ben Hutchings AuthorDate: Wed, 11 Dec 2019 17:26:28 +0000 Committer: Ben Hutchings CommitDate: Wed, 11 Dec 2019 17:39:18 +0000 [klibc] ipconfig: Document support for DNS server addresses Support for static DNS server addresses was implemented in commit b86cd0ef3f22, but README.ipconfig did not mention this. Signed-off-by: Ben Hutchings --- usr/kinit/ipconfig/README.ipconfig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/usr/kinit/ipconfig/README.ipconfig b/usr/kinit/ipconfig/README.ipconfig index 5c8227a4..10405d3e 100644 --- a/usr/kinit/ipconfig/README.ipconfig +++ b/usr/kinit/ipconfig/README.ipconfig @@ -33,9 +33,10 @@ none no autoconfiguration - either static config, or none at all An interface spec can be either short form, which is just the name of an interface (eth0 or whatever), or long form. The long form consists -of up to seven elements, separated by colons: +of up to nine elements, separated by colons: -:::::: +::::::: + : IP address of the client. If empty, the address will either be determined by RARP/BOOTP/DHCP. What protocol @@ -76,6 +77,14 @@ of up to seven elements, separated by colons: protocols are used. 'off', 'static' or 'none' means no autoconfiguration. + IP address of primary nameserver. + + Default: None if not using autoconfiguration; determined + automatically if using autoconfiguration. + + IP address of secondary nameserver. + See . + IP addresses and netmasks must be either absent (defaulting to zero) or presented in dotted-quad notation. From ben at decadent.org.uk Wed Dec 11 10:00:06 2019 From: ben at decadent.org.uk (klibc-bot for Ben Hutchings) Date: Wed, 11 Dec 2019 10:00:06 -0800 Subject: [klibc] [klibc:master] ipconfig: Ignore NTP server address and any additional fields Message-ID: Commit-ID: 56dcdac0ffc1d86d196a1d04933288b0c0ef8417 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=56dcdac0ffc1d86d196a1d04933288b0c0ef8417 Author: Ben Hutchings AuthorDate: Wed, 11 Dec 2019 17:38:21 +0000 Committer: Ben Hutchings CommitDate: Wed, 11 Dec 2019 17:48:47 +0000 [klibc] ipconfig: Ignore NTP server address and any additional fields ipconfig should accept any ip=/nfsaddrs= parameter that the kernel accepts. The kernel now supports a 10th field for an NTP server address, but only copies it into procfs. We must accept but ignore it. The kernel also ignores additional fields, and might define meanings to them in future. We must accept and ignore them. References: https://bugs.debian.org/931416 References: https://bugzilla.kernel.org/show_bug.cgi?id=205805 Signed-off-by: Ben Hutchings --- usr/kinit/ipconfig/README.ipconfig | 9 +++++++-- usr/kinit/ipconfig/main.c | 10 +++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/usr/kinit/ipconfig/README.ipconfig b/usr/kinit/ipconfig/README.ipconfig index 10405d3e..5ee87e56 100644 --- a/usr/kinit/ipconfig/README.ipconfig +++ b/usr/kinit/ipconfig/README.ipconfig @@ -33,10 +33,10 @@ none no autoconfiguration - either static config, or none at all An interface spec can be either short form, which is just the name of an interface (eth0 or whatever), or long form. The long form consists -of up to nine elements, separated by colons: +of two or more fields, separated by colons: ::::::: - : + :::... IP address of the client. If empty, the address will either be determined by RARP/BOOTP/DHCP. What protocol @@ -85,6 +85,11 @@ of up to nine elements, separated by colons: IP address of secondary nameserver. See . + IP address of a Network Time Protocol (NTP) server. + Currently ignored. + + ... Additional fields will be ignored. + IP addresses and netmasks must be either absent (defaulting to zero) or presented in dotted-quad notation. diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 2c905986..5472d0f0 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -611,13 +611,6 @@ static int parse_device(struct netdev *dev, char *ip) if ((cp = strchr(ip, ':'))) { *cp++ = '\0'; } - if (opt > 8) { - fprintf(stderr, - "%s: too many options for %s\n", - progname, dev->name); - longjmp(abort_buf, 1); - } - if (*ip == '\0') continue; dprintf("IP-Config: opt #%d: '%s'\n", opt, ip); @@ -653,6 +646,9 @@ static int parse_device(struct netdev *dev, char *ip) case 8: parse_addr(&dev->ip_nameserver[1], ip); break; + case 9: + /* NTP server - ignore */ + break; } } }