]> git.ozlabs.org Git - ppp.git/commitdiff
Merge branch 'master' of https://github.com/gburgessiv/ppp
authorPaul Mackerras <paulus@ozlabs.org>
Sat, 18 Mar 2017 11:24:25 +0000 (22:24 +1100)
committerPaul Mackerras <paulus@ozlabs.org>
Sat, 18 Mar 2017 11:24:25 +0000 (22:24 +1100)
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
1  2 
pppd/main.c

diff --combined pppd/main.c
index f1986ed68d0b7e4d00f81b956e2abbb263b79d7a,aef9e84775922a59cf6fb960d6f3aea53914ad7a..76b67d2485b71ce4dc11c6a9cd7ecfd2293f21d9
  static const char rcsid[] = RCSID;
  
  /* interface vars */
 -char ifname[32];              /* Interface name */
 +char ifname[MAXIFNAMELEN];    /* Interface name */
  int ifunit;                   /* Interface unit number */
  
  struct channel *the_channel;
@@@ -257,7 -257,6 +257,6 @@@ static void cleanup_db __P((void))
  static void handle_events __P((void));
  void print_link_stats __P((void));
  
- extern        char    *ttyname __P((int));
  extern        char    *getlogin __P((void));
  int main __P((int, char *[]));
  
@@@ -298,6 -297,13 +297,6 @@@ struct protent *protocols[] = 
      NULL
  };
  
 -/*
 - * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
 - */
 -#if !defined(PPP_DRV_NAME)
 -#define PPP_DRV_NAME  "ppp"
 -#endif /* !defined(PPP_DRV_NAME) */
 -
  int
  main(argc, argv)
      int argc;
@@@ -730,11 -736,8 +729,11 @@@ voi
  set_ifunit(iskey)
      int iskey;
  {
 -    info("Using interface %s%d", PPP_DRV_NAME, ifunit);
 -    slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
 +    if (req_ifname[0] != '\0')
 +      slprintf(ifname, sizeof(ifname), "%s", req_ifname);
 +    else
 +      slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
 +    info("Using interface %s", ifname);
      script_setenv("IFNAME", ifname, iskey);
      if (iskey) {
        create_pidfile(getpid());       /* write pid to file */