hans icon indicating copy to clipboard operation
hans copied to clipboard

Ifconfig is not always in /sbin/ifconfig

Open hlein opened this issue 3 years ago • 0 comments

Some years ago upstream net-tools changed ifconfig to live in /bin: https://github.com/ecki/net-tools/commit/36b541c9f3efe55c5871674ee926be8b20339497

Of course, many distros continue to put it in /sbin/, but not all.

Moreover, in some distros such as RHEL/CentOS since at least 7.x, ifconfig is not even included in a base install, only ip and the like.

I've got some simple hacks to osflags and tun.cpp to handle alternate ifconfig paths at compile time, much like https://github.com/friedrich/hans/pull/21/commits/ac0d27e62d271bc5bbf1168da3231b39820ebb9e#diff-2fc819de3e4f16d2b86d4cc7bcb7042e739f76193d7de454488cb4b33fea848d for android support.

But I think better still would be some runtime selection/fallback. One could easily compile hans on a CentOS 7 system that has optional ifconfig installed, then bring the binary to a system that has only ip and find a nasty surprise.

hlein avatar Feb 04 '23 17:02 hlein