Project

General

Profile

Bug #3234

Captive Portal previously declared getNasIP()

Added by Phillip Davis over 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Captive Portal
Target version:
Start date:
09/25/2013
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.1
Affected Architecture:

Description

Reported in forum http://forum.pfsense.org/index.php/topic,66764.0.html:
Fatal error: Cannot redeclare getNasIP() (previously declared in /usr/local/captiveportal/radius_authentication.inc:53) in /etc/inc/captiveportal.inc on line 1576

captiveportal.inc and radius_authentication.inc have identical copies of getNasIP()
captiveportal.inc is not protected by "if (!function_exists('getNasIP')) {}" and there must be some paths where radius_authentication.inc is called first by something else, getNasIP() gets declared, then captiveportal.inc tries to declare it again.

Why is there identical duplicate code?
Should put the function 1 time somewhere common?

Associated revisions

Revision f58bfb93 (diff)
Added by Renato Botelho over 7 years ago

Remove redundant copies of getNasIP(), it should fix #3234

Revision 8ad84ebb (diff)
Added by Renato Botelho over 7 years ago

Remove redundant copies of getNasIP(), it should fix #3234

History

#1 Updated by Renato Botelho over 7 years ago

For instance, there is another copy of the same identical function on radius_accounting.inc

#2 Updated by Phillip Davis over 7 years ago

This is easy to resolve, but best if one of the devs does it, as you guys will know which common include file you prefer it to be in...

#3 Updated by Renato Botelho over 7 years ago

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

#5 Updated by Renato Botelho over 7 years ago

  • Status changed from Feedback to New

Ermal will make changes here

#6 Updated by Ermal Lu├ži about 7 years ago

  • Status changed from New to Feedback

Put this to feedback since the changes will be made when CP functions get merged as system functionality.

#7 Updated by Chris Buechler about 7 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF