@@ -660,7 +660,6 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
660660 int length )
661661{
662662 struct l2tp_tunnel * tunnel = session -> tunnel ;
663- u32 ns = 0 , nr = 0 ;
664663 int offset ;
665664
666665 /* Parse and check optional cookie */
@@ -686,32 +685,21 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
686685 L2TP_SKB_CB (skb )-> has_seq = 0 ;
687686 if (tunnel -> version == L2TP_HDR_VER_2 ) {
688687 if (hdrflags & L2TP_HDRFLAG_S ) {
689- ns = ntohs (* (__be16 * )ptr );
690- ptr += 2 ;
691- nr = ntohs (* (__be16 * )ptr );
692- ptr += 2 ;
693-
694688 /* Store L2TP info in the skb */
695- L2TP_SKB_CB (skb )-> ns = ns ;
689+ L2TP_SKB_CB (skb )-> ns = ntohs ( * ( __be16 * ) ptr ) ;
696690 L2TP_SKB_CB (skb )-> has_seq = 1 ;
691+ ptr += 2 ;
692+ /* Skip past nr in the header */
693+ ptr += 2 ;
697694
698- l2tp_dbg (session , L2TP_MSG_SEQ ,
699- "%s: recv data ns=%u, nr=%u, session nr=%u\n" ,
700- session -> name , ns , nr , session -> nr );
701695 }
702696 } else if (session -> l2specific_type == L2TP_L2SPECTYPE_DEFAULT ) {
703697 u32 l2h = ntohl (* (__be32 * )ptr );
704698
705699 if (l2h & 0x40000000 ) {
706- ns = l2h & 0x00ffffff ;
707-
708700 /* Store L2TP info in the skb */
709- L2TP_SKB_CB (skb )-> ns = ns ;
701+ L2TP_SKB_CB (skb )-> ns = l2h & 0x00ffffff ;
710702 L2TP_SKB_CB (skb )-> has_seq = 1 ;
711-
712- l2tp_dbg (session , L2TP_MSG_SEQ ,
713- "%s: recv data ns=%u, session nr=%u\n" ,
714- session -> name , ns , session -> nr );
715703 }
716704 ptr += 4 ;
717705 }
@@ -853,16 +841,6 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)
853841 goto error ;
854842 }
855843
856- /* Trace packet contents, if enabled */
857- if (tunnel -> debug & L2TP_MSG_DATA ) {
858- length = min (32u , skb -> len );
859- if (!pskb_may_pull (skb , length ))
860- goto error ;
861-
862- pr_debug ("%s: recv\n" , tunnel -> name );
863- print_hex_dump_bytes ("" , DUMP_PREFIX_OFFSET , skb -> data , length );
864- }
865-
866844 /* Point to L2TP header */
867845 optr = skb -> data ;
868846 ptr = skb -> data ;
@@ -883,12 +861,8 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb)
883861 length = skb -> len ;
884862
885863 /* If type is control packet, it is handled by userspace. */
886- if (hdrflags & L2TP_HDRFLAG_T ) {
887- l2tp_dbg (tunnel , L2TP_MSG_DATA ,
888- "%s: recv control packet, len=%d\n" ,
889- tunnel -> name , length );
864+ if (hdrflags & L2TP_HDRFLAG_T )
890865 goto error ;
891- }
892866
893867 /* Skip flags */
894868 ptr += 2 ;
@@ -953,9 +927,6 @@ int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
953927 if (!tunnel )
954928 goto pass_up ;
955929
956- l2tp_dbg (tunnel , L2TP_MSG_DATA , "%s: received %d bytes\n" ,
957- tunnel -> name , skb -> len );
958-
959930 if (l2tp_udp_recv_core (tunnel , skb ))
960931 goto pass_up ;
961932
@@ -1049,23 +1020,6 @@ static void l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
10491020 unsigned int len = skb -> len ;
10501021 int error ;
10511022
1052- /* Debug */
1053- if (session -> send_seq )
1054- l2tp_dbg (session , L2TP_MSG_DATA , "%s: send %zd bytes, ns=%u\n" ,
1055- session -> name , data_len , session -> ns - 1 );
1056- else
1057- l2tp_dbg (session , L2TP_MSG_DATA , "%s: send %zd bytes\n" ,
1058- session -> name , data_len );
1059-
1060- if (session -> debug & L2TP_MSG_DATA ) {
1061- int uhlen = (tunnel -> encap == L2TP_ENCAPTYPE_UDP ) ? sizeof (struct udphdr ) : 0 ;
1062- unsigned char * datap = skb -> data + uhlen ;
1063-
1064- pr_debug ("%s: xmit\n" , session -> name );
1065- print_hex_dump_bytes ("" , DUMP_PREFIX_OFFSET ,
1066- datap , min_t (size_t , 32 , len - uhlen ));
1067- }
1068-
10691023 /* Queue the packet to IP for output */
10701024 skb -> ignore_df = 1 ;
10711025 skb_dst_drop (skb );
0 commit comments