@@ -64,9 +64,19 @@ static int vlan_set_device_state(struct device *dev, bool up)
static void vlan_dev_set_name(struct vlan_device *vldev, struct device *dev)
{
char name[IFNAMSIZ];
+ char devnum[5];
+ int i, j = 0;
vldev->dev.hidden = dev->hidden;
- snprintf(name, IFNAMSIZ, "%s.%d", dev->ifname, vldev->id);
+ snprintf(devnum, 5, "%d", vldev->id);
+ i = strnlen(devnum, 4);
+ /* Subtract the dot and terminating null */
+ j = IFNAMSIZ - i - 3;
+ /* Brute force the null and length and 0-index math */
+ name[0] = 0;
+ strncat(name, dev->ifname, j);
+ strncat(name, ".", 1);
+ strncat(name, devnum, i);
device_set_ifname(&vldev->dev, name);
}