PPP: moved netif out of PPP control block

Users might want to share a netif control block between an Ethernet
interface and a PPPoS interface (I want actually) in case PPP is just
used as redundancy if Ethernet is down (eg. PPPoS GPRS fail over).

Moved netif out of PPP control block in a similar way it is currently
done for Ethernet interfaces. Furthermore, this is a first step on
removing the "new/create/free/delete" API which is awful but currently
necessary to handle fail over from PPPoX to another PPPoX (eg. from PPoE
on xDSL to PPPoS on GPRS fail over) without free()ing the netif which
might be used on udp_sendto() or L2TP VPN links.
This commit is contained in:
Sylvain Rochet
2015-02-14 20:51:35 +01:00
parent 604a92dc3d
commit 3dcfd7ba41
4 changed files with 60 additions and 55 deletions

View File

@@ -44,7 +44,7 @@
static void
pppapi_do_ppp_new(struct pppapi_msg_msg *msg)
{
msg->ppp = ppp_new();
msg->ppp = ppp_new(msg->msg.pppnew.pppif);
TCPIP_PPPAPI_ACK(msg);
}
@@ -53,10 +53,11 @@ pppapi_do_ppp_new(struct pppapi_msg_msg *msg)
* tcpip_thread context.
*/
ppp_pcb*
pppapi_new(void)
pppapi_new(struct netif *pppif)
{
struct pppapi_msg msg;
msg.function = pppapi_do_ppp_new;
msg.msg.msg.pppnew.pppif = pppif;
TCPIP_PPPAPI(&msg);
return msg.msg.ppp;
}