Alleged syntax error in /usr/include/linux/atmppp.h.

Bill Fink billfink at mindspring.com
Sun May 22 08:09:12 MDT 2005


On Sat May 21 05:21:44 MDT 2005, Charles Trois wrote:

> G4 iMac with YDL 4.0.1.
> 
> I'm having trouble in installing ppp-2.4.3:
> 
> make[2]: Entering directory
> `/home/moi/travaux/ppp-2.4.3/pppd/plugins/pppoatm'
> gcc -O2 -g -I../.. -I../../../include -fPIC -I. -c -o pppoatm.o pppoatm.c
> In file included from pppoatm.c:25:
> /usr/include/linux/atmppp.h:20: error: syntax error before "atm_backend_t"
> /usr/include/linux/atmppp.h:22: error: syntax error before '}' token
> pppoatm.c: In function `set_line_discipline_pppoatm':
> pppoatm.c:110: error: storage size of `be' isn't known
> pppoatm.c:118: error: `atm_backend_t' undeclared (first use in this
> function)
> pppoatm.c:118: error: (Each undeclared identifier is reported only once
> pppoatm.c:118: error: for each function it appears in.)
> make[2]: *** [pppoatm.o] Error 1
> make[2]: Leaving directory
> `/home/moi/travaux/ppp-2.4.3/pppd/plugins/pppoatm'
> 
> There are two errors here, but I presume that the second error just
> reflects the first one.
> 
> Here is the full text of atmppp.h:
> 
> > /* atmppp.h - RFC2364 PPPoATM */
> > 
> > /* Written 2000 by Mitchell Blank Jr */
> > 
> > #ifndef _LINUX_ATMPPP_H
> > #define _LINUX_ATMPPP_H
> > 
> > #include <linux/atm.h>
> > 
> > #define PPPOATM_ENCAPS_AUTODETECT	(0)
> > #define PPPOATM_ENCAPS_VC		(1)
> > #define PPPOATM_ENCAPS_LLC		(2)
> > 
> > /*
> >  * This is for the ATM_SETBACKEND call - these are like socket families:
> >  * the first element of the structure is the backend number and the rest
> >  * is per-backend specific
> >  */
> > struct atm_backend_ppp {
> > 	atm_backend_t	backend_num;	/* ATM_BACKEND_PPP */
> > 	int		encaps;		/* PPPOATM_ENCAPS_* */
> > };
> > 
> > #endif	/* _LINUX_ATMPPP_H */
> 
> It looks all right to me, but Splint also points out something:
> 
> [root at sirrah travaux]# splint /usr/include/linux/atmppp.h
> Splint 3.1.1 --- 25 May 2004
> /usr/include/linux/atmppp.h:20:15: Parse Error. (For help on parse
> errors, see splint -help parseerrors.)
> *** Cannot continue.
> [root at sirrah travaux]#
> 
> Where is the bug?

It appears to be a bug in the user include file <linux/atm.h>.

gwiz% grep -r atm_backend_t /usr/include/linux/
/usr/include/linux/atmdev.h:#define ATM_SETBACKEND      _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
/usr/include/linux/atmppp.h:    atm_backend_t   backend_num;    /* ATM_BACKEND_PPP */

There's no definition of atm_backend_t.

But there is in the kernel's version of <linux/atm.h>.

gwiz% grep -r atm_backend_t /usr/src/linux/include/linux/
/usr/src/linux/include/linux/atmbr2684.h:       atm_backend_t   backend_num;  /* ATM_BACKEND_BR2684 */
/usr/src/linux/include/linux/atmbr2684.h:       atm_backend_t   backend_num;  /* ATM_BACKEND_BR2684 */
/usr/src/linux/include/linux/atmdev.h:#define ATM_SETBACKEND    _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
/usr/src/linux/include/linux/atmdev.h:#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
/usr/src/linux/include/linux/atm.h:typedef unsigned short atm_backend_t;
/usr/src/linux/include/linux/atmppp.h:  atm_backend_t   backend_num;    /* ATM_BACKEND_PPP */

So edit the /usr/include/linux/atm.h file and add the following line
right before the last "#endif" at the end of the file:

typedef unsigned short atm_backend_t;

						-Bill


More information about the yellowdog-general mailing list