Graham Wheeler wrote:
> 
> David Malone wrote:
> >
> > If you read the paragraph below that code, it notes that the ifreq
> > structures are of variable length. The spacing depends on the size
> > of the returned info.
> 
> That's true. In which case the cheops code is wrong, as it iterates
> through the list by incrementing a pointer to a struct ifreq. I'll try
> fix that and get Mark to test under Linux and hopefully get a portable
> solution.

Interestingly enough, a similar bug probably once existed in sysinstall.
In /usr/src/release/sysinstall/devices.c, routine deviceGetAll(), there
is a loop through these structures which also erroneously uses ++ to
increment the struct ifreq* pointer. At the end of the loop, after the
label loopend:, there is a line of code that fixes the pointer, together
with a comment "I'm not sure why this is here - it's inherited".

gr.
-- 
Dr Graham Wheeler                        E-mail: [EMAIL PROTECTED]
Director, Research and Development       WWW:    http://www.cequrux.com
CEQURUX Technologies                     Phone:  +27(21)423-6065
Firewalls/VPN Specialists                Fax:    +27(21)424-3656


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to