qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition
Date: Wed, 15 Feb 2012 23:21:25 +0000

On 15 February 2012 23:02, Andreas Färber <address@hidden> wrote:
> Am 15.02.2012 10:38, schrieb Michael S. Tsirkin:
>> why does slirp have all these
>> defines in the first place?
>>
>> slirp/mbuf.h:#define m_nextpkt  m_hdr.mh_nextpkt
>> slirp/mbuf.h:#define ifs_next m_nextpkt
>>
>> Seriously, #define for a field name?

> Maybe historically
> m_hdr.mh_nextpkt was m_nextpkt and someone tried to avoid a full
> refactoring.

This comes from a BSD header originally, and I guess in the BSD
context it would have been preserving source compatibility with
older versions of BSD where the fields really were all in the mbuf
struct. Here's 4.2BSD, for instance:

http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/h/mbuf.h

The split out of the header fields and the introduction of these
macros seems to have happened somewhere between 4.3BSD-Tahoe in
1988 and 4.3BSD-Reno in 1990: you can see them here:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/sys/sys/mbuf.h

Anyway, we can happily clean up since we're not trying to be backward
compatible with anything (assuming you have no objection to
deleting a historical artefact that's over twenty years old :-))

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]