Re: Please check for remote IP address duplicates in /etc/pptpd.conf
James Cameron <[email protected]> Fri, 8 Jul 2016 14:05:16 +1000
| Newsgroups | gmane.network.poptop |
|---|---|
| Organization | Netrek Vanilla Server Dictator |
| Message-ID | <[email protected]> |
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
> [email protected]
> 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