Project

General

Profile

Bug #3172

function return_gateway_groups_array() returns the incorrect vip

Added by Shahid Sheikh about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Gateways
Target version:
Start date:
08/31/2013
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.1
Affected Architecture:

Description

I am not even a PHP novice so please take these findings with a grain of salt.

The vip returned is always the last vip that the


        foreach ($group['item'] as $item) { ... }

starting line 690 of gwlb.inc iterates through.

In my case this is causing OpenVPN Server to bind to the vip on the backup tier.

I think to fix it two changes are needed.

1. Line 694 should be:

        if (!is_array($gwvip_arr[$group['name']]))

and 2. Lines 766 and 767 should be:

        if (is_array($gwvip_arr[$group['name']])&& !empty($gwvip_arr[$group['name']][$member]))
            $groupmember['vip'] = $gwvip_arr[$group['name']][$member];

Thanks,

Shahid

Associated revisions

Revision 22234bbb (diff)
Added by Renato Botelho about 6 years ago

Fix #3172, return_gateway_groups_array() was returning the last vip since it was using wrong variable name on iteration

Revision 7a6851df (diff)
Added by Renato Botelho about 6 years ago

Fix #3172, return_gateway_groups_array() was returning the last vip since it was using wrong variable name on iteration

History

#1 Updated by Renato Botelho about 6 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#3 Updated by Chris Buechler about 6 years ago

Shahid: can you please confirm if that fixed what you were seeing?

#4 Updated by Shahid Sheikh about 6 years ago

Yep, its fixed. Thx.

#5 Updated by Renato Botelho about 6 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF