Commit Graph

4797 Commits

Author SHA1 Message Date
Francois-Xavier Le Bail
9f1e5edac5 WB: Fix a bounds check 2017-12-05 19:21:23 +01:00
Francois-Xavier Le Bail
03a2d9c4c1 Use more the EXTRACT_U_1() macro (47/n)
In: if (... *(p) ...) ...
2017-12-05 10:45:44 +01:00
Guy Harris
7e3467df25 Add an IPX/RIP/SAP test. 2017-12-04 13:52:40 -08:00
Francois-Xavier Le Bail
451ac4c753 Use more the ND_TCHECK_1() macro 2017-12-04 21:00:57 +01:00
Francois-Xavier Le Bail
00b189d27c Use more the ND_TCHECK_1() macro 2017-12-04 17:50:29 +01:00
Guy Harris
6cdc7551b8 Use a byte pointer in the IPX SAP and RIP printers.
That makes it like every other printer.

Add some checks against the on-the-network length while we're at it.
2017-12-03 22:19:12 -08:00
Francois-Xavier Le Bail
4166458a2a Use more the EXTRACT_U_1() macro (46/n)
In: if (... p[n] ...) ...
2017-12-03 21:51:36 +01:00
Francois-Xavier Le Bail
c027ae2601 Use more the EXTRACT_U_1() macro (45/n)
In ND_PRINT() macro call(s) (step 10).

p[n] ...
2017-12-03 14:51:59 +01:00
Francois-Xavier Le Bail
10a52254ae Use more the EXTRACT_U_1() macro (44/n)
In: switch (... p[n] ...) ...
2017-12-03 14:00:15 +01:00
Francois-Xavier Le Bail
61c422a88c Use more the EXTRACT_U_1() macro (43/n)
In: if (... p[n] ...) ...
2017-12-03 13:35:26 +01:00
Francois-Xavier Le Bail
a5bb53dd74 Simplify some expressions 2017-12-03 11:13:27 +01:00
Francois-Xavier Le Bail
e83dfd9b16 Simplify some expressions
This will also help some future scripted code updates.
2017-12-02 20:52:22 +01:00
Francois-Xavier Le Bail
2d20acd742 VJC: Update the input buffer pointer type to 'u_char *' 2017-12-02 16:03:43 +01:00
Francois-Xavier Le Bail
dbcba20b5e Use more the EXTRACT_U_1() macro (42/n)
In: switch (... p[n] ...) ...
2017-12-02 00:04:55 +01:00
Francois-Xavier Le Bail
d2def296e9 Use more the EXTRACT_U_1() macro (41/n)
In: switch (... *(p) ...) ...
2017-12-01 23:48:54 +01:00
Francois-Xavier Le Bail
d7b497cac7 Use more the EXTRACT_U_1() macro (40/n)
In some macros and functions calls.
p[n], unsigned char *p.
2017-12-01 22:35:28 +01:00
Francois-Xavier Le Bail
505cd1fe15 Use more the EXTRACT_U_1() macro (39/n)
In some macros and functions call, p[n]
2017-12-01 15:48:41 +01:00
Francois-Xavier Le Bail
7199dd316f Use more the EXTRACT_U_1() macro (38/n)
In some ND_ISPRINT() macro calls.
2017-12-01 10:27:42 +01:00
Francois-Xavier Le Bail
7eef8dd52b Use more the ND_ISPRINT() macro 2017-12-01 10:17:11 +01:00
Francois-Xavier Le Bail
1ff5460667 Use more the EXTRACT_U_1() macro (37/n)
In some snprintf() calls.
2017-12-01 09:32:31 +01:00
Francois-Xavier Le Bail
034c2fc03a Use more the EXTRACT_U_1() macro (36/n)
In a unsigned_relts_print() call.
The Interval field is one byte length (RFC3973).
2017-12-01 09:03:19 +01:00
Francois-Xavier Le Bail
129e79857a Travis-CI: Add the libraries used by libpcap in its .travis.yml 2017-11-30 23:26:05 +01:00
Francois-Xavier Le Bail
97de8ca7bd Use more the EXTRACT_U_1() macro (35/n)
In some safeputchar() calls, *(p).
2017-11-30 23:08:07 +01:00
Guy Harris
bfdad0f58f Fix typo, and request additional libraries for *static* linking. 2017-11-30 12:59:54 -08:00
Guy Harris
6779fd3ba7 Rename configure.in to configure.ac.
This matches what was done with libpcap; it's what autoconf prefers.
2017-11-30 10:20:37 -08:00
Guy Harris
cfc4c750a2 Fix the handling of libpcap.
We have four possibilities:

  1) local library, with a pcap-config;
  2) local library, without a pcap-config;
  3) installed library, with a pcap-config;
  4) installed library, without a pcap-config.

If we have a local library, i.e. one in ../libpcap{whatever}, we:

    add -I flags to the C compiler flags to point it at whatever
    directories in ../libpcap{whatever};

    add ../libpcap{whatever}/libpcap.a to $LIBS and:

        if it has a pcap-config, we use it, with --additional-libraries,
        to find the additional libraries with which we need to link;

        otherwise, we do the usual OS-dependent hacks to try to figure
        out with what additional flags we need to link;

    and add them to $LIBS after libpcap.a.

