{
    my $pptpd_status = $pptpd{status} || 'disabled';
    my $pptpd_sessions = $pptpd{sessions} || 0;

    # Do nothing unless we have to
    return "" unless ($pptpd_status eq 'enabled' && $pptpd_sessions);

    # Calculate pptpd start and end addresses
    $pptpd_end_addr =  esmith::util::IPquadToAddr($endDynamicIPRange);
    $pptpd_start_addr = $pptpd_end_addr - $pptpd_sessions + 1;
    # and correct the DHCP dynamic address range
    $endDynamicIPRange = esmith::util::IPaddrToQuad($pptpd_end_addr - $pptpd_sessions);

    # Now let's update the pptpd record if we need to
    my $current_pptpd_start = $pptpd{StartIP} || "";
    unless ($current_pptpd_start eq $pptpd_start_addr)
    {
	my $db = esmith::ConfigDB->open;
	my $pptpd = $db->get('pptpd');
	$pptpd->merge_props(
		StartIP => $pptpd_start_addr,
	    );
    }
    return "# Addresses from " .
	esmith::util::IPaddrToQuad($pptpd_start_addr) .
	" to " .
	esmith::util::IPaddrToQuad($pptpd_start_addr + $pptpd_sessions - 1) .
	" taken for PPTP sessions";
}


