When using ppp to create an ADSL connection, the addresses for the tun interface aren't removed when either the connection drops (due to LCP/LQM echoes being lost), or when the connection is closed. This means that even though a connection has been dropped, using ifconfig to check the state makes it appear as if a connection is still up. When settings "set log +all", I've seen that the ioctl calls to remove the address (SIOCDIFADDR) is never called. Calling "iface clear" in ppp.linkdown doesn't work either, as it's executed before the connection has closed so the address cannot be removed. I've confirmed this from looking at the ppp source: iface_Clear is only called from the following places: 1). ipcp_SetIPaddress & ipcp_SetIPv6address 2). IfaceClearCommand ie. the interactive command "iface clear" 3). bundle_destroy, which is in turn called solely from AbortProgram Would it make sense to add a call to iface_Clear somewhere in bundle_close? Apologies for the vagueness, but I'm still getting my head around the code here. How-To-Repeat: 1). Open ppp in interactive mode 2). ppp> dial 3). PPP> iface show 4). PPP> close 5). ppp> iface show 6). ppp> iface clear 7). ppp> iface show
Responsible Changed From-To: freebsd-bugs->freebsd-fs Assign to wrong mailing list. erk.
Responsible Changed From-To: freebsd-fs->freebsd-net Assign to right mailing list.
Having had a good look at the source over the weekend (Spanish Grand Prix was dull as ever), I've seen that my suggestion of putting a call to iface_Clear somewhere in bundle_close was a tad off the mark. Noticing that the calls to iface_Add & iface_Clear appear to come from ipcp & ipv6cp (makes sense really) it's clear that the call to clear the interface's addresses should come from there too. Also, the call to clear should be made at the last possible moment, to make sure that connection is definitely closed, so I add the call in the LayerFinish method for both ipcp & ipv6cp. I've attached diffs for both files. I've tested the patched version, and by calling close in interactive mode, and by disconnecting the phone cable (so that the connection will drop after 5 LCP echoes are lost) I now have the desired effect of the addresses being cleared from the interface. I'm going to run with this patched version as I can't see how this could cause any catastrophic issues. Would this be an acceptable solution for future releases? John
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Created attachment 258216 [details] ipcp.c.diff ^Triage: rebase patch.
Created attachment 258217 [details] ipv6cp.c.diff ^Triage: rebase patch.