If we have an installed library:

    if it has a pcap-config we use it, with --cflags, to find what flags
    to add to the C compiler flags, and use it, with --libs, to see what
    flags to add to $LIBS;

    if it doesn't have a pcap-config, we search for -lpcap and, if that
    succeeds, we assume the headers are under /usr/local/include or
    /usr/include, search for them there, and, if we don't find pcap.h
    there, we look for it in a pcap subdirectory under there, and add
    the appropriate -I flag to the C compiler flags, and then do the
    usual OS-dependent hacks to try to figure out with what additional
    flags we need to link.

While we're at it, we do the libdlpi check only on Solaris, as part of
"the usual OS-dependent hacks".
2017-11-29 18:18:18 -08:00
Francois-Xavier Le Bail
415160c0c2 Use more ND_TCHECK_n() macros 2017-11-29 21:06:51 +01:00
Francois-Xavier Le Bail
320f3db18f Use more the EXTRACT_U_1() macro (34/n)
In some snprintf() calls.
2017-11-29 10:31:10 +01:00
Francois-Xavier Le Bail
ad3d3f5c67 Use more the EXTRACT_U_1() macro (33/n) 2017-11-29 08:06:21 +01:00
Guy Harris
de0c7fc746 Fix mkdep invocations.
CC is not guaranteed to be space-free; quote it.

DEPENDENCY_CFLAG is also not guaranteed to be space-free; quote it.
2017-11-28 22:06:37 -08:00
Francois-Xavier Le Bail
dcca20dd39 Use more the ND_TCHECK_1() macro 2017-11-28 22:51:30 +01:00
Francois-Xavier Le Bail
dde3aa9975 Use more the EXTRACT_U_1() macro (32/n)
In: while (... *(p) ...) ...,
    while (... *(p + e) ...) ...
2017-11-28 22:22:35 +01:00
Francois-Xavier Le Bail
f085c93f59 Use more the EXTRACT_U_1() macro (31/n)
In ND_PRINT() macro call(s) (step 9).

*(p)
2017-11-27 20:57:24 +01:00
Francois-Xavier Le Bail
99227bf552 Use more the EXTRACT_U_1() macro (30/n) 2017-11-27 18:28:49 +01:00
Francois-Xavier Le Bail
2858e729ed Use more the EXTRACT_U_1() macro (29/n)
In ND_PRINT() macro call(s) (step 8).

*(p + e)
2017-11-26 21:33:24 +01:00
Francois-Xavier Le Bail
1a90fd99d2 Use more the EXTRACT_U_1() macro (28/n)
In ND_PRINT() macro call(s) (step 7).

p[n] ...
2017-11-26 15:44:43 +01:00
Francois-Xavier Le Bail
575188b5bf Use pointer expressions like in most similar cases 2017-11-25 18:21:18 +01:00
Francois-Xavier Le Bail
39c8c55aa9 Use more ND_TCHECK_n()/ND_TTEST_n() macros 2017-11-24 22:48:55 +01:00
Guy Harris
c511f4c3be Fix lcpconfopts[] bounds check.
The subscript is unsigned, so it's guaranteed to be >= 0.  It should
thus be checked against the size of the array, not against some other
2017-11-24 12:22:22 -08:00
Francois-Xavier Le Bail
3ecde94f0c Use more ND_TCHECK_n() macros 2017-11-24 20:44:53 +01:00
Guy Harris
f9dbcc9615 More EXTRACT_U_1() and ND_TCHECK_n, clean up signedness, add length checks.
Add more EXTRACT_U_1() calls.

Use ND_TCHECK_n() where appropriate.

Use unsigned values wherever appropriate.

Make sure the claimed length of a control protocol packet doesn't go
past the claimed length of the on-the-wire packet.
2017-11-24 11:04:01 -08:00
Francois-Xavier Le Bail
616408bd0e Use more the EXTRACT_U_1() macro (27/n)
In ND_PRINT() macro call(s) (step 6).

(*(p) op  e2)
2017-11-24 19:26:31 +01:00
Guy Harris
7e7f321670 Get rid of unnecessary casts. 2017-11-23 13:38:50 -08:00
Guy Harris
f509616ae8 Use nd_ types.
That way, we can have the response TTL and QID as separate fields.

Add references to specifications.
2017-11-23 13:30:32 -08:00
Guy Harris
862b1d31ed Get rid of unnecessary casts; 2017-11-23 13:13:13 -08:00
Guy Harris
317abbf877 Get rid of an unnecessary cast. 2017-11-23 13:11:44 -08:00
Guy Harris
e4f2243521 Get rid of unnecessary casts. 2017-11-23 13:09:21 -08:00
Guy Harris
1fc4376091 Use EXTRACT_U_1(). 2017-11-23 13:07:13 -08:00
Francois-Xavier Le Bail
dcf5ee83bb Use more the EXTRACT_U_1() macro to fetch a one-byte value (26/n)
In ND_PRINT() macro call(s) (step 5).

(*(p)++ op  e3)
2017-11-23 20:24:00 +01:00
Francois-Xavier Le Bail
66e9f3970c Use more the EXTRACT_U_1() macro to fetch a one-byte value (25/n)
In ND_PRINT() macro call (step 4).

(*p op1 e1) op2 e2
2017-11-23 20:23:59 +01:00