Index: ifconfig.c =================================================================== RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.353 diff -u -p -r1.353 ifconfig.c --- ifconfig.c 16 Jan 2018 10:33:55 -0000 1.353 +++ ifconfig.c 8 Feb 2018 06:03:14 -0000 @@ -2738,8 +2733,12 @@ phys_status(int force) if (dstport) printf(":%u", ntohs(dstport)); - if (ioctl(s, SIOCGLIFPHYTTL, (caddr_t)&ifr) == 0 && ifr.ifr_ttl > 0) - printf(" ttl %d", ifr.ifr_ttl); + if (ioctl(s, SIOCGLIFPHYTTL, (caddr_t)&ifr) == 0) { + if (ifr.ifr_ttl == -1) + printf(" ttl copy"); + else if (ifr.ifr_ttl > 0) + printf(" ttl %d", ifr.ifr_ttl); + } #ifndef SMALL if (ioctl(s, SIOCGLIFPHYRTABLE, (caddr_t)&ifr) == 0 && (rdomainid != 0 || ifr.ifr_rdomainid != 0)) @@ -3261,9 +3260,13 @@ settunnelttl(const char *id, int param) const char *errmsg = NULL; int ttl; - ttl = strtonum(id, 0, 0xff, &errmsg); - if (errmsg) - errx(1, "tunnelttl %s: %s", id, errmsg); + if (strcmp(id, "copy") == 0) + ttl = -1; + else { + ttl = strtonum(id, 0, 0xff, &errmsg); + if (errmsg) + errx(1, "tunnelttl %s: %s", id, errmsg); + } strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); ifr.ifr_ttl = ttl;