patch-src_linux_device_c 795 B

1234567891011121314151617181920
  1. --- tinc-1.0.11.orig/src/linux/device.c 2009-09-27 12:27:54.000000000 +0200
  2. +++ tinc-1.0.11/src/linux/device.c 2009-12-06 02:30:32.000000000 +0100
  3. @@ -61,7 +61,7 @@ bool setup_device(void) {
  4. if (netname != NULL)
  5. iface = xstrdup(netname);
  6. #else
  7. - iface = xstrdup(rindex(device, '/') ? rindex(device, '/') + 1 : device);
  8. + iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
  9. #endif
  10. device_fd = open(device, O_RDWR | O_NONBLOCK);
  11. @@ -105,7 +105,7 @@ bool setup_device(void) {
  12. device_type = DEVICE_TYPE_ETHERTAP;
  13. if(iface)
  14. free(iface);
  15. - iface = xstrdup(rindex(device, '/') ? rindex(device, '/') + 1 : device);
  16. + iface = xstrdup(strrchr(device, '/') ? strrchr(device, '/') + 1 : device);
  17. }
  18. logger(LOG_INFO, "%s is a %s", device, device_info);