parpd
19 months agoFix mandoc lint errors. master
Roy Marples [Tue, 8 Oct 2019 15:18:48 +0000 (16:18 +0100)]
Fix mandoc lint errors.

19 months agoattack command will attack RFC 5227 implementations
Roy Marples [Tue, 8 Oct 2019 15:10:09 +0000 (16:10 +0100)]
attack command will attack RFC 5227 implementations

Only useful for testing them.

19 months agoFix more compile warnings.
Roy Marples [Mon, 7 Oct 2019 14:13:05 +0000 (15:13 +0100)]
Fix more compile warnings.

19 months agoFix a compile warning
Roy Marples [Mon, 7 Oct 2019 14:10:29 +0000 (15:10 +0100)]
Fix a compile warning

19 months agoLinux: File compile warnings
Roy Marples [Mon, 7 Oct 2019 14:07:25 +0000 (15:07 +0100)]
Linux: File compile warnings

19 months agobuild: Add common.h for compat
Roy Marples [Mon, 7 Oct 2019 14:01:47 +0000 (15:01 +0100)]
build: Add common.h for compat

19 months agobuild: Add compat to import-src
Roy Marples [Mon, 7 Oct 2019 14:01:33 +0000 (15:01 +0100)]
build: Add compat to import-src

19 months agobuild: Fix test for TAILQ_FOREACH_SAFE
Roy Marples [Mon, 7 Oct 2019 14:00:21 +0000 (15:00 +0100)]
build: Fix test for TAILQ_FOREACH_SAFE

19 months agoLinux: Fix compile
Roy Marples [Mon, 7 Oct 2019 13:59:50 +0000 (14:59 +0100)]
Linux: Fix compile

19 months agocompat: Add rbtree(3) from NetBSD
Roy Marples [Mon, 7 Oct 2019 13:59:12 +0000 (14:59 +0100)]
compat: Add rbtree(3) from NetBSD

19 months agoFavour rbtree(3) over queue(3).
Roy Marples [Mon, 7 Oct 2019 13:32:22 +0000 (14:32 +0100)]
Favour rbtree(3) over queue(3).

Avoids the limitations of hcreate(3) as well as being faster.
pents are also a rbtree as well for good measure.

19 months agoBSD: BIOCIMMEDIATE is unsigned int
Roy Marples [Mon, 7 Oct 2019 13:22:13 +0000 (14:22 +0100)]
BSD: BIOCIMMEDIATE is unsigned int

19 months agobuild: ignore configure generated files
Roy Marples [Mon, 7 Oct 2019 11:10:15 +0000 (12:10 +0100)]
build: ignore configure generated files

19 months agoDon't use phabricator anymore
Roy Marples [Mon, 7 Oct 2019 11:09:32 +0000 (12:09 +0100)]
Don't use phabricator anymore

19 months agoAdd compat for strlcpy
Roy Marples [Mon, 7 Oct 2019 11:06:01 +0000 (12:06 +0100)]
Add compat for strlcpy

19 months agobuild: Use configure rather than mk stubs
Roy Marples [Mon, 7 Oct 2019 11:04:37 +0000 (12:04 +0100)]
build: Use configure rather than mk stubs

Makes things easier, taken from dhcpcd.

3 years agoFix kqueue usage when forking in the background
Emmanuel Dreyfus [Mon, 26 Jun 2017 09:38:39 +0000 (11:38 +0200)]
Fix kqueue usage when forking in the background

Summary:
NetBSD's kqueue(2) man page says "The queue is not inherited by a
child created with fork(2)", which means the poll_fd needs to be
reopen after forking in the background.

This is done by calling eloop_requeue() after daemon().

Fixes T127.

Tags: #parpd

Maniphest Tasks: T127

Differential Revision: https://dev.marples.name/D123

4 years agoPrepare for 1.7 parpd-1.7
Roy Marples [Fri, 24 Mar 2017 16:39:20 +0000 (16:39 +0000)]
Prepare for 1.7

