search for: device_nr

Displaying 1 result from an estimated 1 matches for "device_nr".

2006 Jun 01
2
Finding the right interface on FreeBSD
...int device_total_in = 0; @@ -60,8 +64,31 @@ iface = rindex(device, '/') ? rindex(device, '/') + 1 : device; if((device_fd = open(device, O_RDWR | O_NONBLOCK)) < 0) { - logger(LOG_ERR, _("Could not open %s: %s"), device, strerror(errno)); - return false; + int device_nr; + + /* if device terminates by a number and is of reasonable size, + try any following numbered device */ + if (strlen(device) > 1 && strlen(device) < sizeof(device_buf) - 3) { + char *nr = device + strlen(device) - 1; + while (nr > device && *nr >= '0'...