OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.24 / (download) - annotate - [select for diffs], Wed Jan 5 11:01:59 2022 UTC (2 years, 5 months ago) by tb
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.23: +19 -10 lines
Diff to previous 1.23 (colored)

dhcpd: straightforward conversion to HMAC_CTX on the heap, similar
to what was done in spamd a while back.

ok florian

Revision 1.23 / (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_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, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, 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
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (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.22 / (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.21: +5 -5 lines
Diff to previous 1.21 (colored)

Adjust some long lines.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Feb 13 21:53:53 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.20: +5 -7 lines
Diff to previous 1.20 (colored)

Do the strerror() elimination dance with log_warnx() -> log_warn(),
fatalx() -> fatal() and even a couple of fprintf(stderr) -> log_warn().

Revision 1.20 / (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.19: +12 -11 lines
Diff to previous 1.19 (colored)

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

ok benno@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Oct 21 11:34:48 2016 UTC (7 years, 7 months ago) by mestre
Branch: MAIN
Changes since 1.18: +14 -14 lines
Diff to previous 1.18 (colored)

- Use memset(*b, 0, len) instead of bzero(*b, len)
- Use explicit_bzero(3) instead of bzero(3) to clean temporary HMAC

OK krw@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Oct 4 22:47:51 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Zap stray whitespace.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Feb 6 23:50:10 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.16: +13 -18 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:16 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.15: +1 -2 lines
Diff to previous 1.15 (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.15 / (download) - annotate - [select for diffs], Fri Oct 18 15:19:40 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Scattering a few bcopy()'s around source using mostly memcpy() is just
asking for confusion. Replace bcopy()'s with memcpy()'s.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Oct 18 13:44:35 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Mon Apr 22 15:02:42 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.12: +6 -14 lines
Diff to previous 1.12 (colored)

When sync'ing, look for lease by hwaddr and then ipaddr. Not hwaddr
twice. Simplify logic. Fixes loops while sync'ing for sthen@.

Spotted by & fixed tested by sthen@.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Apr 13 18:08:47 2013 UTC (11 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.11: +28 -27 lines
Diff to previous 1.11 (colored)

Give struct dhcp_synctlv_lease fields a prefix (lv_) as the fields
in other structs have. Reduces potential for confusion with fields
of same name but different types in leases. Use consistent variable
name. No change to executable.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Apr 12 00:27:32 2013 UTC (11 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Unbreak lease synchronization by making the sync header contain the
correct packet length even when paddding is present. Previously the
HMAC calculated by the receiver would not be based on the whole
packet.

Problem noted and essentially identical diffs from Kapetanakis Giannis
via misc@ and then Johan Ymerson via bugs@.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Dec 23 17:38:04 2010 UTC (13 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: 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
Changes since 1.9: +16 -27 lines
Diff to previous 1.9 (colored)

Use the provided note() and warning() functions of dhcpd instead of
calling syslog_r() directly -- this make -d work as expected.
OK reyk@, stsp@, deraadt@

Revision 1.9 / (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_4_8_BASE, OPENBSD_4_8
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

malloc/strlcpy -> strdup. Use consistent idiom.

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

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jan 3 18:37:06 2010 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

unused prototype

Revision 1.7 / (download) - annotate - [select for diffs], Mon Sep 15 20:38:17 2008 UTC (15 years, 8 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

When checking if a syscall like open(), ioctl() or writev() failed compare
directly against -1 and do not use a < 0 test. OK henning@

Revision 1.6 / (download) - annotate - [select for diffs], Fri May 30 05:58:20 2008 UTC (16 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

correct size of iov[]; ralf.horstmann@gmx.de

Revision 1.5 / (download) - annotate - [select for diffs], Sun May 11 08:50:54 2008 UTC (16 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.4: +4 -1 lines
Diff to previous 1.4 (colored)


fix sync.c to not puke if sync_lease called without sync_init.
from henric.

Revision 1.4 / (download) - annotate - [select for diffs], Thu May 8 14:15:40 2008 UTC (16 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.3: +13 -2 lines
Diff to previous 1.3 (colored)

Insert pad blocks after sub-messages to keep the structures aligned to
16 byte boundaries for maximum portability (somewhat similar to CMSG's)
ok beck

Revision 1.3 / (download) - annotate - [select for diffs], Thu May 8 07:28:08 2008 UTC (16 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

this should really only be in one file.

Revision 1.2 / (download) - annotate - [select for diffs], Thu May 8 05:38:26 2008 UTC (16 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.1: +4 -1 lines
Diff to previous 1.1 (colored)

don't break dhcpd when not using synch mechanisms..

Revision 1.1 / (download) - annotate - [select for diffs], Wed May 7 12:19:20 2008 UTC (16 years, 1 month ago) by beck
Branch: MAIN

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@

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.