Live data from Hacker News

Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

blog.farhan.codes

1–10 of 141 posts

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#6
Here's an example from a decade ago (ifconfig was deprecated then too):

- bonded interfaces

- with vlans

- with multiple IPs

If this sounds unrealistic, it was the standard config for index arbitrage at an investment bank.

The interfaces, added with distro scripts, will use `ip` and all the interfaces will show up in `ip addr` and work perfectly. ifconfig won't show about half of them - they won't be up, or down, they just won't appear.

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#7
There's no reason why someone can't get their act together and fix ifconfig, or if that is insurmountable, rewrite it while maintaining the same outward appearances.

I think this is not specific to Linux at all, and is not really about kernel ABI. This is a problem I see a lot, often in proprietary software too. Firstly, people opt to rewrite before they fix or even before they fully understand the old thing. Secondly, people confuse interface with implementation, and often don't bother trying to make their rewrites interoperable with the old thing.

Another example of that last one, in Linux from the late 90s, is ALSA. FreeBSD for example chose to fix the problems and maintain the old OSS API for audio devices. Linux introduced a very complicated new API.

[By the way, I spotted one sort of technical error in the article. I don't think most software keeps private copies of kernel data structures in their source tree. Rather, when they #include the kernel headers, they end up using an effectively-private version of those structures and constants in their object code. This is slightly different but a similar result.]

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#8
post #5

I don't buy it. Yes, Linux never breaks userland. Yes, ifconfig is deprecated. But I still don't see how these are related.

I still don't understand how this "Linux never breaks userland" thing holds up, it's been proven false.

The 4.13 kernel introduced a change to effectively namespace sysctl settings (prevent the change from default from being copied to the host system into container processes). This broke any container runtimes that relied on host-wide sysctl settings.

[1] https://github.com/aws/amazon-ecs-agent/issues/789

[2] https://success.docker.com/article/ipvs-connection-timeout-i...

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#9
I don't think this is accurate. Other people may know better, but from my understanding the maintainers of ifconfig realized that to update it to use the new behavior, they would have to end up changing the output. The output of ifconfig is used by a lot of scripts, so changing the output would break a million users, so they decided to write a new tool, rather than add a flag or something to opt into new behavior.

So it's userspace compatibility, not the linux kernel compatibility that lead to a new tool.

(and linux will drop old interfaces if it can be proven that no one uses them, or if they're insecure)

Re: Linux maintains bugs: The real reason ifconfig on Linux is deprecated (2018)

#10
It's not quite that simple. People actually tried to update net-tools ifconfig (one of the two ifconfigs back in 2018).

In 2019, I simply wrote an ifconfig that uses the netlink API, because for portability I needed a Linux ifconfig that had a FreeBSD-like command-line syntax. It doesn't have the old interface aliasing mentioned in the headlined article, and has no problems setting up and reporting IPv6 addresses or additional IPv4 addresses.

* https://unix.stackexchange.com./a/504084/5132

* http://jdebp.uk./Softwares/nosh/guide/commands/ifconfig.xml

I have a system to convert Debian /etc/network/interfaces into a BSD-style rc.conf, which then in turn gets converted into a suite of native service bundles. One of the service bundles is ifconfig@interface , which invokes ifconfig with a uniform command-line syntax across Linux and FreeBSD, hence the need for a more FreeBSD-alike ifconfig on Linux.

* http://jdebp.uk./Softwares/nosh/guide/rcconf-amalgamation.ht...

* http://jdebp.uk./Softwares/nosh/guide/rcconf.html

* http://jdebp.uk./Softwares/nosh/guide/networking.html

Post reply on HN