Subject: Re: ucd-snmp-3.1.2.1 comile error
To: None <wulf@ping.net.au>
From: Mike Long <mike.long@analog.com>
List: port-i386
Date: 01/13/1997 21:49:54
>From: Berndt Josef Wulf <wulf@ping.net.au>
>Date: Tue, 14 Jan 1997 12:50:53 +1030 (CST)

>	snmp_vars.c: In function `var_ipAddrEntry':
>	snmp_vars.c:2202: invalid operands to binary ==
>	*** Error code 1

>the code in question looks like this:
>
>      if ( ifnet.if_addrlist == 0 )
>		continue;      /* No address found for  interface */
>
>/usr/include/net/if.h  defines struct ifnet as:
>
>struct ifnet {                   
>        void    *if_softc;        
>	TAILQ_ENTRY(ifnet) if_list; 
>		are chained */
>	TAILQ_HEAD(, ifaddr) if_addrlist; 
>	....
>
>and TAILQ_HEAD is defined in /usr/include/sys/queue.h
>
>#define TAILQ_HEAD(name, type)
>struct name {
>        struct type *tqe_next;
>	struct type **tqe_prev;
>}
>
>How do I get it to compile? The README file reports this package to be
>working under NetBSD-1.1 and NetBSD-1.2.... which gives me some hope
>to complete my project ;)

The compiler complains because the code is trying to compare a
structure to a scalar.

You need to port any code which accesses if_addrlist to access it as a
TAILQ instead of a straightforward linked list.  That means replacing
'if_addrlist' with 'if_addrlist.tqe_next', etc.
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil