Skip to content

Reducing injected interface template length to void hitting max length#2459

Closed
vaibhavhd wants to merge 1 commit intosonic-net:masterfrom
vaibhavhd:ifname_len_fix
Closed

Reducing injected interface template length to void hitting max length#2459
vaibhavhd wants to merge 1 commit intosonic-net:masterfrom
vaibhavhd:ifname_len_fix

Conversation

@vaibhavhd
Copy link
Contributor

Description of PR

Summary: Fix for add-topo failure seen when deploying testbeds with long injected interface names.
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Interface Name Size (IFNAMSIZ) is set to 16 characters https://elixir.bootlin.com/linux/v5.6/source/include/uapi/linux/if.h#L33

The interface name that add-topo script adds is indeed 16 chars (for eg. - inje-vmsvc1-1-58) , but 16 character limit set by Linux also includes a trailing NULL. So we should really limit the size to 15 USER VISIBLE length.

    "msg": "ret_code=255, error message=Error: argument \"inje-vmsvc1-1-58\" is wrong: \"dev\" not a valid ifname\n. cmd=ip link add inje-vmsvc1-1-58 type veth peer name d778a6eth58_t"
}

PLAY RECAP *********************************************************************
SVCSTR-SERV-1              : ok=114  changed=4    unreachable=0    failed=1    skipped=96   rescued=0    ignored=0

How did you do it?

Reduced the injected interface template size by 1 char.

Reproduced the error in the server.

server-1:~$ sudo ip link add inje-vmsvc1-1-58 type veth peer name d778a6eth58_t
Error: argument "inje-vmsvc1-1-58" is wrong: "dev" not a valid ifname
server-1:~$ 

Tried to reduce the size and the error is not seen anymore.

server-1:~$ sudo ip link add inje-vmsvc1-58 type veth peer name d778a6eth58_t
server-1:~$ 

How did you verify/test it?

Modified the template to one size small, and the add-topo script successfully passed.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@vaibhavhd vaibhavhd requested a review from a team November 4, 2020 17:21
@vaibhavhd
Copy link
Contributor Author

Retest vsimage please

@vaibhavhd
Copy link
Contributor Author

Retest vsimage please

2 similar comments
@vaibhavhd
Copy link
Contributor Author

Retest vsimage please

@vaibhavhd
Copy link
Contributor Author

Retest vsimage please

@vaibhavhd
Copy link
Contributor Author

Retest vsimage please

1 similar comment
@wangxin
Copy link
Collaborator

wangxin commented Nov 12, 2020

Retest vsimage please

@wangxin
Copy link
Collaborator

wangxin commented Nov 24, 2020

retest vsimage please

1 similar comment
@wangxin
Copy link
Collaborator

wangxin commented Nov 25, 2020

retest vsimage please

@wangxin
Copy link
Collaborator

wangxin commented Jun 3, 2021

PRs #3359 and #3368 should have addressed this issue.

@vaibhavhd vaibhavhd closed this Jun 16, 2021
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
7272bf37 Revert "Revert "[DHCPv6] [202012] Update the dhcpv6_relay config/show cli (sonic-net#2271)" (sonic-net#2336)" (sonic-net#2459)
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants