#1124656 hxtools: hxnetload does not operate with long net device names

Package:
hxtools
Source:
hxtools
Description:
Collection of tools and scripts
Submitter:
Witold Baryluk
Date:
2026-01-05 06:17:05 UTC
Severity:
normal
#1124656#5
Date:
2026-01-05 06:15:34 UTC
From:
To:
Dear Maintainer,

root@debian:~# cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo: 315689499 3749706    0    0    0     0          0         0 315689499 3749706    0    0    0     0       0          0
enp7s0:       0       0    0    0    0     0          0         0        0       0    0    2    0     0       0          0
enp8s0:       0       0    0    0    0     0          0         0        0       0    0    2    0     0       0          0
enp65s0f0np0: 31502150911179 21726017179  594 76357    0     0          0   6132709 28152066122932 18975690995    0    0    0     0       0          0
enp65s0f1np1:       0       0    0    0    0     0          0         0        0       0    0    2    0     0       0          0
lxcbr0:       0       0    0    0    0     0          0         0        0       0    0 1826    0     0       0          0
docker0:       0       0    0    0    0     0          0         0        0       0    0  815    0     0       0          0



But running with `/usr/libexec/hxtools/hxnetload enp65s0f0np0` nothing happens.

This is because regexp on line 28 is incorrect.

    cat "$COMPAT_PROC/proc/net/dev" | grep " $1" | cut -f 2 -d:;


should be:


    cat "$COMPAT_PROC/proc/net/dev" | grep "^ *$1:" | cut -f 2 -d:;


instead

And while at it, optimize a little:

    grep "^ *$1:" "$COMPAT_PROC/proc/net/dev" | cut -f 2 -d:;



Cheers,
Witold