X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/76ae461853c7ac6e101704f6e6fd41dc520e9921..ce928583b47102056e28201bd677f4813fada3c6:/l2tpns.c diff --git a/l2tpns.c b/l2tpns.c index 8640c8b..7478560 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -1330,7 +1330,8 @@ static void update_session_out_stat(sessionidt s, sessiont *sp, int len) // process outgoing (to tunnel) IP // -static void processipout(uint8_t *buf, int len) +// (i.e. this routine writes to data[-8]). +void processipout(uint8_t *buf, int len) { sessionidt s; sessiont *sp; @@ -1469,6 +1470,14 @@ static void processipout(uint8_t *buf, int len) if(session[s].bundle != 0 && bundle[session[s].bundle].num_of_links > 1) { + + if (!config->cluster_iam_master) + { + // The MPPP packets must be managed by the Master. + master_forward_mppp_packet(s, data, size); + return; + } + // Add on L2TP header sessionidt members[MAXBUNDLESES]; bundleidt bid = session[s].bundle; @@ -1490,7 +1499,7 @@ static void processipout(uint8_t *buf, int len) if (nb_opened < 1) { - LOG(2, s, t, "MPPP: PROCESSIPOUT ERROR, no session opened in bundle:%d\n", bid); + LOG(3, s, t, "MPPP: PROCESSIPOUT ERROR, no session opened in bundle:%d\n", bid); return; } @@ -2035,11 +2044,11 @@ void sessionshutdown(sessionidt s, char const *reason, int cdn_result, int cdn_e { uint8_t ml; for(ml = 0; ml 0) + if ((s = read(tunfd, p, size_bufp)) > 0) { - processtun(buf, s); + processtun(p, s); tun_pkts++; } else