4 years agoAnother tweak.
Roy Marples [Fri, 24 Mar 2017 16:19:27 +0000 (16:19 +0000)]
Another tweak.

4 years agoRevert
Roy Marples [Fri, 24 Mar 2017 15:38:15 +0000 (15:38 +0000)]
Revert

4 years agoTweak
Roy Marples [Fri, 24 Mar 2017 15:19:47 +0000 (15:19 +0000)]
Tweak

4 years agoAdd LICENSE file.
Roy Marples [Fri, 24 Mar 2017 15:04:14 +0000 (15:04 +0000)]
Add LICENSE file.

4 years agoFix inverted check for ARP packet type
Mantas Mikulnas [Fri, 24 Mar 2017 12:23:39 +0000 (12:23 +0000)]
Fix inverted check for ARP packet type

Summary:
Currently the BPF filter accepts all ARP packets that _aren't_ requests.

Fixes T110.

Reviewers: roy

Reviewed By: roy

Tags: #parpd

Maniphest Tasks: T110

Differential Revision: https://dev.marples.name/D102

4 years agoDo not crash when ifa_addr is null
Mantas Mikul─Śnas [Fri, 24 Mar 2017 12:01:45 +0000 (12:01 +0000)]
Do not crash when ifa_addr is null

Summary:
This happens with tun interfaces, which are layer 3 only.

Fixes T109.

Reviewers: roy

Reviewed By: roy

Maniphest Tasks: T109

Differential Revision: https://dev.marples.name/D103

4 years agoAdd an .arcconfig file for arcanist to talk to phabricator.
Roy Marples [Fri, 24 Mar 2017 09:50:52 +0000 (09:50 +0000)]
Add an .arcconfig file for arcanist to talk to phabricator.

4 years agoPrepare for 1.6 parpd-1.6
Roy Marples [Tue, 14 Mar 2017 21:36:02 +0000 (21:36 +0000)]
Prepare for 1.6

4 years agoWhitespace and copyright
Roy Marples [Tue, 14 Mar 2017 21:29:55 +0000 (21:29 +0000)]
Whitespace and copyright

4 years agoarp_bpf -> bpf_arp
Roy Marples [Tue, 14 Mar 2017 21:27:15 +0000 (21:27 +0000)]
arp_bpf -> bpf_arp

4 years agoRemove fairly useless installation instructions.
Roy Marples [Tue, 14 Mar 2017 09:46:20 +0000 (09:46 +0000)]
Remove fairly useless installation instructions.

4 years agoAdd distclean support.
Roy Marples [Sat, 11 Mar 2017 20:32:04 +0000 (20:32 +0000)]
Add distclean support.

4 years agoUse xz to create archives, drop svn support.
Roy Marples [Sat, 11 Mar 2017 20:24:39 +0000 (20:24 +0000)]
Use xz to create archives, drop svn support.

4 years agoMinor man page updates.
Roy Marples [Sat, 11 Mar 2017 19:37:09 +0000 (19:37 +0000)]
Minor man page updates.

4 years agoFilter out ARP replies, we only want requests.
Roy Marples [Sat, 11 Mar 2017 14:49:21 +0000 (14:49 +0000)]
Filter out ARP replies, we only want requests.

4 years agoRename raw functions to bpf so they are more descriptive.
Roy Marples [Sat, 11 Mar 2017 12:28:25 +0000 (12:28 +0000)]
Rename raw functions to bpf so they are more descriptive.

4 years agoImprove the BPF filter based on the latest dhcpcd code.
Roy Marples [Sat, 11 Mar 2017 12:17:45 +0000 (12:17 +0000)]
Improve the BPF filter based on the latest dhcpcd code.
This does hardwire the filter to ethernet, but then it already
was on non Linux platforms anyway.

4 years agoFix a memory leak.
Roy Marples [Sat, 11 Mar 2017 12:12:55 +0000 (12:12 +0000)]
Fix a memory leak.

4 years agoUpgrade to the latest eloop from dhcpcd.
Roy Marples [Fri, 10 Mar 2017 22:04:42 +0000 (22:04 +0000)]
Upgrade to the latest eloop from dhcpcd.

4 years agoWelcome to 2017.
Roy Marples [Fri, 10 Mar 2017 21:00:15 +0000 (21:00 +0000)]
Welcome to 2017.

4 years agoPhabricator doesn't seem to like Markdown reference links ...
Roy Marples [Fri, 10 Mar 2017 20:56:23 +0000 (20:56 +0000)]
Phabricator doesn't seem to like Markdown reference links ...

4 years agoAdd an initial README.md
Roy Marples [Fri, 10 Mar 2017 20:45:11 +0000 (20:45 +0000)]
Add an initial README.md

4 years agoAdd a .gitignore file
Roy Marples [Fri, 10 Mar 2017 20:33:13 +0000 (20:33 +0000)]
Add a .gitignore file

4 years agoUse inet_pton to convert inet addresses so 169.254/16 produces an error rather than...
Roy Marples [Fri, 10 Mar 2017 20:32:57 +0000 (20:32 +0000)]
Use inet_pton to convert inet addresses so 169.254/16 produces an error rather than using 169.0.0.254/16

4 years agoDefault to using O2
Roy Marples [Sun, 19 Feb 2017 13:42:10 +0000 (13:42 +0000)]
Default to using O2

4 years agoRemove distinfo files before making them and keep distinfo in signed result.
Roy Marples [Sat, 5 Nov 2016 14:07:41 +0000 (14:07 +0000)]
Remove distinfo files before making them and keep distinfo in signed result.

4 years agoAdd distinfo target from dhcpcd
Roy Marples [Fri, 4 Nov 2016 16:12:08 +0000 (16:12 +0000)]
Add distinfo target from dhcpcd

5 years agoFix compile.
Roy Marples [Mon, 29 Feb 2016 15:23:11 +0000 (15:23 +0000)]
Fix compile.

5 years agohcreate_r is not portable, so use hcreate(3).
Roy Marples [Mon, 29 Feb 2016 15:17:29 +0000 (15:17 +0000)]
hcreate_r is not portable, so use hcreate(3).
Some hcreate(3) implemenations do not chain, so create a hastable big
enough for each open file we can manage + 25% as recommended on glibc
systems.

5 years agoAdd queue.h for Linux, taken from NetBSD.
Roy Marples [Sun, 28 Feb 2016 07:56:00 +0000 (07:56 +0000)]
Add queue.h for Linux, taken from NetBSD.

5 years agoSync latest eloop.
Roy Marples [Sun, 28 Feb 2016 07:54:11 +0000 (07:54 +0000)]
Sync latest eloop.

5 years agoSync eloop with master from dhcpcd.
Roy Marples [Fri, 26 Feb 2016 21:26:00 +0000 (21:26 +0000)]
Sync eloop with master from dhcpcd.

5 years agoNote proxying correctly.
Roy Marples [Fri, 26 Feb 2016 10:36:44 +0000 (10:36 +0000)]
Note proxying correctly.

5 years agoAdd eloop from dhcpcd for kqueue(2) and epoll(7) support.
Roy Marples [Fri, 26 Feb 2016 02:17:41 +0000 (02:17 +0000)]
Add eloop from dhcpcd for kqueue(2) and epoll(7) support.
Use hcreate_r(3) to create a hashtable of interfaces.

This removes some loops to find interfaces.

5 years agoAll platforms now support getline(3).
Roy Marples [Thu, 25 Feb 2016 22:05:21 +0000 (22:05 +0000)]
All platforms now support getline(3).

5 years agoUse calloc here.
Roy Marples [Thu, 25 Feb 2016 21:29:43 +0000 (21:29 +0000)]
Use calloc here.

5 years agoRemove syslog from here, errors reported higher up.
Roy Marples [Thu, 25 Feb 2016 21:27:51 +0000 (21:27 +0000)]
Remove syslog from here, errors reported higher up.

5 years agoadd more debug flags
Roy Marples [Thu, 25 Feb 2016 21:22:03 +0000 (21:22 +0000)]
add more debug flags

5 years agoClean some compiler warnings
Roy Marples [Thu, 25 Feb 2016 21:21:50 +0000 (21:21 +0000)]
Clean some compiler warnings

6 years agoActually work with half proxy
Roy Marples [Tue, 21 Oct 2014 10:23:27 +0000 (10:23 +0000)]
Actually work with half proxy

6 years agoAdd the halfproxy command to ignore requests from the unspecified address.
Roy Marples [Tue, 21 Oct 2014 08:16:07 +0000 (08:16 +0000)]
Add the halfproxy command to ignore requests from the unspecified address.

7 years agoAdd fossil support.
Roy Marples [Wed, 23 Apr 2014 18:04:06 +0000 (18:04 +0000)]
Add fossil support.
Fix -Wconversion errors.
Support gmake-4.

7 years agoRemove .gitignore as we're now using fossil
Roy Marples [Sun, 22 Dec 2013 21:26:21 +0000 (21:26 +0000)]
Remove .gitignore as we're now using fossil

11 years agoRelease parpd-1.5 parpd-1.5
Roy Marples [Wed, 21 Apr 2010 19:19:43 +0000 (19:19 +0000)]
Release parpd-1.5

11 years agoEnsure that we handle our buffer correctly.
Roy Marples [Wed, 21 Apr 2010 19:15:27 +0000 (19:15 +0000)]
Ensure that we handle our buffer correctly.

12 years agoAdd (c) to Copyright
Roy Marples [Fri, 1 May 2009 14:12:43 +0000 (14:12 +0000)]
Add (c) to Copyright

12 years agoGo back to using git
Roy Marples [Thu, 30 Apr 2009 13:25:11 +0000 (13:25 +0000)]
Go back to using git

12 years agoRelease parpd-1.4 parpd-1.4
Roy Marples [Fri, 24 Apr 2009 09:41:58 +0000 (09:41 +0000)]
Release parpd-1.4

12 years agoFix compile on BSD.
Roy Marples [Fri, 24 Apr 2009 09:30:01 +0000 (09:30 +0000)]
Fix compile on BSD.

12 years agoRemove OS specific code to detect interfaces and use getifaddrs instead.
Roy Marples [Fri, 24 Apr 2009 09:26:28 +0000 (09:26 +0000)]
Remove OS specific code to detect interfaces and use getifaddrs instead.

12 years agoCheck if daemon call worked or not.
Roy Marples [Fri, 24 Apr 2009 08:39:03 +0000 (08:39 +0000)]
Check if daemon call worked or not.

12 years agoRemove .depend before creating it.
Roy Marples [Fri, 24 Apr 2009 08:38:26 +0000 (08:38 +0000)]
Remove .depend before creating it.

12 years agoRelease 1.3 parpd-1.3
Roy Marples [Mon, 20 Apr 2009 15:40:29 +0000 (15:40 +0000)]
Release 1.3

12 years agomandoc mandates the presence of .Os
Roy Marples [Thu, 12 Mar 2009 12:53:59 +0000 (12:53 +0000)]
mandoc mandates the presence of .Os

12 years ago~0U is better than just ~0 for this.
Roy Marples [Wed, 29 Oct 2008 08:14:17 +0000 (08:14 +0000)]
~0U is better than just ~0 for this.

12 years agoAllow default parpd.conf location to be tunable.
Roy Marples [Mon, 27 Oct 2008 10:51:55 +0000 (10:51 +0000)]
Allow default parpd.conf location to be tunable.

12 years agoRelease 1.1.1 parpd-1.1.1
Roy Marples [Mon, 27 Oct 2008 09:29:39 +0000 (09:29 +0000)]
Release 1.1.1

12 years agoWe don't install an example parpd.conf, so remove this.
Roy Marples [Mon, 27 Oct 2008 09:18:01 +0000 (09:18 +0000)]
We don't install an example parpd.conf, so remove this.

