~ubuntu-branches/ubuntu/intrepid/tcpdump/intrepid

« back to all changes in this revision

Viewing changes to print-l2tp.c

  • Committer: Bazaar Package Importer
  • Author(s): Romain Francoise
  • Date: 2005-12-10 14:26:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051210142620-t4ju0367w6j2x06i
Tags: 3.9.4-2
debian/patches/20_man_fixes.dpatch: Merge patch from A Costa
<agcosta@gis.net> fixing a few typos (closes: #342310).

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#ifndef lint
25
25
static const char rcsid[] _U_ =
26
 
    "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.14.2.3 2003/12/26 23:21:42 guy Exp $";
 
26
    "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.17.2.2 2005/04/20 21:50:16 guy Exp $";
27
27
#endif
28
28
 
29
29
#ifdef HAVE_CONFIG_H
617
617
        const u_int16_t *ptr = (u_int16_t *)dat;
618
618
        u_int cnt = 0;                  /* total octets consumed */
619
619
        u_int16_t pad;
620
 
        int flag_t, flag_l, flag_s, flag_o, flag_p;
 
620
        int flag_t, flag_l, flag_s, flag_o;
621
621
        u_int16_t l2tp_len;
622
622
 
623
 
        flag_t = flag_l = flag_s = flag_o = flag_p = FALSE;
 
623
        flag_t = flag_l = flag_s = flag_o = FALSE;
624
624
 
625
625
        TCHECK(*ptr);   /* Flags & Version */
626
626
        if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) {
650
650
                flag_o = TRUE;
651
651
                printf("O");
652
652
        }
653
 
        if (EXTRACT_16BITS(ptr) & L2TP_FLAG_PRIORITY) {
654
 
                flag_p = TRUE;
 
653
        if (EXTRACT_16BITS(ptr) & L2TP_FLAG_PRIORITY)
655
654
                printf("P");
656
 
        }
657
655
        printf("]");
658
656
 
659
657
        ptr++;
690
688
                cnt += (2 + pad);
691
689
        }
692
690
 
 
691
        if (flag_l) {
 
692
                if (length < l2tp_len) {
 
693
                        printf(" Length %u larger than packet", l2tp_len);
 
694
                        return;
 
695
                }
 
696
                length = l2tp_len;
 
697
        }
 
698
        if (length < cnt) {
 
699
                printf(" Length %u smaller than header length", length);
 
700
                return;
 
701
        }
693
702
        if (flag_t) {
 
703
                if (!flag_l) {
 
704
                        printf(" No length");
 
705
                        return;
 
706
                }
694
707
                if (length - cnt == 0) {
695
708
                        printf(" ZLB");
696
709
                } else {