OpenBSD CVS

CVS log for src/usr.sbin/tcpdump/print-ip6.c


[BACK] Up to [local] / src / usr.sbin / tcpdump

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.30 / (download) - annotate - [select for diffs], Fri Jan 24 22:46:37 2020 UTC (4 years, 4 months ago) by procter
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, HEAD
Changes since 1.29: +15 -15 lines
Diff to previous 1.29 (colored)

- (void)printf() -> printf(); the cast adds clutter for little value.
- fprintf(stdout, ...) -> printf()
- fputs(x, stdout) -> printf(); for consistency.
fputs is twice as fast on atom x5-Z8300@1.44GHz but Amdahl sees a pure printf
tcpdump only 2% slower than a pure fputs (for constant strings) tcpdump
to /dev/null across a 20MB/~170k packet pcap file.

ok dlg@ for fputs and ok tedu@ krw@ deraadt@ a2k19 for the rest

Revision 1.29 / (download) - annotate - [select for diffs], Thu Sep 19 23:23:58 2019 UTC (4 years, 8 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

print the IPs on ESP packets.

this was lost when tcpdump learnt to look inside udpencap.

found by, and ok markus@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Oct 22 16:12:45 2018 UTC (5 years, 7 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.27: +1 -5 lines
Diff to previous 1.27 (colored)

Remove #ifdef INET6

There's not reason to build without IPv6 support, `-U INET6' builds were
broken anyway.

Fix an empty redefine for IPPROTO_IPV6 in print-ip.c while here.

No object change on amd64 and sparc64 with clang, gcc compiles differently
but behaviour stays the same.

OK denis deraadt

Revision 1.27 / (download) - annotate - [select for diffs], Sat Sep 29 15:53:07 2018 UTC (5 years, 8 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.26: +1 -10 lines
Diff to previous 1.26 (colored)

Zap dead/obsolete code

Flow labels used to be 24-bit back in 1995 until the IPv6 header format
changed in 1998 when the field size was reduced to 20-bit.

https://tools.ietf.org/html/rfc1883#section-6
https://tools.ietf.org/html/rfc2460#section-6

OK denis deraadt

Revision 1.26 / (download) - annotate - [select for diffs], Sat Feb 10 10:00:32 2018 UTC (6 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.25: +8 -1 lines
Diff to previous 1.25 (colored)

print etherip on ipv6.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Feb 6 03:07:51 2018 UTC (6 years, 4 months ago) by dlg
Branch: MAIN
Changes since 1.24: +1 -5 lines
Diff to previous 1.24 (colored)

rework ppp, pptp, and gre parsing.

this started cos i was looking at pptp, which came out like this:

23:52:00.197893  call 24 seq 7: gre-ppp-payload (gre encap)
23:52:00.198930  call 1 seq 7 ack 7: gre-ppp-payload (gre encap)

now it looks like this:

23:52:00.197893 20.0.0.2 > 20.0.0.1: pptp callid 24 seq 7: 17.1.1.122 > 40.0.0.2: icmp: echo request
23:52:00.198930 20.0.0.1 > 20.0.0.2: pptp callid 1 seq 7 ack 7: 40.0.0.2 > 17.1.1.122: icmp: echo reply

the big improvement in ppp parsing is it stops parsing based on
what the ppp headers say, rather than what bytes have been captured.
this also adds parsing of EAP packets.

DLT_PPP_SERIAL is now recognised and printed. gre now prints the
outer addresses always, not just when it's encapsulated by ipv6 or
-v is passed to tcpdump.

ok sthen@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Dec 13 06:40:21 2016 UTC (7 years, 5 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.23: +13 -1 lines
Diff to previous 1.23 (colored)

teach tcpdump some more things about gre.

gre can be encapsulated in ipv6.
gre can encapsulate ipv6, mpls, and ethernet.
nvgre is based on gre, so if the header could be nvgre print the
vsid and flow id as well as the key.

ok stsp@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Nov 16 00:16:39 2015 UTC (8 years, 6 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored)

Remove remaining instances of the register keyword.

ok deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Aug 21 02:07:32 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

since stdlib.h is in scope, don't cast.... you know the drill.
no sneakiness detected by krw

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:21 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 9 17:03:19 2014 UTC (9 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Catch up with the BPF_ALIGNMENT switch to the uint32_t.

bpf aligns data following the datalink header (e.g. ethernet)
on the BPF_ALIGNMENT boundary.  Since rev1.41 of bpf.h it's
uint32_t instead of a long.  And also since then almost all
packets become "unaligned" from the tcpdump perspective and
require costly copies into the internal buffer.  Neither IP
header (struct ip) nor IPv6 (struct ip6_hdr) have fields
larger than 32 bits and therefore alignment requirements for
them are at most 32 bit.

ok millert, jsg, deraadt

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 3 13:22:18 2014 UTC (9 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.18: +10 -4 lines
Diff to previous 1.18 (colored)

Restore packetp and snapend pointers once we're done with an incorrectly
aligned IP/IPv6 packet so that tcpdump can print hexdump of the whole
packet including the Ethernet header (if requested) and not only the
IP/IPv6 part of it.

ok jsg

Revision 1.18 / (download) - annotate - [select for diffs], Wed Dec 3 13:19:03 2014 UTC (9 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.17: +6 -6 lines
Diff to previous 1.17 (colored)

Fixup a crash found by jsg using the AFL fuzzer.  IP and IPv6 printing
routines should check that there's at least a complete IP/IPv6 header
available in the buffer before trying to do anything else.

ok jsg

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 20 03:56:33 2014 UTC (9 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Make ip6_print() take an unsigned length matching
ip_print() and others.

Allows code deciding on a minimum length to memmove()
to work as intended, preventing various crashes found
with the afl fuzzer.  Callers of ip6_print() should of
course be fixed to provide sane lengths as well.

ok deraadt@ djm@

Revision 1.16 / (download) - annotate - [select for diffs], Thu Aug 14 12:44:44 2014 UTC (9 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.15: +1 -2 lines
Diff to previous 1.15 (colored)

No use for <netinet/in_systm.h> nor <netinet/tcpip.h>.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Sep 17 16:45:42 2011 UTC (12 years, 8 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

update pointer variable after copying misaligned packet; ok claudio@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jun 27 16:54:14 2011 UTC (12 years, 11 months ago) by dhill
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

fix an off by one which resulted in 'no next header' packets not being
displayed.

help from bluhm@
OK claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Apr 6 16:01:57 2010 UTC (14 years, 2 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

Add support for decoding MLDv2 initially from tcpdump.org via FreeBSD,
cleaned up to be less gross after some suggestions from stsp.

ok stsp@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Nov 27 13:14:35 2009 UTC (14 years, 6 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.11: +10 -5 lines
Diff to previous 1.11 (colored)

Print outer ipv6 addresses for encapsulated packets only if tcpdump
is run with -v.  This behavior is analog to ipv4.
ok mpf@ todd@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:55 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +1 -6 lines
Diff to previous 1.10 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.10 / (download) - annotate - [select for diffs], Thu Oct 4 18:38:29 2007 UTC (16 years, 8 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.9: +11 -1 lines
Diff to previous 1.9 (colored)

Handle CARP for IPv6. Reported and tested by todd@
ok todd@, henning@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 27 18:15:25 2007 UTC (16 years, 11 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.8: +6 -3 lines
Diff to previous 1.8 (colored)

When aligning buffers correctly handle the case where the
buffers overlap, which happens on 64 bit archs, when
handling encapsulated packets. Reported and tested by Jurjen Oskam
additional testing by Stuart Henderson and todd@, ok henning@

Revision 1.8 / (download) - annotate - [select for diffs], Sun May 6 09:51:33 2007 UTC (17 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Fix the out of bounds check when parsing IPv6 headers. Fixes a SIGSEGV
when parsing IPv6 headers with unknown or corrupted header options.
OK henning@ mcbride@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 19 14:25:04 2006 UTC (17 years, 8 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.6: +12 -3 lines
Diff to previous 1.6 (colored)

enable ESP and AH dissectors over IPv6; ok mpf@ (at k2k6)

Revision 1.6 / (download) - annotate - [select for diffs], Sat Oct 8 19:24:03 2005 UTC (18 years, 8 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.5: +5 -1 lines
Diff to previous 1.5 (colored)

Check IP version when decoding v4 and v6 packets.
From Jason Wright via PR-4531.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Feb 4 08:35:12 2004 UTC (20 years, 4 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.4: +19 -9 lines
Diff to previous 1.4 (colored)

Some more non-alignment problems resolved.
ok deraadt@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 27 10:00:40 2003 UTC (21 years, 4 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored)

bugfix from Can Erkin Acar <canacar@eee.metu.edu.tr>:
hbhopt_print() and dstopt_print() can return 0 if
the option is located just one byte short of snapend
this would cause an infinite loop in ip6_print().

Revision 1.3 / (download) - annotate - [select for diffs], Tue Feb 19 19:39:40 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.2: +1 -3 lines
Diff to previous 1.2 (colored)

We live in an ANSI C world.  Remove lots of gratuitous #ifdef __STDC__ cruft.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Nov 7 07:40:13 2001 UTC (22 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

typos

Revision 1.1 / (download) - annotate - [select for diffs], Wed Apr 26 21:35:41 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7

INET6
DHCP/BOOTP
tcp & udp checksum detection
numerous bugfixes

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.