--- zzzz-none-000/linux-3.10.107/net/l2tp/l2tp_ppp.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/net/l2tp/l2tp_ppp.c 2021-11-10 11:53:56.000000000 +0000 @@ -18,6 +18,12 @@ * */ +/** + * Some part of this file is modified by Ikanos Communications. + * + * Copyright (C) 2013-2014 Ikanos Communications. + */ + /* This driver handles only L2TP data frames; control frames are handled by a * userspace application. * @@ -132,6 +138,13 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +#ifdef CONFIG_L2TP_AP_SUPPORT +extern void (*buildL2TPFastPathInfo_ptr)(struct sk_buff *skb, struct l2tp_session *session,__u8 direction); +#endif +#endif + + static const struct ppp_channel_ops pppol2tp_chan_ops = { .start_xmit = pppol2tp_xmit, }; @@ -235,6 +248,13 @@ "%s: recv %d byte data frame, passing to ppp\n", session->name, data_len); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +#if IS_ENABLED(CONFIG_L2TP_AP_SUPPORT) && !IS_ENABLED(CONFIG_IPSEC_AP_SUPPORT) + if(skb->sp) { + skb->apFlowData.encap_protocol = PROCESS_L2TP_SLOW_PATH; + } +#endif +#endif /* We need to forget all info related to the L2TP packet * gathered in the skb as we are going to reuse the same * skb for the inner packet. @@ -252,6 +272,21 @@ nf_reset(skb); po = pppox_sk(sk); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +#ifdef CONFIG_L2TP_AP_SUPPORT + //printk("\r\n %s %d \n",__func__,__LINE__); + if(buildL2TPFastPathInfo_ptr) { + if (skb->apFlowData.encap_protocol != PROCESS_L2TP_SLOW_PATH) { + buildL2TPFastPathInfo_ptr(skb,session,PROCESS_L2TP_DECAP); + } + } else { + skb->apFlowData.encap_protocol = PROCESS_L2TP_SLOW_PATH; + } +#else + /* Don't add fast path entry when fast path l2tp disabled */ + skb->apFlowData.encap_protocol = PROCESS_L2TP_SLOW_PATH; +#endif +#endif ppp_input(&po->chan, skb); } else { l2tp_info(session, PPPOL2TP_MSG_DATA, "%s: socket not bound\n",