return NULL;
uid = getuid();
- /* for POSIX integer uids the network device name schema is vethUID_XXXXX */
+ /*
+ * For POSIX integer uids the network device name schema is
+ * vethUID_XXXX.
+ * With four random characters passed to
+ * lxc_ifname_alnum_case_sensitive() we get 62^4 = 14776336
+ * combinations per uid. That's plenty of network devices for now.
+ */
if (uid > 0 && uid <= 65536)
- ret = snprintf(nicname, sizeof(nicname), "veth%d_XXXXX", uid);
+ ret = snprintf(nicname, sizeof(nicname), "veth%d_XXXX", uid);
else
ret = snprintf(nicname, sizeof(nicname), "vethXXXXXX");
if (ret < 0 || (size_t)ret >= sizeof(nicname))