X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/d4905790250059e6dd95082a1b3cc13b7c4a6c68..3d72768fcefdcdcbcd7bab36626388dfeeca2da6:/ppp.c diff --git a/ppp.c b/ppp.c index fd17a46..ed30501 100644 --- a/ppp.c +++ b/ppp.c @@ -1,6 +1,6 @@ // L2TPNS PPP Stuff -char const *cvs_id_ppp = "$Id: ppp.c,v 1.12 2004-08-13 00:02:50 fred_nerk Exp $"; +char const *cvs_id_ppp = "$Id: ppp.c,v 1.15 2004-09-19 23:19:23 fred_nerk Exp $"; #include #include @@ -251,7 +251,7 @@ void dumplcp(u8 *p, int l) { case 1: // Maximum-Receive-Unit if (length == 4) - log(4, 0, 0, 0, " %s %d\n", lcp_types[type], ntohs(*(u16 *)(o + 2))); + log(4, 0, 0, 0, " %s %d\n", lcp_types[type], ntohs(*(u16 *)(o + 2))); else log(4, 0, 0, 0, " %s odd length %d\n", lcp_types[type], length); break; @@ -259,7 +259,7 @@ void dumplcp(u8 *p, int l) { if (length == 4) { - int proto = ntohs(*(u16 *)(o + 2)); + int proto = ntohs(*(u16 *)(o + 2)); log(4, 0, 0, 0, " %s 0x%x (%s)\n", lcp_types[type], proto, proto == 0xC223 ? "CHAP" : proto == 0xC023 ? "PAP" : "UNKNOWN"); @@ -278,8 +278,8 @@ void dumplcp(u8 *p, int l) { if (length == 6) { - u32 magicno = ntohl(*(u32 *)(o + 2)); - log(4, 0, 0, 0, " %s %x\n", lcp_types[type], magicno); + u32 magicno = ntohl(*(u32 *)(o + 2)); + log(4, 0, 0, 0, " %s %x\n", lcp_types[type], magicno); } else log(4, 0, 0, 0, " %s odd length %d\n", lcp_types[type], length); @@ -512,7 +512,8 @@ void processipcp(tunnelidt t, sessionidt s, u8 * p, u16 l) { // happy with our IPCP u16 r = session[s].radius; - if ((!r || radius[r].state == RADIUSIPCP) && !session[s].walled_garden) { + if ((!r || radius[r].state == RADIUSIPCP) && !session[s].walled_garden) + { if (!r) r = radiusnew(s); if (r) @@ -636,7 +637,6 @@ void processipin(tunnelidt t, sessionidt s, u8 * p, u16 l) { ipt ip; - CSTAT(call_processipin); log_hex(5, "IP", p, l); @@ -676,7 +676,7 @@ void processipin(tunnelidt t, sessionidt s, u8 * p, u16 l) if (session[s].snoop_ip && session[s].snoop_port) { - // Snooping this session, send it to ASIO + // Snooping this session snoop_send_packet(p, l, session[s].snoop_ip, session[s].snoop_port); } STAT(tun_tx_packets); @@ -814,7 +814,6 @@ void sendchap(tunnelidt t, sessionidt s) // returns start of PPP frame u8 *makeppp(u8 * b, int size, u8 * p, int l, tunnelidt t, sessionidt s, u16 mtype) { - if (size < 12) return NULL; // Need more space than this!!