Project

General

Profile

Bug #2758

Old configuration remains when changing interface type

Added by Renato Botelho over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Ermal Luçi
Category:
Interfaces
Target version:
Start date:
01/16/2013
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.0.x
Affected Architecture:
All

Description

When interface type is changed, new type is configured correctly but the old type configuration is not cleaned up.

When changing from Static IP to PPPoE, the static IP is still configured on interface.
When changing from DHCP to other type, dhclient is not killed.
When changing from any ppp type to a non-ppp one, mpd is not killed.

patch-partial-bug-2758.diff (2.45 KB) patch-partial-bug-2758.diff Partial implementation of the fix Renato Botelho, 01/31/2013 01:53 PM
fix_2758.diff (2.61 KB) fix_2758.diff Renato Botelho, 02/19/2013 12:35 PM

Associated revisions

Revision 9343d750 (diff)
Added by Ermal Luçi over 6 years ago

Teach interface_bring_down to read a cofniguration passed in. Will be useful for Ticket #2758

Revision 18f338da (diff)
Added by Ermal Luçi over 6 years ago

Correctly bring down an interface older configuration. Fixes #2758

Revision e12ad49f (diff)
Added by Renato Botelho over 6 years ago

Save ppp info and realif on interfaces.apply to be able to cleanup old configuration when changing interface type. Fixes #2758

History

#1 Updated by Renato Botelho over 6 years ago

  • Affected Version changed from 2.1 to 2.0.x

#2 Updated by Renato Botelho over 6 years ago

  • Assignee set to Ermal Luçi

#3 Updated by Ermal Luçi over 6 years ago

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

#4 Updated by Renato Botelho over 6 years ago

After some tests here, i noted the issue persists. When I changed interface from static to pppoe, the static IP remains in the interface, and when I changed it back, mpd5 was not killed

#5 Updated by Renato Botelho over 6 years ago

I spent some time debugging it and noted what is happening.

1. When interface_bring_down() is called and $ifcfgo is passed to it, it just contains interfaces section of config, and not ppps sections, because of that, it cannot stop mpd when changing from PPPoE to static for example.
2. Inside interface_bring_down(), $realif is considering the current configured interface. When you are moving from static to PPPoE for example, it'll run 'ifconfig pppoe0 delete' when it should run 'ifconfig em0 delete'.

I implemented part of the fix, that saves old ppp information on .interfaces.apply, but it's still missing code to get the old $realif. Patch is attached.

#6 Updated by Renato Botelho over 6 years ago

This new version of the patch is working fine for all tests I've made here.

#7 Updated by Renato Botelho over 6 years ago

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

#8 Updated by Renato Botelho over 6 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF