Old configuration remains when changing interface type
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.
Teach interface_bring_down to read a cofniguration passed in. Will be useful for Ticket #2758
#5 Updated by Renato Botelho almost 7 years ago
- File patch-partial-bug-2758.diff patch-partial-bug-2758.diff added
- Status changed from Feedback to New
- % Done changed from 100 to 50
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.