[net.unix-wizards] if_ex.c multiple interface bug

tcs@usna.arpa (Terry Slattery) (12/19/85)

Index:	/sys/vaxif/if_ex.c

Description:
	Systems with more than one Excelan model 204 ethernet
interface would only correctly configure the first one.  All others
would report a configuration error at boot time.

Fix: Apply the following fix so that the additional interfaces
look at their copy of the softc structure.

92,93c92,93
< #define	RVAL_OFF(n)	((u_long)(&(ex_softc[0].n)) - INCORE_BASE(&ex_softc[0]))
< #define	LVAL_OFF(n)	((u_long)(ex_softc[0].n) - INCORE_BASE(&ex_softc[0]))
---
> #define	RVAL_OFF(n)	((u_long)(&(ex_softc[unit].n)) - INCORE_BASE(&ex_softc[unit]))
> #define	LVAL_OFF(n)	((u_long)(ex_softc[unit].n) - INCORE_BASE(&ex_softc[unit]))
161c161
< 
---
> 	int unit = ui->ui_unit;		/* needed by INCORE_SIZE macro */
216a217
> 	ex_softc[unit].xs_if.if_flags &= ~IFF_RUNNING;
217a219
> printf(" [ex] ");	/* done */


----------------------------------------------------------
	-tcs
	Terry Slattery	  U.S. Naval Academy	301-267-4413
	ARPA: tcs@usna.arpa
	UUCP: decvax!brl-bmd!usna!tcs