PacketFence - BTS - PacketFence
View Issue Details
0001353PacketFenceconfigurationpublic2011-12-29 09:262012-10-19 10:13
dwuelfrath 
dwuelfrath 
normalminorhave not tried
closedduplicate 
devel 
3.4.03.4.0 
0001353: configurator not finding interfaces
The function get_networkinfos actualy parses the output of “/sbin/ifconfig –a”

Trying to match for “inet addr” and “mask” (to make the mater short)

But our system is localized (in French ) so addr -à adr and mask -> masque …

It gave us an empty networks.conf that we had to populate by hand…

Without that, rerunning configurator.pl gave the error “Invalid existing networks configuration file :” at ./configurator.pl line 89

Solution:

Line 465 we made a modification …

If ( ( /inet addr:((?:\d{1,3}\.){3}\d{1,3}).+Mask:((?:\d{1,3}\.){3}\d{1,3})/ ) || ( /inet adr:((?:\d{1,3}\.){3}\d{1,3}).+Masque:((?:\d{1,3}\.){3}\d{1,3})/ ) ) {

So now it detects the interfaces ….

Question:

 1) why not using /sbin/ip (from iproute package)

2) the script include the Net::Interface module why not using this ?
No tags attached.
duplicate of 0001418closed obilodeau configurator.pl does not work correctly under a french localized CentOS 6.2 
child of 0001444closed  web-based configuration wizard 
? perl_pmask.pm (1,565) 2012-01-17 07:17
https://www.packetfence.org/bugs/file_download.php?file_id=130&type=bug
? get_networkinfos.pm (1,479) 2012-01-17 07:18
https://www.packetfence.org/bugs/file_download.php?file_id=131&type=bug
Issue History
2011-12-29 09:26dwuelfrathNew Issue
2011-12-29 09:26dwuelfrathStatusnew => assigned
2011-12-29 09:26dwuelfrathAssigned To => dwuelfrath
2011-12-30 11:37obilodeauNote Added: 0002492
2012-01-17 07:17dwygodzkiFile Added: perl_pmask.pm
2012-01-17 07:18dwygodzkiFile Added: get_networkinfos.pm
2012-01-17 07:19dwygodzkiNote Added: 0002538
2012-05-07 15:35obilodeauRelationship addedchild of 0001444
2012-06-20 05:19dwygodzkiNote Added: 0002817
2012-06-21 20:25obilodeauNote Added: 0002819
2012-06-21 20:26obilodeauRelationship addedduplicate of 0001418
2012-06-21 20:27obilodeauStatusassigned => closed
2012-06-21 20:27obilodeauResolutionopen => duplicate
2012-06-21 20:27obilodeauFixed in Version => 3.4.0
2012-10-19 10:13fgaudreaultTarget Version+1 => 3.4.0

Notes
(0002492)
obilodeau   
2011-12-30 11:37   
A solution like that is not viable since the regexp will have to be adapted to every language.

Naive fix would be to add LC_ALL=C before calling ifconfig so that it will output in english.

Good fix would be to port to a perl interface like Net::Interface. It has not been done because Net::Interface dependency was added when we added a feature and we did not modify the old working code to avoid breaking things.

The /sbin/ip solution would have the same problem as ifconfig's: localized output strings.
(0002538)
dwygodzki   
2012-01-17 07:19   
just have reworked the sub to use net::interface , not yet fully tested .
(0002817)
dwygodzki   
2012-06-20 05:19   
resolved by 001418 now
(0002819)
obilodeau   
2012-06-21 20:25   
Sorry if we haven't used your patch but as you can hear on the -devel list and on github we are working on a web-based configurator and we are actually in extensive testing phase now so we didn't want to invest the time in switching to N::I and honestly I didn't see the email with your patch pass..

Thanks for letting us know it's fixed. I'm closing this.