L2TP output netif is now selectable, making it useful to select a default route for the L2TP tunnel, in case the default interface is set to the L2TP PPP interface

This commit is contained in:
Sylvain Rochet
2012-07-12 01:11:08 +02:00
parent de6be743c6
commit 78565026ac
6 changed files with 67 additions and 30 deletions

View File

@@ -148,8 +148,8 @@ int pppapi_over_ethernet_open(ppp_pcb *pcb, struct netif *ethif, const char *ser
*/
static void pppapi_do_ppp_over_l2tp_open(struct pppapi_msg_msg *msg) {
msg->err = ppp_over_l2tp_open(msg->ppp, msg->msg.l2tpopen.ipaddr,
msg->msg.l2tpopen.port,
msg->err = ppp_over_l2tp_open(msg->ppp,
msg->msg.l2tpopen.netif, msg->msg.l2tpopen.ipaddr, msg->msg.l2tpopen.port,
#if PPPOL2TP_AUTH_SUPPORT
msg->msg.l2tpopen.secret,
msg->msg.l2tpopen.secret_len,
@@ -164,11 +164,13 @@ static void pppapi_do_ppp_over_l2tp_open(struct pppapi_msg_msg *msg) {
* Call ppp_over_l2tp_open() in a thread-safe way by running that function inside the
* tcpip_thread context.
*/
int pppapi_over_l2tp_open(ppp_pcb *pcb, ip_addr_t *ipaddr, u16_t port, u8_t *secret, u8_t secret_len,
int pppapi_over_l2tp_open(ppp_pcb *pcb, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
u8_t *secret, u8_t secret_len,
ppp_link_status_cb_fn link_status_cb, void *link_status_ctx) {
struct pppapi_msg msg;
msg.function = pppapi_do_ppp_over_l2tp_open;
msg.msg.ppp = pcb;
msg.msg.msg.l2tpopen.netif = netif;
msg.msg.msg.l2tpopen.ipaddr = ipaddr;
msg.msg.msg.l2tpopen.port = port;
#if PPPOL2TP_AUTH_SUPPORT