[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poptop-server
Subject:    Re: [Poptop-server] Please check for remote IP address duplicates in /etc/pptpd.conf
From:       James Cameron <quozl () laptop ! org>
Date:       2016-07-08 4:05:16
Message-ID: 20160708040516.GI18237 () us ! netrek ! org
[Download RAW message or body]

Thanks, pushed as 0c0ad67.

On Thu, Jul 07, 2016 at 10:49:47PM +0200, Christoph Biedl wrote:
> Hello,
> 
> at the moment, pptpd will happily process lines like
> 
> | remoteip 192.168.0.234-234,192.168.0.234,192.168.0.234
> 
> and afterwards state "MGR: Maximum of 3 connections available". While
> technically true, I guess this is never by intention but will result
> in interesting behaviour. Can you please add a check for duplicate
> addresses? It's not urgent at all but avoids havoc if the
> administrator has a bad day.
> 
> The patch below worked for me.
> 
>     Christoph
> 
> --- a/pptpmanager.c
> +++ b/pptpmanager.c
> @@ -136,6 +136,13 @@ void slot_set_local(int i, char *ip)
>  void slot_set_remote(int i, char *ip)
>  {
>    struct slot *slot = &slots[i];
> +  int j;
> +  for (j = 0; j < slot_count; j++) {
> +    if (!slots[j].remote || strcmp(slots[j].remote, ip))
> +      continue;
> +    syslog(LOG_ERR, "MGR: Remote IP address %s in config file is a duplicate!", ip);
> +    exit(1);
> +  }
>    if (slot->remote) free(slot->remote);
>    slot->remote = strdup(ip);
>  }
> 
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Poptop-server mailing list
> Poptop-server@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/poptop-server

-- 
James Cameron
http://quozl.netrek.org/

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Poptop-server mailing list
Poptop-server@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/poptop-server
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic