OpenBSD CVS

CVS log for src/sbin/dhclient/privsep.c


[BACK] Up to [local] / src / sbin / dhclient

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.79 / (download) - annotate - [select for diffs], Sat Nov 21 18:34:25 2020 UTC (3 years, 6 months ago) by krw
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, HEAD
Changes since 1.78: +2 -3 lines
Diff to previous 1.78 (colored)

No need to update resolv.conf when renewing a lease does not result in any
configuration changges.

Revision 1.78 / (download) - annotate - [select for diffs], Wed May 20 18:27:16 2020 UTC (4 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (colored)

Replace fixed 128-byte fields for search domains, static routes and
domain name servers with variable sized uint8_t chunks.

Allows larger lists of search domains and static routes while making
common situations use much less memory.

Original report of breaching the 128-byte limit for static routes from
James Cook via misc@.

Testing of various versions by Andreas Kusalananda.

Revision 1.77 / (download) - annotate - [select for diffs], Tue May 19 17:59:47 2020 UTC (4 years ago) by krw
Branch: MAIN
Changes since 1.76: +4 -4 lines
Diff to previous 1.76 (colored)

Eliminate imsg_propose{}, imsg_revoke{} and imsg_tell_unwind{} as
unnecessary wrappers, since they all contained a single field that
could be used as is.

Suggested by claudio@

Revision 1.76 / (download) - annotate - [select for diffs], Tue Nov 19 14:35:08 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.75: +11 -1 lines
Diff to previous 1.75 (colored)

Inform unwind about DNS servers it finds in leases.

ok florian@

Revision 1.75 / (download) - annotate - [select for diffs], Tue Feb 12 16:50:44 2019 UTC (5 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.74: +16 -70 lines
Diff to previous 1.74 (colored)

Restructure code to simplifiy imsg communications, further separating
DHCP knowledge and interface manipulation.

Unprivileged process now sends proposal derived from the accepted
lease to the privileged process rather than individual interface
manipulation requests.

The only intended functional change is that /etc/resolv.conf.tail is
not re-read each time a new proposal is implemented, rather than once
at dhclient startup.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Jan 19 21:07:13 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.73: +1 -8 lines
Diff to previous 1.73 (colored)

Since dhclient no longer tries to clean up when exiting, there is no
need to start a new copy when LLADDR or SSID changes. Just go back to
S_PREBOOT and get a new lease.

Fewer log messages, faster join'ing new networks, simpler code.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Jan 19 02:55:10 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

IMSG_HUP -> IMSG_RESTART. sendhup() -> sendrestart.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jan 19 02:45:05 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

Drop pseudo-signal idiom. Rename INTERNALSIG to TERMINATE. Use RESTART
instead of overloading SIGHUP.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Sep 20 19:21:00 2017 UTC (6 years, 8 months ago) by krw
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
Changes since 1.70: +2 -3 lines
Diff to previous 1.70 (colored)

Tweak, shorten, use more consistant verbiage.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Sep 17 21:20:23 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.69: +21 -14 lines
Diff to previous 1.69 (colored)

Create global 'log_procname' and set it to '<ifname>' or
'<ifname> [priv]' as appropriate for the process doing the
setting. Use it as the prefix in all log_*() output. Makes
tracking messages for an interface or a process much easier.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Sep 15 15:22:14 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.68: +8 -3 lines
Diff to previous 1.68 (colored)

Use a poll() loop when trying read the default route from
a routing socket. Fixes at least one cause of resolv.conf
confusion and possibly hanging/looping dhclient if the
RTM_GET gets lost.

Fingered by phessler@ when doing many suspend/resumes
while switching between wifi and wired interfaces.

Testing & ok phessler@

Revision 1.68 / (download) - annotate - [select for diffs], Thu Sep 14 00:10:17 2017 UTC (6 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

Strive to rationalize fatal[x]() usage and
verbiage.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Aug 31 17:01:48 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.66: +6 -3 lines
Diff to previous 1.66 (colored)

Don't delete v4 routes that are going to be
added back.

ok mpi@

Revision 1.66 / (download) - annotate - [select for diffs], Sun Aug 13 17:57:32 2017 UTC (6 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.65: +10 -9 lines
Diff to previous 1.65 (colored)

Simplify HUP handling now that proper error
checks are done on the imsg socket to detect
closure, etc.

Die immediately if the priv process notices
the interface name can't be turned into an
index.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Aug 12 16:57:38 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

Stop trying to outfox the routing table
by labelling dhclient routes. Just use
the route(8) logic when flushing routes.

ok benno@ claudio@

Revision 1.64 / (download) - annotate - [select for diffs], Fri Aug 11 18:00:38 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.63: +10 -5 lines
Diff to previous 1.63 (colored)

Don't write out resolv.conf unless the contents
are changed or dhclient's interface takes over
the default route.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Aug 10 17:15:05 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.62: +29 -8 lines
Diff to previous 1.62 (colored)

Add IMSG_SET_RESOLV_CONF and keep the cached contents
in the priv process, so that they do not have to be
continually retransmitted. IMSG_WRITE_RESOLV_CONF
now just triggers a write of the cached info.

Simplifies a bunch of logic.

Revision 1.62 / (download) - annotate - [select for diffs], Tue Aug 8 17:54:24 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Rename resolv_conf_priority() to default_route_index() to
reflect what it does.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Aug 6 22:05:16 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.60: +8 -2 lines
Diff to previous 1.60 (colored)

Simplify logic seeking/checking the interface over
which the current default route exits.

If the dhclient instance owns that interface it
owns resolv.conf and will overwrite it no matter
who created the default route.

Feedback & suggestions claudio@

Revision 1.60 / (download) - annotate - [select for diffs], Sat Aug 5 12:35:17 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.59: +3 -2 lines
Diff to previous 1.59 (colored)

Bring route creation into line with what route(8) does. In
particular stop providing RFA_IFA, and instead supply the
relevant interface index in the RTM_ADD message.

Various code simplifications as a result.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jul 22 14:56:27 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.58: +5 -5 lines
Diff to previous 1.58 (colored)

Rename *_add_address to *_set_address to reflect that the
lease address replaces all current addresses. Shuffle some
code from bind_lease() into set_mtu()/set_address() to
shrink  bind_lease().

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jul 21 18:57:55 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.57: +5 -6 lines
Diff to previous 1.57 (colored)

s/set_interface_mtu/set_mtu/g

Revision 1.57 / (download) - annotate - [select for diffs], Fri Jul 14 16:21:03 2017 UTC (6 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

Replace remaining "!var" expressions with
"<var> == 0", "!(<var> & FLAG)" with
"(<var> & FLAG) == 0", "!<func()>"
with "<func()> == 0" and "!<define>" with
"<define> == 0". And the positive cases
as well.

A few stray == NULL and != NULL as well.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Jul 10 14:11:47 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Use ioctlfd/routefd sockets rather than rolling one's own
for resolving 'egress' and adding a route. Move creation
of main()'s ioctlfd up so it can be used for the
'egress' resolution.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jul 7 15:39:30 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.54: +8 -10 lines
Diff to previous 1.54 (colored)

dispatch_imsg() only needs to know name and rdomain.

No more struct interface_info knowledge in privsep.[ch]

Revision 1.54 / (download) - annotate - [select for diffs], Sun Jul 2 09:11:13 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Unbreak tree by putting revised resolv_conf_priority() declaration in
correct place and passing the invocation the correct parameters.

Noticed by & initial diff from matthieu@

Revision 1.53 / (download) - annotate - [select for diffs], Sat Jul 1 23:27:56 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.52: +14 -10 lines
Diff to previous 1.52 (colored)

Eliminate multiple socket openings/closings and pass
fd'd from main loops as required. One socket to do
ioctl's per process (called ioctlfd) and one socket to
do route messages per socket (called routefd).

Clean up local variable declaration lists in passing.

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jun 28 16:31:52 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.51: +7 -7 lines
Diff to previous 1.51 (colored)

Only pass required fields of interface_info to priv_* functions
and friends. i.e. ifi->name, ifi->rdomain, or both.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jun 28 14:35:43 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.50: +3 -4 lines
Diff to previous 1.50 (colored)

Stop trying to clean up addresses, routes and "-L" file
whenever dhclient dies. Eliminates differences in handling
and thus need to intercept signals INT, TERM, USR1,
USR2. Eliminates need for 'zapzombies' field and thus
entire struct imsg_flushroutes. Eliminates need for 'imsg'
parameter to and associated logic in priv_flush_routes().

Address, routes and '-L' file are still cleaned out when
binding a lease.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jun 24 23:32:57 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.49: +2 -3 lines
Diff to previous 1.49 (colored)

Tweak handling of HUP and new LLADDR. Just use expose and use sighup()
function. Don't exit dispatch() loop on SIGHUP, wait for privileged
child to execvp() dhclient. Eliminate struct imsg_hup since its
contents were not being used except in priv_cleanup(). And
'active_addr' works just as well there.

Cleaner and eliminates some extraneous log entries.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jun 24 10:09:26 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.48: +5 -4 lines
Diff to previous 1.48 (colored)

Use a local variable rather than a global flag to record
the reception of a IMSG_HUP message and trigger the
desired restart.

Nuke the now pointless IFI_HUP.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Jun 23 16:18:02 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.47: +3 -4 lines
Diff to previous 1.47 (colored)

Oops. Remove extraneous 'return' and some braces from
priv_write_resolv_conf() code that was moved into the
dispatch loop.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jun 23 15:40:56 2017 UTC (6 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.46: +7 -2 lines
Diff to previous 1.46 (colored)

Take reyk's imsg resolv.conf improvements of a while ago to their
logical conclusion.

Nuke _PATH_RESOLV_CONF since the value is only meant to be
known inside priv_write_resolv_conf(). Just use a local const char *.

Bring priv_write_resolv_conf() into line with other priv_ functions
invoked from the dispatch loop. i.e. don't pass it the imsg, just pass
a pointer to the data and a size after ensuring there is data to pass.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Apr 10 21:47:44 2017 UTC (7 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.45: +1 -5 lines
Diff to previous 1.45 (colored)

Rework -L logic to use the idiom used in handling the leases file.
i.e. open FILE during program set up and use the FILE created for
the rest of the program lifetime after dropping privilege and
pledge()'ing. No need for passing messages to the priv process.

Tweak lease file handling a bit in passing.

Monitoring the -L file with external programs like sysutils/entr
still works.

Looks good to sthen@.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Mar 8 19:43:42 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.44: +5 -4 lines
Diff to previous 1.44 (colored)

Shuffle another bit of code closer to its friends.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Feb 12 15:53:15 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.43: +2 -3 lines
Diff to previous 1.43 (colored)

Eliminate most strerror() invocations by using log_warn() and fatal()
instead of log_warnx() and fatalx(). A few log_info() to log_warn()
for the same reason.

Suggested by millert@.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Feb 12 13:15:50 2017 UTC (7 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.42: +10 -9 lines
Diff to previous 1.42 (colored)

Switch from 'legacy' errwarn.c to standard daemon logging functions.

No objections heard. Feedback from millert@ guenther@

Revision 1.42 / (download) - annotate - [select for diffs], Fri Sep 2 15:44:26 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

Kill 'ifi' global.

ok henning@, krw@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Aug 23 09:26:02 2016 UTC (7 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.40: +7 -7 lines
Diff to previous 1.40 (colored)

Make the 'ifi' global local to dhclient.c and pass it as an argument to
functions needing it.

This is the first step to support multiple interfaces in one dhclient(8)
instance.

ok krw@

Revision 1.40 / (download) - annotate - [select for diffs], Sat Feb 6 19:30:52 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.39: +16 -4 lines
Diff to previous 1.39 (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.39 / (download) - annotate - [select for diffs], Sat Feb 7 10:08:06 2015 UTC (9 years, 4 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.38: +9 -1 lines
Diff to previous 1.38 (colored)

Add support for interface-mtu (option 26).

Original request+diff from matthew@

ok dlg@

Revision 1.38 / (download) - annotate - [select for diffs], Fri Feb 6 09:16:06 2015 UTC (9 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.37: +6 -19 lines
Diff to previous 1.37 (colored)

The write_file() privsep interface was too permissive and
theoretically allowed the unprivileged child process to write to
arbitrary files.  Restrict it by replacing it with two specific
write_resolv_conf() and write_option_db() privsep interfaces where all
the critical decision has been moved to the parent.

OK krw@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Oct 27 13:36:21 2014 UTC (9 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

Zap extraneous whitespace and a stuttered extra 'break;'.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Feb 9 14:21:17 2014 UTC (10 years, 4 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.35: +3 -2 lines
Diff to previous 1.35 (colored)

Missing {} around multi-statement else. Malformed IMSG_HUP messages should
not cause privileged process to exit.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jan 20 09:16:36 2014 UTC (10 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

more %d type correctness; ok krw

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jun 9 15:06:34 2013 UTC (11 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored)

Re-apply route adding code refactoring -- it wasn't the problem that
broke populating the egress group.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jun 9 00:30:06 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

Backout static/classless route handling and default route refactoring
since the former relies on the latter and the latter breaks 'egress'
group populating.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 1 16:26:07 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored)

Refactor the default route adding code to use a general route adding
function that will be reused for future work.

ok claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Sat Mar 30 16:10:01 2013 UTC (11 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Since deleting all the addresses on an interface removes all the
relevant entries from the arp cache, don't bother asking for/processing
arp entries in the route dumps. Thus allowing use of NET_RT_FLAGS
with RTF_GATEWAY and AF_INET, to ask for only the routes dhclient
wants to expunge rather than all routes in existance.

Greatly shrinks and simplifies the code. No intentional functional
change. Tested by sthen@.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Feb 18 15:57:08 2013 UTC (11 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.29: +5 -4 lines
Diff to previous 1.29 (colored)

Rework log messages to be more useful. Rename
IMGS_CLEANUP/imsg_cleanup/cleanup to IMSG_HUP/imsg_hup/sendhup to
more accurately reflect intent of causing the privileged process
to initiate restart.

There should now be one and only one message logged at termination
or restart, logged by the process initiating the termination or
restart.

As part of fixing this, remove duplicate cleanup attempts and exit
after sending IMSG_HUP. These make logged messages more consistant and
fix issues with incorrect cleanups.

More prodding from deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jan 27 02:45:46 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.28: +5 -13 lines
Diff to previous 1.28 (colored)

Refactor code a bit. Calculate resolv.conf contents once when binding a
lease and reuse as required whenever resolv.conf is written. Use
write_file() rather than a custom message/functions to write out
resolv.conf.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jan 15 21:44:28 2013 UTC (11 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.27: +23 -3 lines
Diff to previous 1.27 (colored)

Add IMSG_WRITE_FILE and associated bits to allow the unprivileged
process to ask that a file be written by the privileged process.

Not yet used.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Dec 29 14:40:01 2012 UTC (11 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Make HUP to either one of the processes cause a restart that will
have dhclient re-read dhclient.conf and get a new lease. Constrain
the filename passed to '-l' (alternate dhclient.lease.if location)
to be a regular file for the moment.

Original suggestion from phessler@. Feedback from deraadt@ and
espie@.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Dec 4 19:24:03 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored)

Eliminate hand-rolled pseudo-strerror() %m strangeness by replacing
all occurances of %m with strerror(errno). And then nuking do_percentm()
and related buffer shuffling.

Also simplify parse_warn() so it takes a simple char * of the error,
and thus rely on pointing to error location in input for details.

Makes sense to beck@

Revision 1.25 / (download) - annotate - [select for diffs], Sun Dec 2 17:03:19 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.24: +9 -1 lines
Diff to previous 1.24 (colored)

Try harder to cleanup when exiting. In particular catch signals
SIGHUP, SIGINT, SIGTERM, SIGUSR1, SIGUS2 and cleanup before exiting
when getting them. Cleanup meaning removing routes and the interface
address added.

Tweaks and feedback from phessler@, sthen@, otto@, deraadt@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Nov 23 15:25:47 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.23: +58 -301 lines
Diff to previous 1.23 (colored)

Use the libutil imsg framework rather than a hand-rolled local
version. This is the last hand-rolled imsg implementation I could
spot. Doesn't seem to break sparc64.

Suggested by chris@, tweaks from brad@ and reyk@.

ok reyk@

Revision 1.23 / (download) - annotate - [select for diffs], Wed Nov 14 15:47:41 2012 UTC (11 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.22: +4 -4 lines
Diff to previous 1.22 (colored)

Remove useless _new_ and _old_ from various function names to make
them shorter and eliminate implications about what the function
does. No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Nov 8 21:32:55 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.21: +2 -3 lines
Diff to previous 1.21 (colored)

Remove confusing extra address abstraction 'struct iaddr'. Just use
'in_addr'. Remove many double conversions and other perversions.
piaddr() replaced with inet_ntoa(). dhclient is extremely unlikely
to support anything but ipv4/dhcp without a complete rewrite.

Joint work with chris@.

Positive feedback from deraadt@ zinke@ phessler@.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Nov 4 03:44:48 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Use consistant initialization idiom to reduce confusion.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 4 03:36:39 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.19: +2 -21 lines
Diff to previous 1.19 (colored)

No need to pass interface name around when flushing routes.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Nov 4 03:25:31 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.18: +2 -22 lines
Diff to previous 1.18 (colored)

No need to pass interface name around when creating routes.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Nov 3 16:54:34 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.17: +3 -19 lines
Diff to previous 1.17 (colored)

Various fixes/tweaks for resolv.conf handling:

1) Don't leak a file descriptor if there are no contents for
resolv.conf.
2) Allow for only resolv.conf.tail to go into resolv.conf.
3) Don't need to pass around interface name when creating resolv.conf.
4) Don't leave 0 length resolv.conf lying around if there are no
contents.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Oct 30 18:39:44 2012 UTC (11 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.16: +276 -104 lines
Diff to previous 1.16 (colored)

Nuke dhclient-script and dhclient.conf 'script' directive. Do all
interface and route configuration via ioctl's and routing sockets.

This will break configurations using local enhancements of
dhclient-script, which will now require alternate arrangements.

Committing early to allow time to identify and develop required
alternatives.

Several proddings by deraadt@.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Apr 4 11:14:52 2011 UTC (13 years, 2 months ago) by krw
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
Changes since 1.15: +5 -17 lines
Diff to previous 1.15 (colored)

Dump some useless calls to dhclient-script. i.e. MEDIUM, PREINIT,
ARPSEND, ARPCHECK. Drop support for 'media', 'medium' and 'alias'
specifications in dhclient.conf. Old leases still parse but these
options now have no effect.

Be more polite and decline all offers we don't accept. Fix a IMSG
length check.

Many expressions of support at various bars.

ok henning@ deraadt@ beck@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 6 04:02:42 2009 UTC (15 years ago) by krw
Branch: MAIN
CVS Tags: 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.14: +3 -1 lines
Diff to previous 1.14 (colored)

Nuke debug() unless DEBUG is defined. Elminates debug output from
normal operations.

Prodded by deraadt@ a while ago.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 15 15:22:27 2007 UTC (17 years, 3 months ago) by stevesk
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, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.13: +5 -3 lines
Diff to previous 1.13 (colored)

make read connection closed message a debug(); ok henning@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 14 23:19:26 2007 UTC (17 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

spacing and a typo that fell out of the read

Revision 1.12 / (download) - annotate - [select for diffs], Fri Oct 7 13:19:40 2005 UTC (18 years, 8 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.11: +5 -7 lines
Diff to previous 1.11 (colored)

Don't display errno message when errno isn't set.
Okay deraadt@, moritz@, help and okay henning@

Revision 1.11 / (download) - annotate - [select for diffs], Mon Aug 8 14:33:46 2005 UTC (18 years, 10 months ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.10: +4 -1 lines
Diff to previous 1.10 (colored)

re-add write() error check in buf_close(). ok henning@

Revision 1.10 / (download) - annotate - [select for diffs], Sun Aug 7 01:35:11 2005 UTC (18 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.9: +15 -22 lines
Diff to previous 1.9 (colored)

Simplify code by calling error() from inside buf_* functions rather
than always testing the return code and calling error() from the
caller.

From a diff by moritz@, ok henning@.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Aug 4 14:21:04 2005 UTC (18 years, 10 months ago) by henning
Branch: MAIN
Changes since 1.8: +9 -20 lines
Diff to previous 1.8 (colored)

buf_* was taken from the framework I wrote for bgpd (also used by ntpd, ospfd
and some more). Here, however, we have a blocking socket for the IPC.
buf_close (writes out) and buf_read can be simplified due to that, and they
can just error out on short writes/reads. ok krw moritz

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 2 15:04:25 2005 UTC (19 years ago) by cloder
Branch: MAIN
Changes since 1.7: +4 -1 lines
Diff to previous 1.7 (colored)

Make buf_add a no-op if length == 0. OK henning

Revision 1.7 / (download) - annotate - [select for diffs], Mon May 10 18:34:42 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 (colored)

missing casts spotted by 64 bit cc

Revision 1.6 / (download) - annotate - [select for diffs], Tue May 4 19:56:18 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.5: +7 -7 lines
Diff to previous 1.5 (colored)

use SIZE_T_MAX, canacar

Revision 1.5 / (download) - annotate - [select for diffs], Tue May 4 18:58:50 2004 UTC (20 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

more shrink and lint fixes; henning ok

Revision 1.4 / (download) - annotate - [select for diffs], Tue May 4 18:51:18 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.3: +2 -0 lines
Diff to previous 1.3 (colored)

$OpenBSD$

Revision 1.3 / (download) - annotate - [select for diffs], Tue May 4 18:49:52 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.2: +7 -6 lines
Diff to previous 1.2 (colored)

prevent the len params from overflowing, catched by & ok canacar

Revision 1.2 / (download) - annotate - [select for diffs], Tue May 4 18:14:51 2004 UTC (20 years, 1 month ago) by canacar
Branch: MAIN
Changes since 1.1: +4 -1 lines
Diff to previous 1.1 (colored)

Fix memory leak, ok henning@

Revision 1.1 / (download) - annotate - [select for diffs], Tue May 4 12:52:05 2004 UTC (20 years, 1 month ago) by henning
Branch: MAIN

privilege seperate dhclient.
the privileged child's duty is the dhclient-script env setup & exection.
the parent process now chroots to /var/empty and drops privileges to _dhcp
mostly hacked at vancouver airport
with some feedback from krw@ and otto@, tested to not break installs by krw@

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.