# HG changeset patch # User Roy Marples # Date 1590778870 -10800 # Node ID e60767dab375ec831c2af819a6975ab555edb53f # Parent 3bc21bfa52f8d22c1149a1aefde957db14b85bd2 Solaris: driver names have numbers So we can't use the BSD/Linux methodology diff -r 3bc21bfa52f8 -r e60767dab375 src/if.c --- a/src/if.c Fri May 29 21:13:11 2020 +0300 +++ b/src/if.c Fri May 29 22:01:10 2020 +0300 @@ -693,15 +693,27 @@ } strlcpy(spec->devname, spec->drvname, sizeof(spec->devname)); +#ifdef __sun + /* Solaris has numbers in the driver name, such as e1000g */ + while (ep > spec->drvname && isdigit((int)*ep)) + ep--; + if (*ep++ == ':') { + errno = EINVAL; + return -1; + } +#else + /* BSD and Linux no not have numbers in the driver name */ for (ep = spec->drvname; *ep != '\0' && !isdigit((int)*ep); ep++) { if (*ep == ':') { errno = EINVAL; return -1; } } +#endif spec->ppa = (int)strtoi(ep, &pp, 10, 0, INT_MAX, &e); *ep = '\0'; +#ifndef __sun /* * . is used for VLAN style names * i is used on NetBSD for xvif interfaces @@ -711,6 +723,7 @@ if (e) spec->vlid = -1; } else +#endif spec->vlid = -1; return 0;