Skip to content

Commit

Permalink
Shorten tap name
Browse files Browse the repository at this point in the history
The tap name must be less than 16 bytes, including the '\0' terminator. The prefix "tap_kuasar_" is too long, which affects the index size. When the index exceeds 9999, the tap name becomes invalid. Therefore, shorten the tap name prefix to "tap_kua_".

Signed-off-by: MorningTZH <[email protected]>
  • Loading branch information
morningtzh committed Jan 10, 2025
1 parent 54d5d2e commit 0fb5c18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vmm/sandbox/src/network/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl NetworkInterface {
match &self.r#type {
LinkType::Veth => {
let handle = create_netlink_handle(netns).await?;
let tap_name = format!("tap_kuasar_{}", self.index);
let tap_name = format!("tap_kua_{}", self.index);
let tap_intf =
create_tap_in_netns(netns, &tap_name, self.queue, self.mtu, &handle).await?;
tap_intf.add_qdisc_ingress(netns, &handle).await?;
Expand Down

0 comments on commit 0fb5c18

Please sign in to comment.