Skip to content

Commit

Permalink
Applying network device admin state according it device's flags and n…
Browse files Browse the repository at this point in the history
…ot operstate

since operstate is not reflecting device's desired state

Signed-off-by: Ido Heyvi <[email protected]>
  • Loading branch information
heyvister1 committed Nov 7, 2024
1 parent f7f0c92 commit c91e016
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ function find_mlx_devs() {

pci_addr=$(basename $(readlink ${netdev_path}/device)) && [[ -n $pci_addr ]] || return 1
dev_name=$(basename "$netdev_path") && [[ -n $dev_name ]] || return 1
dev_operstate=$(cat "$netdev_path"/operstate) && [[ -n $dev_operstate ]] || return 1
dev_operstate_flags=$(( $(cat "$netdev_path"/flags) & 1 )) && [[ -n $dev_operstate_flags ]] || return 1
dev_operstate=$([[ $dev_operstate_flags -eq 1 ]] && echo "up" || echo "down")
dev_mtu=$(cat "$netdev_path"/mtu) && [[ -n $dev_mtu ]] || return 1
dev_type=""
dev_guid=""
Expand Down

0 comments on commit c91e016

Please sign in to comment.