[308] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Patch to ppp2.1.2c for 1.2.8 and compressed connection ID problem

daemon@ATHENA.MIT.EDU (Al Longyear)
Fri May 12 03:58:34 1995

From: longyear@netcom.com (Al Longyear)
To: linux-ppp@vger.rutgers.edu, linux-net@vger.rutgers.edu
Date: Thu, 11 May 1995 23:45:26 -0700 (PDT)
Cc: callahan@maths.ox.ac.uk (Michael Callahan)

The following is a patch to correct the problem with vj header
connection id compression which was uncovered with the ppp code in
1.2.8.

It also includes the patch to correct the problem with the alarm
condition which was forgotten from the 2.1.2c daemon uploaded to
sunsite.

When EWT re-enables the Incoming directory at sunsite, I do plan to
update the file. (It is unfortunate that there are some childish
people out there who seem to pass pirated macintosh programs via other
people's ftp services.)

This patch is for the 2.1.2c daemon which is available on
sunsite.unc.edu in the /pub/Linux/system/Network/serial directory (or
should be shortly as I haven't checked lately.)

*** pppd/main.c.orig	Thu May 11 19:32:03 1995
--- pppd/main.c	Thu May 11 19:37:17 1995
***************
*** 188,208 ****
      { UPAP, upap_init, upap_input, upap_protrej, upap_printpkt, "PAP" },
      { CHAP, ChapInit, ChapInput, ChapProtocolReject, ChapPrintPkt, "CHAP" },
  };
  
  #define N_PROTO		(sizeof(prottbl) / sizeof(prottbl[0]))
  
  main(argc, argv)
      int argc;
      char *argv[];
  {
!     int mask, i;
      struct sigaction sa;
      struct cmd *cmdp;
      FILE *pidfile;
      char *p;
      struct passwd *pw;
  
      p = ttyname(0);
      if (p)
  	strcpy(devname, p);
    
--- 188,208 ----
      { UPAP, upap_init, upap_input, upap_protrej, upap_printpkt, "PAP" },
      { CHAP, ChapInit, ChapInput, ChapProtocolReject, ChapPrintPkt, "CHAP" },
  };
  
  #define N_PROTO		(sizeof(prottbl) / sizeof(prottbl[0]))
  
  main(argc, argv)
      int argc;
      char *argv[];
  {
!     sigset_t mask; int i;
      struct sigaction sa;
      struct cmd *cmdp;
      FILE *pidfile;
      char *p;
      struct passwd *pw;
  
      p = ttyname(0);
      if (p)
  	strcpy(devname, p);
    
***************
*** 1256,1275 ****
--- 1256,1282 ----
      int must_exist;
  {
      int pid;
  
      pid = fork();
      if (pid == -1) {
  	syslog(LOG_ERR, "can't fork to run %s: %m", prog);
  	return -1;
      }
      if (pid == 0) {
+         sigset_t alarm_mask;
+ 
+         alarm(0);
+         sigemptyset (&alarm_mask);
+         sigaddset (&alarm_mask, SIGALRM);
+         sigprocmask (SIG_UNBLOCK, &alarm_mask, NULL);
+ 
  	execv(prog, args);
  	if (must_exist || errno != ENOENT)
  	    syslog(LOG_WARNING, "can't execute %s: %m", prog);
  	_exit(-1);
      }
      MAINDEBUG((LOG_DEBUG, "Script %s started; pid = %d", prog, pid));
      ++n_children;
      return 0;
  }
  
*** pppd/ipcp.c.orig	Thu May 11 19:13:35 1995
--- pppd/ipcp.c	Thu May 11 19:17:18 1995
***************
*** 871,891 ****
  		}
  		GETCHAR(cflag, p);
  		if (cflag && !ao->cflag) {
  		    orc = CONFNAK;
  		    if (!reject_if_disagree){
  			DECPTR(1, p);
  			PUTCHAR(wo->cflag, p);
  		    }
  		}
  		ho->maxslotindex = maxslotindex;
! 		ho->cflag = wo->cflag;
  	    } else {
  		ho->old_vj = 1;
  		ho->maxslotindex = MAX_STATES - 1;
  		ho->cflag = 1;
  	    }
  	    break;
  
  	default:
  	    orc = CONFREJ;
  	    break;
--- 871,891 ----
  		}
  		GETCHAR(cflag, p);
  		if (cflag && !ao->cflag) {
  		    orc = CONFNAK;
  		    if (!reject_if_disagree){
  			DECPTR(1, p);
  			PUTCHAR(wo->cflag, p);
  		    }
  		}
  		ho->maxslotindex = maxslotindex;
! 		ho->cflag = cflag; /* was wo->cflag */
  	    } else {
  		ho->old_vj = 1;
  		ho->maxslotindex = MAX_STATES - 1;
  		ho->cflag = 1;
  	    }
  	    break;
  
  	default:
  	    orc = CONFREJ;
  	    break;

-- 
Al Longyear           longyear@netcom.com
Finger for PGP key

home help back first fref pref prev next nref lref last post