12 years agoRelease 1.1 parpd-1.1
Roy Marples [Fri, 17 Oct 2008 22:02:32 +0000 (22:02 +0000)]
Release 1.1

12 years agoNo need to check the ip alone.
Roy Marples [Fri, 17 Oct 2008 17:39:48 +0000 (17:39 +0000)]
No need to check the ip alone.

12 years agoStore the network ID instead of IP.
Roy Marples [Fri, 17 Oct 2008 17:02:42 +0000 (17:02 +0000)]
Store the network ID instead of IP.

12 years agoCast to void * to avoid compiler warnings on Sparc64.
Roy Marples [Wed, 15 Oct 2008 12:22:22 +0000 (12:22 +0000)]
Cast to void * to avoid compiler warnings on Sparc64.

12 years agoCompile fixes for FreeBSD-6
Roy Marples [Wed, 15 Oct 2008 08:20:11 +0000 (08:20 +0000)]
Compile fixes for FreeBSD-6

12 years agoWe are only removing ifaces without pents, so this free was a non op.
Roy Marples [Tue, 14 Oct 2008 13:47:37 +0000 (13:47 +0000)]
We are only removing ifaces without pents, so this free was a non op.

12 years agoIf hwaddr is a comment then make it NULL.
Roy Marples [Tue, 14 Oct 2008 13:42:28 +0000 (13:42 +0000)]
If hwaddr is a comment then make it NULL.

12 years agoIntroduce the interface command in parpd.conf. This should be flexable enough so...
Roy Marples [Tue, 14 Oct 2008 12:22:08 +0000 (12:22 +0000)]
Introduce the interface command in parpd.conf. This should be flexable enough so that only one parpd instance would ever be needed.

12 years agoAdd more comments.
Roy Marples [Tue, 14 Oct 2008 10:48:14 +0000 (10:48 +0000)]
Add more comments.

12 years agoOptimize get_word a little and describe its function.
Roy Marples [Tue, 14 Oct 2008 10:41:40 +0000 (10:41 +0000)]
Optimize get_word a little and describe its function.

12 years agoAdd a fgetln wrapper for non BSD systems. Use glibc getline near equivalent if available.
Roy Marples [Tue, 14 Oct 2008 10:39:46 +0000 (10:39 +0000)]
Add a fgetln wrapper for non BSD systems. Use glibc getline near equivalent if available.

12 years agoSave a few hundred bytes by using fgetln instead of our custom get_line function...
Roy Marples [Tue, 14 Oct 2008 07:19:02 +0000 (07:19 +0000)]
Save a few hundred bytes by using fgetln instead of our custom get_line function. As we don't have C strings as a result, we have a new get_word function to find the words we need.

12 years agoUse sscanf to pull directly onto ifr. This saves needing a buffer at all :)
Roy Marples [Mon, 13 Oct 2008 15:56:16 +0000 (15:56 +0000)]
Use sscanf to pull directly onto ifr. This saves needing a buffer at all :)

12 years agoPunt xmalloc and friends. Move get_line to parpd.c and use a macro snprintf to strlcp...
Roy Marples [Mon, 13 Oct 2008 14:00:18 +0000 (14:00 +0000)]
Punt xmalloc and friends. Move get_line to parpd.c and use a macro snprintf to strlcpy for systems without it. This removes common.c,h and saves around 400 bytes.

12 years agoWe don't really have these functions from dhcpcd.
Roy Marples [Wed, 8 Oct 2008 08:17:54 +0000 (08:17 +0000)]
We don't really have these functions from dhcpcd.

12 years agoWe should not redefine UNCONST here.
Roy Marples [Wed, 8 Oct 2008 08:16:15 +0000 (08:16 +0000)]
We should not redefine UNCONST here.

12 years agoFix reporting.
Roy Marples [Tue, 7 Oct 2008 21:06:46 +0000 (21:06 +0000)]
Fix reporting.

12 years agoInitial import.
Roy Marples [Tue, 7 Oct 2008 19:39:47 +0000 (19:39 +0000)]
Initial import.