OpenBSD CVS

CVS log for src/usr.sbin/tcpdrop/tcpdrop.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.21 / (download) - annotate - [select for diffs], Mon Feb 6 18:14:10 2023 UTC (15 months, 3 weeks ago) by millert
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, HEAD
Changes since 1.20: +9 -4 lines
Diff to previous 1.20 (colored)

Accept netstat-style address.port syntax too.
OK bluhm@ deraadt@ jmc@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:21 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 27 17:49:09 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored)

use _PATH_ names for unveil if possible

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 8 07:14:37 2018 UTC (5 years, 6 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.17: +10 -2 lines
Diff to previous 1.17 (colored)

tcpdrop(8) needs to access only two files, in this case /etc/hosts and
/etc/resolv.conf both with read permissions for the purpose of name resolution,
so unveil(2) both files with "r" perms and disable further filesystem access.

While here sort the headers alphabetically.

OK bluhm@

Revision 1.17 / (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_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Tue Jan 13 03:43:18 2015 UTC (9 years, 4 months ago) by lteo
Branch: MAIN
Changes since 1.15: +20 -14 lines
Diff to previous 1.15 (colored)

Give tcpdrop a proper usage() like other programs in the tree.

ok bluhm@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jan 1 03:27:56 2015 UTC (9 years, 5 months ago) by lteo
Branch: MAIN
Changes since 1.14: +2 -4 lines
Diff to previous 1.14 (colored)

Remove an unnecessary freeaddrinfo() call, since errx() would free all
the memory including the one allocated by the earlier getaddrinfo()
(pointed out by claudio@).

feedback from claudio@
ok bluhm@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jun 29 00:58:45 2014 UTC (9 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

If you want <sys/queue.h>, you need to include it.  Don't assume that
<sys/sysctl.h> will pull in the universe (I am working on breaking that
assumption in a gentle fashion)

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 10 04:02:15 2014 UTC (10 years, 4 months ago) by lteo
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.12: +9 -1 lines
Diff to previous 1.12 (colored)

Check the return values of the strdup() calls.

OK deraadt@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Oct 24 02:55:50 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +1 -2 lines
Diff to previous 1.11 (colored)

no need for netinet/ip_var.h (and friends)

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jul 9 19:35:52 2013 UTC (10 years, 10 months ago) by gsoares
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.10: +3 -1 lines
Diff to previous 1.10 (colored)

switch the rval to 1 before loop through the linked list \
and finally change back to 0 afterwards. so teach tcpdrop to exit 1 if \
ail->ai_family != aif_family.

OK markus@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jul 9 17:29:19 2013 UTC (10 years, 10 months ago) by gsoares
Branch: MAIN
Changes since 1.9: +8 -8 lines
Diff to previous 1.9 (colored)

rename laddr2 to faddr2 for more consistency. OK markus@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 18 21:28:45 2012 UTC (11 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

We no longer use struct eproc for kinfo_proc in sysctl.h so there
is no direct need for sys/proc.h or sys/resource.h.  Some consumers
of kinfo_proc need these for the proc flags and rlimit defines like
RLIM_INF so add the appropriate includes to them.
OK deraadt@ sthen@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 13 19:06:16 2009 UTC (14 years, 11 months ago) by andreas
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

tcpdrop broke with the addition of routing domains.  Repair.
ok claudio@

Revision 1.7 / (download) - annotate - [select for diffs], Wed Mar 28 17:04:03 2007 UTC (17 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.6: +5 -3 lines
Diff to previous 1.6 (colored)

flesh out the addresses to make it clear what they are; requested by jmc

Revision 1.6 / (download) - annotate - [select for diffs], Sun Mar 25 17:20:27 2007 UTC (17 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +53 -17 lines
Diff to previous 1.5 (colored)

support a 2 address format (addr:port addr:port) like fstat outputs.
also enhance ipv6 support by unpacking the [addr]:port format.
ok beck, itojun, various others

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 3 01:46:27 2006 UTC (18 years, 5 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.4: +7 -7 lines
Diff to previous 1.4 (colored)

check getnameinfo() return for 0 and use errx() vs. err(); old ok markus@

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 22 23:55:22 2004 UTC (20 years ago) by deraadt
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
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

missing header

Revision 1.3 / (download) - annotate - [select for diffs], Sun May 9 03:22:39 2004 UTC (20 years ago) by deraadt
Branch: MAIN
Changes since 1.2: +4 -6 lines
Diff to previous 1.2 (colored)

pretty

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 27 17:52:21 2004 UTC (20 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.1: +27 -9 lines
Diff to previous 1.1 (colored)

Set oldp en oldlenp to NULL; provide feedback; set exit status.
ok markus@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 26 19:51:20 2004 UTC (20 years, 1 month ago) by markus
Branch: MAIN

drop tcp connections using sysctl(2)

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.