tcpdump mailing list archives

Re: Legacy Linux kernel support


From: Mario Rugiero <mrugiero () gmail com>
Date: Mon, 7 Oct 2019 14:02:16 -0300

El lun., 7 oct. 2019 a las 12:32, Michael Richardson
(<mcr+ietf () sandelman ca>) escribió:


Mario Rugiero <mrugiero () gmail com> wrote:
    > The 'pcap-linux.c' implementation is plagued by #ifdefs and special
    > cases aiming to support kernels as old as the 2.0.x family era.
    > The oldest version supported by upstream is 3.16.74.

    > The most 'bleeding-edge' supported family has been there since the
    > 2.6.y times, almost 10 years ago, so I think we can assume it's
    > present on any current user's box.

So what would be the oldest kernel that your revised code would support?
I'm reading 3.16?

Yes. Probably older, but as a side effect only, and I wouldn't like that support
to be advertised.
    > Anybody not upgrading the kernel for as long is very unlikely to want
    > to update libpcap.

Well, that's not really true.
There are many cases where people have to debug some silly appliance
that has been locked down to some 2.6 (or 2.4 due to binary blog drivers)
kernel.  They often have to build libpcap/tcpdump elsewhere and copy the
binary over.

Reasonably, though, they could probably build an old version of libpcap.
So, I would ask that the simplified code point to the last version of libpcap
(1.9) that will work in the error message.  Your revision could be in 1.10.

That's reasonable.
We could report it at runtime checking `uname` and at build time by checking
`#ifdef`s and throwing a build time error.
    > I think it would be useful to have the closest to a single build that
    > we can get.
    > I get having different builds for different user facing features
    > (sniffing USB, for example), but not for something the user generally
    > won't know, such as if the kernel where libpcap was built supported
    > TPACKET V2 or V3.

Yes, so the USB sniffer is not in pcap-linux.c, but pcap-usb-linux.c, and I
don't think you propose to change that.

Indeed, I'm not proposing touching that.
    > In the same note, assuming an environment from this decade brings us
    > some possibilities to write simpler and shorter code.
    > For example, querying the present interfaces becomes way easier
    > calling if_nameindex than the current crawl through sysfs.

+1

Now that 1.9.1 is out, now is a great time to do this.
I will attempt to crawl through pull requests that update pcap-linux.c, and
see if there is any low-hanging fruit that we should merge before you
cleanup. I will make some tag for this.  You may want to go ahead of me, as I
won't start before oct. 14, probably finish wednesday Oct. 16.

Great, I'll try to start this week.
--
Michael Richardson <mcr+IETF () sandelman ca>, Sandelman Software Works
 -= IPv6 IoT consulting =-
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: