changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: ip/ipconfig: increase maximum host and domainname size to 255 bytes. idn for -h option

changeset 6763: ca5957605e32
parent 6762: f068d49e8aab
tag:tip
author: cinap_lenrek@felloff.net
date: Tue, 25 Sep 2018 21:51:57 +0200
files: sys/src/cmd/ip/ipconfig/ipconfig.h sys/src/cmd/ip/ipconfig/main.c
description: ip/ipconfig: increase maximum host and domainname size to 255 bytes. idn for -h option
     1.1--- a/sys/src/cmd/ip/ipconfig/ipconfig.h
     1.2+++ b/sys/src/cmd/ip/ipconfig/ipconfig.h
     1.3@@ -54,8 +54,9 @@ struct Conf
     1.4 	ulong	xid;
     1.5 	ulong	starttime;
     1.6 	char	sname[64];
     1.7-	char	hostname[32];
     1.8-	char	domainname[64];
     1.9+	char	hostname[256];
    1.10+	char	domainname[256];
    1.11+	char	dnsdomain[256];
    1.12 	uchar	server[IPaddrlen];	/* server IP address */
    1.13 	ulong	offered;		/* offered lease time */
    1.14 	ulong	lease;			/* lease time */
    1.15@@ -87,8 +88,6 @@ struct Conf
    1.16 	uchar	autoflag;	/* flag: autonomous */
    1.17 	ulong	validlt;	/* valid lifetime (seconds) */
    1.18 	ulong	preflt;		/* preferred lifetime (seconds) */
    1.19-
    1.20-	char	dnsdomain[256];
    1.21 };
    1.22 
    1.23 struct Ctl
     2.1--- a/sys/src/cmd/ip/ipconfig/main.c
     2.2+++ b/sys/src/cmd/ip/ipconfig/main.c
     2.3@@ -350,7 +350,8 @@ main(int argc, char **argv)
     2.4 		plan9 = 0;
     2.5 		break;
     2.6 	case 'h':
     2.7-		snprint(conf.hostname, sizeof conf.hostname, "%s", EARGF(usage()));
     2.8+		if(utf2idn(EARGF(usage()), conf.hostname, sizeof(conf.hostname)) == nil)
     2.9+			sysfatal("bad hostname");
    2.10 		sendhostname = 1;
    2.11 		break;
    2.12 	case 'm':