Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 1996 01:40:04 -0700 (PDT)
From:      Peter Childs <pjchilds@imforei.apana.org.au>
To:        freebsd-bugs
Subject:   Re: bin/1494: some patches to ijppp
Message-ID:  <199610030840.BAA14764@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/1494; it has been noted by GNATS.

From: Peter Childs <pjchilds@imforei.apana.org.au>
To: FreeBSD-gnats-submit@freefall.freebsd.org
Cc:  Subject: Re: bin/1494: some patches to ijppp
Date: Thu, 3 Oct 1996 17:54:48 +0930 (CST)

  Patches under this report were from a 2.1-stable system.
 
  As I feel there is no chance ever getting these patches into 2.1.5-stable
  i include the "diff" against 2.2-current's ijppp, in the hope that
  some kind individual will see the benifit (no more NT servers doing
  dialup PPP) and commit them.
 
  With this patch Win95 clients only need username,password,phonenumber.
  No scripts, no ip's, out-of-the-box.
 
  There are also a couple of new files for using entries in the password
  file and pap authentication so you don't have to use the
  /etc/ppp/pap.secrets file.. (yuk!)  This is optional (see Makefile)
 
  Fix: patch < this-latest-patch-on-a-freebsd-current-system
  extract "passwdauth.h" and "passwdauth.c" from this file..
  cvs commit :)
 
 -- passwdauth.c
 /*
  *
  * passwdauth.c  - pjchilds@imforei.apana.org.au
  *
  * authenticate user via the password file
  *
  */
 
 #include <sys/types.h>
 #include <utmp.h>
 #include <time.h>
 #include <pwd.h>
 #include "fsm.h"
 #include "passwdauth.h"
 
 int
 PasswdAuth(name, key)
 char *name, *key;
 {
   static int logged_in = 0;
   struct passwd *pwd;
   char *salt, *ep;
   struct utmp utmp;
 
 #ifdef DEBUG
   logprintf( "passwdauth called with name= %s, key= %s\n", name, key );
 #endif /* DEBUG */
 
   if(( pwd = getpwnam( name ) ))
     salt = pwd->pw_passwd;
   else
   {
     endpwent();
     LogPrintf( LOG_LCP, "PasswdAuth - user (%s) not in passwd file\n", name );
     return 0; /* false - failed to authenticate (password not in file) */
   }
 
 #ifdef LOCALHACK
   /*
    * All our PPP usernames start with 'P' so i check that here... if you
    * don't do this i suggest all your PPP users be members of a group
    * and you check the guid
    */
 
   if( name[0] != 'P' )
   { 
     LogPrintf( LOG_LCP, "PasswdAuth - user (%s) not a PPP user\n", name );
     endpwent();
     return 0;
   }
 
 #endif /* LOCALHACK */
 
   ep = crypt( key, salt );
 
   /* strcmp returns 0 if same */
   if( strcmp( ep, pwd->pw_passwd ) != 0 )
   {
     LogPrintf( LOG_LCP, "PasswdAuth - user (%s,%s) authentication failed\n",
 	name, key );
     endpwent();
     return 0;  /* false - failed to authenticate (didn't match up) */
   }
 
   /*
    * now we log them in... we have a static login flag so we don't
    * do it twice :)
    */
 
   if( ! logged_in )
   {
     (void)time(&utmp.ut_time);
     (void)strncpy(utmp.ut_name, name, sizeof(utmp.ut_name));
 
 #ifdef LOCALHACK
 
     /* we trim the first three characters off here.. see sample.ppp.conf */
     (void)strncpy(utmp.ut_line, (char *)(dstsystem + 3), sizeof(utmp.ut_line));
 
 #else
 
     (void)strncpy(utmp.ut_line, dstsystem, sizeof(utmp.ut_line));
 
 #endif /* LOCALHACK */
 
     (void)strcpy(utmp.ut_host, "auto-ppp" );
     login(&utmp);
     (void)setlogin( pwd->pw_name );
 
     LogPrintf( LOG_LCP, "PasswdAuth has logged in user %s\n", name );
 
     logged_in = 1;
   }
 
   endpwent();
 
   return 1;
 }
 
 -- dev/ppp-plus-current/passwdauth.h
 /*
  * passwdauth.h
  *
  */
 
 #ifndef _PASSWDAUTH_H_
 #define _PASSWDAUTH_H_
 
 extern int PasswdAuth __P((char *, char *));
 
 #endif
 
 --
 
 diff -c ppp-current/Makefile ppp-plus-current/Makefile
 *** ppp-current/Makefile	Mon Mar  4 21:08:41 1996
 --- ppp-plus-current/Makefile	Fri Sep  6 23:58:13 1996
 ***************
 *** 4,13 ****
   SRCS=	async.c auth.c ccp.c chap.c chat.c command.c filter.c fsm.c hdlc.c \
   	ip.c ipcp.c lcp.c lqr.c log.c main.c mbuf.c modem.c os.c \
   	pap.c pred.c route.c slcompress.c timer.c systems.c uucplock.c vars.c \
 ! 	vjcomp.c arp.c
   #CFLAGS+= -DHAVE_SHELL_CMD_WITH_ANY_MODE
 ! CFLAGS += -Wall -DUSE_PERROR
 ! LDADD += -lmd
   DPADD += ${LIBMD}
   MAN8=	ppp.8
   BINMODE=4555
 --- 4,13 ----
   SRCS=	async.c auth.c ccp.c chap.c chat.c command.c filter.c fsm.c hdlc.c \
   	ip.c ipcp.c lcp.c lqr.c log.c main.c mbuf.c modem.c os.c \
   	pap.c pred.c route.c slcompress.c timer.c systems.c uucplock.c vars.c \
 ! 	vjcomp.c arp.c passwdauth.c
   #CFLAGS+= -DHAVE_SHELL_CMD_WITH_ANY_MODE
 ! CFLAGS += -Wall -DUSE_PERROR -DMSEXT -DPASSWDAUTH -DLOCALHACK
 ! LDADD += -lmd -lcrypt -lutil
   DPADD += ${LIBMD}
   MAN8=	ppp.8
   BINMODE=4555
 diff -c ppp-current/command.c ppp-plus-current/command.c
 *** ppp-current/command.c	Mon Jun 10 06:10:58 1996
 --- ppp-plus-current/command.c	Sat Sep  7 00:00:37 1996
 ***************
 *** 360,365 ****
 --- 360,377 ----
     return(1);
   }
   
 + #ifdef MSEXT
 + static int ShowMSExt()
 + {
 +   printf(" MS PPP extention values \n" );
 +   printf("   Primary NS     : %s\n", inet_ntoa( ns_entries[0] ));
 +   printf("   Secondary NS   : %s\n", inet_ntoa( ns_entries[1] ));
 +   printf("   Primary NBNS   : %s\n", inet_ntoa( nbns_entries[0] ));
 +   printf("   Secondary NBNS : %s\n", inet_ntoa( nbns_entries[1] ));
 + 
 +   return(1);
 + }
 + #endif /* MSEXT */
   
   extern int ShowIfilter(), ShowOfilter(), ShowDfilter(), ShowAfilter();
   
 ***************
 *** 402,407 ****
 --- 414,423 ----
   	"Show Idle timeout value", StrNull},
     { "redial",   NULL,	  ShowRedial,		LOCAL_AUTH,
   	"Show Redial timeout value", StrNull},
 + #ifdef MSEXT
 +   { "msext", 	NULL,	  ShowMSExt,		LOCAL_AUTH,
 + 	"Show MS PPP extention values", StrNull},
 + #endif /* MSEXT */
     { "version",  NULL,	  ShowVersion,		LOCAL_NO_AUTH | LOCAL_AUTH,
   	"Show version string", StrNull},
     { "help",     "?",      HelpCommand,		LOCAL_NO_AUTH | LOCAL_AUTH,
 ***************
 *** 807,812 ****
 --- 823,881 ----
     return(1);
   }
   
 + #ifdef MSEXT
 + 
 + void
 + SetMSEXT(pri_addr, sec_addr, argc, argv)
 + struct in_addr *pri_addr;
 + struct in_addr *sec_addr;
 + int argc;
 + char **argv;
 + {
 +   int dummyint;
 +   struct in_addr dummyaddr;
 + 
 +   pri_addr->s_addr = sec_addr->s_addr = 0L;
 + 
 +   if( argc > 0 ) {
 +     ParseAddr(argc, argv++, pri_addr, &dummyaddr, &dummyint);
 +     if( --argc > 0 ) 
 +       ParseAddr(argc, argv++, sec_addr, &dummyaddr, &dummyint);
 +     else
 +       sec_addr->s_addr = pri_addr->s_addr;
 +   }
 + 
 +  /*
 +   * if the primary/secondary ns entries are 0.0.0.0 we should 
 +   * set them to either the localhost's ip, or the values in
 +   * /etc/resolv.conf ??
 +   *
 +   * up to you if you want to implement this...
 +   */
 + 
 + }
 + 
 + static int
 + SetNS(list, argc, argv)
 + struct cmdtab *list;
 + int argc;
 + char **argv;
 + {
 +   SetMSEXT(&ns_entries[0], &ns_entries[1], argc, argv);
 +   return(1);
 + }
 + 
 + static int
 + SetNBNS(list, argc, argv)
 + struct cmdtab *list;
 + int argc;
 + char **argv;
 + {
 +   SetMSEXT(&nbns_entries[0], &nbns_entries[1], argc, argv);
 +   return(1);
 + }
 + 
 + #endif /* MS_EXT */
   
   #define	VAR_AUTHKEY	0
   #define	VAR_DIAL	1
 ***************
 *** 918,923 ****
 --- 987,998 ----
   	"Set Idle timeout", StrValue},
     { "redial",   NULL,     SetRedialTimeout,	LOCAL_AUTH,
   	"Set Redial timeout", "value|random [dial_attempts]"},
 + #ifdef MSEXT
 +   { "ns",	NULL,	  SetNS,		LOCAL_AUTH,
 + 	"Set NameServer", "pri-addr [sec-addr]"},
 +   { "nbns",	NULL,	  SetNBNS,		LOCAL_AUTH,
 + 	"Set NetBIOS NameServer", "pri-addr [sec-addr]"},
 + #endif /* MSEXT */
     { "help",     "?",      HelpCommand,		LOCAL_AUTH | LOCAL_NO_AUTH,
   	"Display this message", StrNull, (void *)SetCommands},
     { NULL,       NULL,     NULL },
 diff -c ppp-current/ipcp.c ppp-plus-current/ipcp.c
 *** ppp-current/ipcp.c	Sun May 12 06:18:26 1996
 --- ppp-plus-current/ipcp.c	Sat Sep  7 00:04:23 1996
 ***************
 *** 43,48 ****
 --- 43,52 ----
   struct ipcpstate IpcpInfo;
   struct in_range DefMyAddress, DefHisAddress, DefTriggerAddress;
   
 + #ifdef MSEXT
 + struct in_addr ns_entries[2], nbns_entries[2];
 + #endif /* MSEXT */
 + 
   static void IpcpSendConfigReq __P((struct fsm *));
   static void IpcpSendTerminateAck __P((struct fsm *));
   static void IpcpSendTerminateReq __P((struct fsm *));
 ***************
 *** 310,316 ****
     int type, length;
     u_long *lp, compproto;
     struct compreq *pcomp;
 !   struct in_addr ipaddr, dstipaddr;
     char tbuff[100];
   
     ackp = AckBuff;
 --- 314,320 ----
     int type, length;
     u_long *lp, compproto;
     struct compreq *pcomp;
 !   struct in_addr ipaddr, dstipaddr, dnsstuff, ms_info_req;
     char tbuff[100];
   
     ackp = AckBuff;
 ***************
 *** 452,457 ****
 --- 456,557 ----
   	break;
         }
         break;
 + 
 +  /*
 +   * MS extensions for MS's PPP 
 +   */
 + 
 + #ifdef MSEXT
 +     case TY_PRIMARY_DNS:   /* MS PPP DNS negotiation hack */
 +     case TY_SECONDARY_DNS:
 +       if( !Enabled( ConfMSExt ) ) {
 + 	LogPrintf( LOG_LCP, "MS NS req - rejected - msext disabled\n" );
 + 	IpcpInfo.my_reject |= ( 1 << type );
 + 	bcopy(cp, rejp, length);
 + 	rejp += length;
 + 	break;
 +       }
 +       switch( mode ){
 +       case MODE_REQ:
 + 	lp = (u_long *)(cp + 2);
 + 	dnsstuff.s_addr = *lp;
 + 	ms_info_req.s_addr = ns_entries[((type - TY_PRIMARY_DNS)?1:0)].s_addr;
 + 	if( dnsstuff.s_addr != ms_info_req.s_addr )
 + 	{
 + 	  /*
 + 	   So the client has got the DNS stuff wrong (first request)
 + 	   so well tell 'em how it is           
 + 	  */
 + 	  bcopy( cp, nakp, 2 );  /* copy first two (type/length) */
 + 	  LogPrintf( LOG_LCP, "MS NS req %d:%s->%s - nak\n",
 + 		type,
 + 		inet_ntoa( dnsstuff ),
 + 		inet_ntoa( ms_info_req ));
 + 	  bcopy( &ms_info_req, nakp+2, length );
 + 	  nakp += length;
 + 	  break;
 + 	}
 + 	  /*
 + 	   Otherwise they have it right (this time) so we send
 + 	   a ack packet back confirming it... end of story
 + 	  */
 + 	LogPrintf( LOG_LCP, "MS NS req %d:%s ok - ack\n",
 + 		type,
 + 		inet_ntoa( ms_info_req ));
 + 	bcopy( cp, ackp, length );
 + 	ackp += length;
 + 	break;
 +       case MODE_NAK: /* what does this mean?? */
 + 	LogPrintf(LOG_LCP, "MS NS req %d - NAK??\n", type );
 + 	break;
 +       case MODE_REJ: /* confused?? me to :) */
 + 	LogPrintf(LOG_LCP, "MS NS req %d - REJ??\n", type );
 + 	break;
 +       }
 +       break;
 + 
 +     case TY_PRIMARY_NBNS:   /* MS PPP NetBIOS nameserver hack */
 +     case TY_SECONDARY_NBNS:
 +     if( !Enabled( ConfMSExt ) ) {
 +       LogPrintf( LOG_LCP, "MS NBNS req - rejected - msext disabled\n" );
 +       IpcpInfo.my_reject |= ( 1 << type );
 +       bcopy( cp, rejp, length );
 +       rejp += length;
 +       break;
 +     }
 +       switch( mode ){
 +       case MODE_REQ:
 + 	lp = (u_long *)(cp + 2);
 + 	dnsstuff.s_addr = *lp;
 + 	ms_info_req.s_addr = nbns_entries[((type - TY_PRIMARY_NBNS)?1:0)].s_addr;
 + 	if( dnsstuff.s_addr != ms_info_req.s_addr )
 + 	{
 + 	  bcopy( cp, nakp, 2 );
 + 	  bcopy( &ms_info_req.s_addr , nakp+2, length );
 + 	  LogPrintf( LOG_LCP, "MS NBNS req %d:%s->%s - nak\n",
 + 		type,
 + 		inet_ntoa( dnsstuff ),
 + 		inet_ntoa( ms_info_req ));
 + 	  nakp += length;
 + 	  break;
 + 	}
 + 	LogPrintf( LOG_LCP, "MS NBNS req %d:%s ok - ack\n",
 + 		type,
 + 		inet_ntoa( ms_info_req ));
 + 	bcopy( cp, ackp, length );
 + 	ackp += length;
 + 	break;
 +       case MODE_NAK:
 + 	LogPrintf( LOG_LCP, "MS NBNS req %d - NAK??\n", type );
 + 	break;
 +       case MODE_REJ:
 + 	LogPrintf( LOG_LCP, "MS NBNS req %d - REJ??\n", type );
 + 	break;
 +       }
 +       break;
 + 
 + #endif /* MSEXT */
 + 
       default:
         IpcpInfo.my_reject |= (1 << type);
         bcopy(cp, rejp, length);
 diff -c ppp-current/ipcp.h ppp-plus-current/ipcp.h
 *** ppp-current/ipcp.h	Sat Jul  8 17:58:10 1995
 --- ppp-plus-current/ipcp.h	Sat Sep  7 00:04:23 1996
 ***************
 *** 29,34 ****
 --- 29,45 ----
   #define	TY_COMPPROTO	2
   #define	TY_IPADDR	3
   
 + /* MS PPP NameServer and NetBIOS NameServer stuff */
 + 
 + #ifdef MSEXT
 + 
 + #define TY_PRIMARY_DNS		129
 + #define TY_PRIMARY_NBNS		130
 + #define TY_SECONDARY_DNS	131
 + #define TY_SECONDARY_NBNS	132
 + 
 + #endif /* MSEXT */
 + 
   struct ipcpstate {
     struct  in_addr his_ipaddr;	/* IP address he is willing to use */
     u_long  his_compproto;
 ***************
 *** 57,62 ****
 --- 68,78 ----
   extern struct in_range DefMyAddress;
   extern struct in_range DefHisAddress;
   extern struct in_range DefTriggerAddress;
 + 
 + #ifdef MSEXT
 + extern struct in_addr ns_entries[2];
 + extern struct in_addr nbns_entries[2];
 + #endif /* MSEXT */
   
   extern void IpcpInit __P((void));
   extern void IpcpDefAddress __P((void));
 diff -c ppp-current/pap.c ppp-plus-current/pap.c
 *** ppp-current/pap.c	Sun May 12 06:18:38 1996
 --- ppp-plus-current/pap.c	Sat Sep  7 00:07:12 1996
 ***************
 *** 111,116 ****
 --- 111,125 ----
   #ifdef DEBUG
     logprintf("name: %s (%d), key: %s (%d)\n", name, nlen, key, klen);
   #endif
 + 
 + #ifdef PASSWDAUTH
 +   if( Enabled( ConfPasswdAuth ) )
 +   {
 +     LogPrintf( LOG_LCP, "PasswdAuth enabled - calling\n" );
 +     return PasswdAuth( name, key );
 +   }
 + #endif /* PASSWDAUTH */
 + 
     return(AuthValidate(SECRETFILE, name, key));
   }
   
 Only in ppp-plus-current: passwdauth.c
 Only in ppp-plus-current: passwdauth.h
 diff -c ppp-current/ppp.8 ppp-plus-current/ppp.8
 *** ppp-current/ppp.8	Sun May 12 06:18:40 1996
 --- ppp-plus-current/ppp.8	Sat Sep  7 00:17:25 1996
 ***************
 *** 6,12 ****
   .Sh NAME
   .Nm ppp
   .Nd
 ! Point to Point Protocol (aka iijppp)
   .Sh SYNOPSIS
   .Nm
   .Op Fl auto | Fl direct | Fl dedicated
 --- 6,12 ----
   .Sh NAME
   .Nm ppp
   .Nd
 ! Point to Point Protocol (aka iijppp) 
   .Sh SYNOPSIS
   .Nm
   .Op Fl auto | Fl direct | Fl dedicated
 ***************
 *** 60,66 ****
    
   .It Supports PAP and CHAP authentication.
   
 - 
   .It Supports Proxy Arp.
   When
   .Em PPP
 --- 60,65 ----
 ***************
 *** 101,106 ****
 --- 100,111 ----
   .Em all
   data flowing through the link, thus reducing overhead to a minimum.
   
 + .It Supports Microsofts IPCP extentions.
 + Name Server Addresses and NetBIOS Name Server Addresses can be negotiated
 + with clients using the Microsoft
 + .Em PPP
 + stack (ie. Win95, WinNT)
 + 
   .It Runs under BSDI-1.1 and FreeBSD.
   
   .El
 ***************
 *** 421,427 ****
   .Pa /etc/ppp/ppp.conf.filter.example .
   
   
 ! .Sh RECEIVING INCOMING PPP CONNECTIONS
   
   To handle an incoming
   .Em PPP
 --- 426,432 ----
   .Pa /etc/ppp/ppp.conf.filter.example .
   
   
 ! .Sh RECEIVING INCOMING PPP CONNECTIONS (Method 1)
   
   To handle an incoming
   .Em PPP
 ***************
 *** 469,476 ****
   
   (You can specify a label name for further control.)
   
 - .El
 - 
   .Pp
   Direct mode (
   .Fl direct )
 --- 474,479 ----
 ***************
 *** 478,484 ****
   .Nm
   work with stdin and stdout.  You can also telnet to port 3000 to get
   command mode control in the same manner as client-side
 ! .Nm .
   
   .Sh SETTING IDLE, LINE QUALITY REQUEST, RETRY TIMER
   
 --- 481,542 ----
   .Nm
   work with stdin and stdout.  You can also telnet to port 3000 to get
   command mode control in the same manner as client-side
 ! .Nm.
 ! 
 ! .It
 ! Optional support for Microsoft's IPCP Name Server and NetBIOS
 ! Name Server negotiation can be enabled use
 ! .Dq enable msext
 ! and 
 ! .Dq set ns pri-addr [sec-addr]
 ! along with
 ! .Dq set nbns pri-addr [sec-addr]
 ! in your ppp.conf file
 ! 
 ! .El
 ! 
 ! .Sh RECEIVING INCOMING PPP CONNECTIONS (Method 2)
 ! 
 ! This method differs in that it recommends the use of 
 ! .Em mgetty+sendfax
 ! to handle the modem connections.  The latest version 0.99
 ! can be compiled with the
 ! .Dq AUTO_PPP
 ! option to allow detection of clients speaking PPP to the login
 ! prompt.
 ! 
 ! Follow these steps:
 ! 
 ! .Bl -enum
 ! .It
 ! Get, configure, and install mgetty+sendfax v0.99 or later (beta)
 ! making sure you have used the AUTO_PPP option.
 ! .It
 ! Edit
 ! .Pa /etc/ttys
 ! to enable a mgetty on the port where the modem is attached.
 ! 
 ! For example:
 ! 
 ! .Dl cuaa1  "/usr/local/sbin/mgetty -s 57600"       dialup on
 ! 
 ! .It
 ! Prepare an account for the incoming user.
 ! .Bd -literal
 ! Pfred:xxxx:66:66:Fred's PPP:/home/ppp:/etc/ppp/ppp-dialup
 ! .Ed
 ! 
 ! .It
 ! Examine the files
 ! .Pa /etc/ppp/sample.ppp-dialup
 ! .Pa /etc/ppp/sample.ppp-pap-dialup
 ! and
 ! .Pa /etc/ppp/sample.ppp.conf
 ! for ideas.   ppp-pap-dialup is supposed to be called from
 ! .Pa /usr/local/etc/mgetty+sendfax/login.conf
 ! from a line like
 ! 
 ! .Dl /AutoPPP/ -     -       /etc/ppp/ppp-pap-dialup
   
   .Sh SETTING IDLE, LINE QUALITY REQUEST, RETRY TIMER
   
 diff -c ppp-current/route.c ppp-plus-current/route.c
 *** ppp-current/route.c	Tue Aug 13 18:49:45 1996
 --- ppp-plus-current/route.c	Sat Sep  7 00:10:56 1996
 ***************
 *** 351,364 ****
     free(sp);
   }
   
   int
   GetIfIndex(name)
   char *name;
   {
     struct ifreq *ifrp;
     int s, len, elen, index;
     struct ifconf ifconfs;
 !   struct ifreq reqbuf[32];
   
     s = socket(AF_INET, SOCK_DGRAM, 0);
     if (s < 0) {
 --- 351,370 ----
     free(sp);
   }
   
 +  /*
 +   * 960603 - Modified to use dynamic buffer allocator as in ifconfig
 +   */
 + 
   int
   GetIfIndex(name)
   char *name;
   {
 +   char *buffer;
     struct ifreq *ifrp;
     int s, len, elen, index;
     struct ifconf ifconfs;
 !   /* struct ifreq reqbuf[256]; -- obsoleted :) */
 !   int oldbufsize, bufsize = sizeof(struct ifreq);
   
     s = socket(AF_INET, SOCK_DGRAM, 0);
     if (s < 0) {
 ***************
 *** 366,377 ****
       return(-1);
     }
   
 !   ifconfs.ifc_len = sizeof(reqbuf);
 !   ifconfs.ifc_buf = (caddr_t)reqbuf;
 !   if (ioctl(s, SIOCGIFCONF, &ifconfs) < 0) {
 !     perror("IFCONF");
 !     return(-1);
 !   }
   
     ifrp = ifconfs.ifc_req;
   
 --- 372,398 ----
       return(-1);
     }
   
 !   buffer = malloc(bufsize);   /* allocate first buffer */
 !   ifconfs.ifc_len = bufsize;  /* Initial setting */
 !   /*
 !    * Iterate through here until we don't get many more data 
 !    */
 ! 
 !   do {
 !       oldbufsize = ifconfs.ifc_len;
 !       bufsize += 1+sizeof(struct ifreq);
 !       buffer = realloc((void *)buffer, bufsize);      /* Make it bigger */
 ! #ifdef DEBUG
 !       logprintf ("Growing buffer to %d\n", bufsize);
 ! #endif
 !       ifconfs.ifc_len = bufsize;
 !       ifconfs.ifc_buf = buffer;
 !       if (ioctl(s, SIOCGIFCONF, &ifconfs) < 0) {
 !           perror("IFCONF");
 !           free(buffer);
 !           return(-1);
 !       }
 !   } while (ifconfs.ifc_len > oldbufsize);
   
     ifrp = ifconfs.ifc_req;
   
 ***************
 *** 385,390 ****
 --- 406,412 ----
   #endif
         if (strcmp(ifrp->ifr_name, name) == 0) {
           IfIndex = index;
 +       free(buffer);
           return(index);
         }
         index++;
 ***************
 *** 396,400 ****
 --- 418,423 ----
     }
   
     close(s);
 +   free(buffer);
     return(-1);
   }
 Only in ppp-plus-current: sample.ppp-dialup
 Only in ppp-plus-current: sample.ppp-pap-dialup
 Only in ppp-plus-current: sample.ppp.conf
 Only in ppp-plus-current: uucplock.c
 diff -c ppp-current/vars.c ppp-plus-current/vars.c
 *** ppp-current/vars.c	Thu Jan 11 07:58:04 1996
 --- ppp-plus-current/vars.c	Sat Sep  7 00:14:28 1996
 ***************
 *** 42,48 ****
     { "acfcomp",   CONF_ENABLE,  CONF_ACCEPT },
     { "protocomp", CONF_ENABLE,  CONF_ACCEPT },
     { "pred1",	 CONF_ENABLE,  CONF_ACCEPT },
 !   { "proxy",	 CONF_DISABLE, CONF_DENY },
     { NULL },
   };
   
 --- 42,50 ----
     { "acfcomp",   CONF_ENABLE,  CONF_ACCEPT },
     { "protocomp", CONF_ENABLE,  CONF_ACCEPT },
     { "pred1",	 CONF_ENABLE,  CONF_ACCEPT },
 !   { "proxy",	 CONF_DISABLE, CONF_DENY   },
 !   { "msext",     CONF_DISABLE, CONF_ACCEPT },
 !   { "passwdauth",CONF_ENABLE,  CONF_DENY   },
     { NULL },
   };
   
 diff -c ppp-current/vars.h ppp-plus-current/vars.h
 *** ppp-current/vars.h	Fri Mar  8 23:52:23 1996
 --- ppp-plus-current/vars.h	Sat Sep  7 00:15:51 1996
 ***************
 *** 44,50 ****
   #define	ConfProtocomp	5
   #define	ConfPred1	6
   #define	ConfProxy	7
 ! #define	MAXCONFS	8
   
   #define	Enabled(x)	(pppConfs[x].myside & CONF_ENABLE)
   #define	Acceptable(x)	(pppConfs[x].hisside & CONF_ACCEPT)
 --- 44,52 ----
   #define	ConfProtocomp	5
   #define	ConfPred1	6
   #define	ConfProxy	7
 ! #define ConfMSExt	8
 ! #define ConfPasswdAuth	9
 ! #define	MAXCONFS	10
   
   #define	Enabled(x)	(pppConfs[x].myside & CONF_ENABLE)
   #define	Acceptable(x)	(pppConfs[x].hisside & CONF_ACCEPT)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610030840.BAA14764>