OpenBSD CVS

CVS log for src/usr.sbin/dhcpd/memory.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.31 / (download) - annotate - [select for diffs], Fri Jan 28 06:33:27 2022 UTC (2 years, 4 months ago) by guenther
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, HEAD
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

When it's the possessive of 'it', it's spelled "its", without the
apostrophe.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 10 16:42:17 2020 UTC (3 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

Remove prototypes for functions removed 10+ years ago. Return types should be on
their own lines.

Diffs from Martin Vahlensiech via tech@. Thanks!

Revision 1.28.12.1 / (download) - annotate - [select for diffs], Mon Apr 6 17:23:07 2020 UTC (4 years, 1 month ago) by benno
Branch: OPENBSD_6_6
Changes since 1.28: +3 -2 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

this is errata 6.6/024_dhcpd.patch.sig

Commit to current was:

revision 1.29
date: 2020/04/06 17:05:40;  author: krw;  state: Exp;  lines: +3 -2;  commitid:$
dhcpd could reference freed memory after releasing a lease with
an unusually long uid.
Reported by Adarsh Dinesh. Thanks!

Revision 1.28.10.1 / (download) - annotate - [select for diffs], Mon Apr 6 17:22:11 2020 UTC (4 years, 1 month ago) by benno
Branch: OPENBSD_6_5
Changes since 1.28: +3 -2 lines
Diff to previous 1.28 (colored) next main 1.29 (colored)

this is errata 6.5/034_dhcpd.patch.sig

Commit to current was:

revision 1.29
date: 2020/04/06 17:05:40;  author: krw;  state: Exp;  lines: +3 -2;  commitid:$
dhcpd could reference freed memory after releasing a lease with
an unusually long uid.
Reported by Adarsh Dinesh. Thanks!

Revision 1.29 / (download) - annotate - [select for diffs], Mon Apr 6 17:05:40 2020 UTC (4 years, 1 month ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.28: +3 -2 lines
Diff to previous 1.28 (colored)

dhcpd could reference freed memory after releasing a lease with
an unusually long uid.

Reported by Adarsh Dinesh. Thanks!

Revision 1.28 / (download) - annotate - [select for diffs], Mon Feb 13 23:04:05 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_5_BASE, 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
Branch point for: OPENBSD_6_6, OPENBSD_6_5
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Eliminate pointless'%m' (a.k.a. hand rolled strerror()) by using fatal() and
log_warn(). Zap a couple of explicit 'syslog()' calls.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Feb 13 22:33:39 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.26: +9 -5 lines
Diff to previous 1.26 (colored)

Adjust some long lines.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Feb 13 19:13:14 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.25: +18 -17 lines
Diff to previous 1.25 (colored)

Switch from old errwarn.c logging to shiny new log.[ch].

ok benno@

Revision 1.25 / (download) - annotate - [select for diffs], Sun Feb 7 10:24:04 2016 UTC (8 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

avoid a use after free when parsing address ranges from a config
ok krw@

Revision 1.24 / (download) - annotate - [select for diffs], Sat Feb 6 23:50:10 2016 UTC (8 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.23: +15 -1 lines
Diff to previous 1.23 (colored)

Eliminate #include inside *.h files and include only needed headers in
each *.c file.

Inspired by mention of header silliness by Edgar Pettijohn and mmcc@
on tech@.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Feb 10 23:06:13 2015 UTC (9 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

Keep track of the last time we scanned the leases to find expired
ones that needed to be booted out of the pf table process. This
avoids removing the same addess over and over.

Problem report and original diff from Bertrand Provost.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 11 16:45:15 2014 UTC (9 years, 11 months ago) by pelikan
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.21: +24 -18 lines
Diff to previous 1.21 (colored)

Prettify & refactor, no functional change.

ok beck

Revision 1.21 / (download) - annotate - [select for diffs], Fri Oct 18 13:44:35 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

%d -> %lld, add (long long) cast to time_t variables. Make guenther
and gcc happier. Found while looking at something else for dlg@.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 27 14:11:38 2010 UTC (14 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: 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, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.19: +3 -7 lines
Diff to previous 1.19 (colored)

malloc/strlcpy -> strdup. Use consistent idiom.

ok (as part of larger diff) blambert@ kettenis@ stsp@ zinovik@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 1 20:30:25 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Wrappers around a wrapper around free() are of no more use than
wrappers around wrappers around calloc().

The purpose of the free() wrapper is to generate an error message
when free'ing NULL. But free_hash_bucket(), free_lease(), and
free_tree() are all called immediately after dereferencing the
pointer to be freed. Thus the error message will never be issued.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jan 1 06:25:37 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.17: +6 -4 lines
Diff to previous 1.17 (colored)

Single-use wrapper functions that just call a wrapper function
around calloc() and end up producing duplicate error messages are
just confusing.

Eliminate new_hash_bucket(), new_lease(), new_leases(), new_group().

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jan 1 01:47:41 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.16: +9 -5 lines
Diff to previous 1.16 (colored)

Plug a potential leak similar to the one parfait spotted and Theo
fixed.

Eliminate the function new_class() by expanding the only use

Use strdup() and calloc() rather than manually simulating them.

No functional change.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Dec 10 01:22:09 2009 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

plug memory leak, spotted by parfait; ok krw

Revision 1.15 / (download) - annotate - [select for diffs], Wed May 7 12:19:20 2008 UTC (16 years ago) by beck
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
Changes since 1.14: +8 -2 lines
Diff to previous 1.14 (colored)

Add synchronisation support for dhcpd - this allows for two dhcpd's
with the same configuration to be run on the same net and they will
keep their lease files/state in synch, and therefore allowing you to
run redundant dhcpd's. Synchronization code stolen from spamd, uses
an hmac key in /var/db/dhcpd.key if it exists.
ok krw@ deraadt@

Revision 1.10.4.1 / (download) - annotate - [select for diffs], Thu Aug 10 01:54:02 2006 UTC (17 years, 9 months ago) by brad
Branch: OPENBSD_3_8
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

MFC:
Fix by cloder@

Fix a reliability issue in dhcpd where a DHCPDISCOVER packet with a 32-byte
client identifier would cause dhcpd to mistakenly exit. From Debian bug
380273, affecting ISC dhcpd 2.x, upon which our dhcpd is based.

ok cloder@

Revision 1.10.6.1 / (download) - annotate - [select for diffs], Thu Aug 10 01:51:15 2006 UTC (17 years, 9 months ago) by brad
Branch: OPENBSD_3_9
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) next main 1.11 (colored)

MFC:
Fix by cloder@

Fix a reliability issue in dhcpd where a DHCPDISCOVER packet with a 32-byte
client identifier would cause dhcpd to mistakenly exit. From Debian bug
380273, affecting ISC dhcpd 2.x, upon which our dhcpd is based.

ok cloder@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Aug 9 22:23:53 2006 UTC (17 years, 9 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Fix a reliability issue in dhcpd where a DHCPDISCOVER packet with a 32-byte
client identifier would cause dhcpd to mistakenly exit. From Debian bug
380273, affecting ISC dhcpd 2.x, upon which our dhcpd is based.

OK beck@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jun 14 14:58:52 2006 UTC (17 years, 11 months ago) by ckuethe
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

This diff allows dhcpd to put active leases into a pf table. Dhcpd will then
periodically - based on the length of the shortest lease time - walk across
all leases searching for expired leases which are then removed from the pf
table.

ok henning

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jun 14 14:49:46 2006 UTC (17 years, 11 months ago) by ckuethe
Branch: MAIN
Changes since 1.11: +5 -23 lines
Diff to previous 1.11 (colored)

Move the transmission of privsep messages into its own function. Wherever
we might have conditionally sent a message, we now just call the pfmsg()
function, and let it figure out whether the message should be sent or not.

ok henning

Revision 1.11 / (download) - annotate - [select for diffs], Wed May 31 02:43:15 2006 UTC (18 years ago) by ckuethe
Branch: MAIN
Changes since 1.10: +31 -2 lines
Diff to previous 1.10 (colored)

This diff makes dhcpd able to manipulate pf tables on certain lease events.

dhcpd is now able to place abandoned addresses into a table (to offer some
protection against machines camping on an address) and remove them from the
table if they are properly leased.

When dhcpd assigns an IP to a new hardware address, it can remove that
address from a table. This is for use with the overload table in pf; newly
arrived machines will not be punished for the actions of a machine that
went away.

beck@ and krw@ liked previous versions of this, henning@ final ok

Revision 1.10 / (download) - annotate - [select for diffs], Tue Sep 21 04:07:04 2004 UTC (19 years, 8 months ago) by david
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_8_BASE, OPENBSD_3_7_BASE, OPENBSD_3_7
Branch point for: OPENBSD_3_9, OPENBSD_3_8
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

spelling fixes; ok jmc@ henning@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 16 18:35:43 2004 UTC (19 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

avoid aliasing with libc functions; ok henning

Revision 1.8 / (download) - annotate - [select for diffs], Tue May 11 04:08:35 2004 UTC (20 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.7: +3 -5 lines
Diff to previous 1.7 (colored)

knf

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 4 20:28:40 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.6: +1 -26 lines
Diff to previous 1.6 (colored)

remove things not used, spotted by lint mostly; ok henning

Revision 1.6 / (download) - annotate - [select for diffs], Tue Apr 20 05:35:33 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.5: +2 -0 lines
Diff to previous 1.5 (colored)

$OpenBSD$

Revision 1.5 / (download) - annotate - [select for diffs], Sun Apr 18 00:43:27 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored)

various knf; henning ok

Revision 1.4 / (download) - annotate - [select for diffs], Fri Apr 16 04:30:09 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.3: +435 -510 lines
Diff to previous 1.3 (colored)

a bunch of knf, ok henning

Revision 1.3 / (download) - annotate - [select for diffs], Wed Apr 14 04:34:19 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.2: +7 -7 lines
Diff to previous 1.2 (colored)

spaces

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 13 23:57:49 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

time_t and kill a few dumb defines

Revision 1.1 / (download) - annotate - [select for diffs], Tue Apr 13 23:41:48 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN

may the whacking begin

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.