39 Commits

Author SHA1 Message Date
Robin H. Johnson
74f5412446 feat: Support more addresses in RDNSS section
This is based on PR#193, with significant cleanups & safety checks
added.

- RFC 6106 section 5.3.1 recommended that the number of RDNSS addresses
  should be limited to three, however that was for clients, not servers.
- RFC 8106 section 5.3.1 clarified the recommendation to at least 3 from
  multiple sources.

Based on this, set the limit for a single RDNSS section to 127 servers
in radvd, based on the size of the length field. Note that it may cause
fragmentation as the single option exceeds usable RA option space (MTU
less headers); and server configurations should generally use fewer.

See also the RFC6106 errata & RFC6980 section 2 for behaviors of very
large RA options.

Reference: https://www.rfc-editor.org/errata/rfc6106
Reference: https://datatracker.ietf.org/doc/html/rfc6980#section-2
Reference: https://datatracker.ietf.org/doc/html/rfc6106#section-5.3.1
Reference: https://datatracker.ietf.org/doc/html/rfc8106#section-5.3.1
Based-on: https://github.com/radvd-project/radvd/pull/193
Based-on-work-by: WenChao1Hou <wenchao.hou@outlook.com>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2024-12-28 21:13:49 -08:00
Robin H. Johnson
aa0042ba78 test: cleanup testcases for -Wfree-nonheap-object
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2023-01-03 15:16:45 -08:00
Reuben Hawkins
fcc3b9cb36 clang-format the code 2017-02-04 07:37:11 -08:00
Robin H. Johnson
877b70e10f util: Document safe_buffer_list functionality.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-22 21:35:46 -08:00
Robin H. Johnson
60c553df70 safe_buffer: simplify memory functions.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-22 17:18:50 -08:00
Robin H. Johnson
ef609205c0 clone_safe_buffer: remove unused function.
Function was used in earlier versions of the RA-split series (clone the
RA header and then append to it).

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-22 15:04:42 -08:00
Robin H. Johnson
27d554bf76 util: safe_buffer_list_append.
Avoid underutilized memory in safe_buffer_list.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-20 19:49:46 -08:00
Robin H. Johnson
14ee7684cf test/util: safe_buffer/safe_buffer_list coverage
One additional function safe_buffer_list_to_safe_buffer for ease of
testing test/send.c functionality.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-20 19:43:38 -08:00
Robin H. Johnson
28869413a2 util/safe_buffer_list_free: fix leak of list itself.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-19 12:02:14 -08:00
Robin H. Johnson
88303baf04 util: put buffer size validation back on used space rather than allocated space
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-19 11:46:46 -08:00
Robin H. Johnson
da261b26ea util: cleanup safe_buffer_append/safe_buffer_pad
- safe_buffer_pad now uses extend+memset instead of repeated
  safe_buffer_append.
- safe_buffer_append now uses safe_buffer_extend.
- safe_buffer_append no longer enforces a length limit (this is obsolete
  with RA splitting).

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-19 01:26:38 -08:00
Robin H. Johnson
3b729ac5cb util: safe_buffer manipulation functions.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-19 00:24:07 -08:00
Robin H. Johnson
77ea330e10 util: Add safe_buffer_list.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-19 00:24:06 -08:00
Robin H. Johnson
9aad6f02de AdvRASrcAddress: selection of RA source address
New functionality to allow selection of RA IPv6 source address, from the
intersection of specified addresses and the interface addresses.

If there is no overlap between the two sets of addresses, then no RA is
sent.

Fixes: https://github.com/reubenhwk/radvd/issues/45
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-11-12 12:36:33 -08:00
Reuben Hawkins
9b5271c672 move autoselect prefix code from gram.y to send.c
This solve the problem of new prefixes not being discovered after
the config file was read.
2016-09-18 18:56:48 -07:00
Reuben Hawkins
c9bfdec22f move unit code tests to the test folder
Rather than crowding out the useful code in util.c and send.c, put
the code for the unit test in their own files and #include the code
into the c files they're testing.
2014-07-10 08:52:12 -07:00
Reuben Hawkins
301007a236 util.c: add test fixture for a couple unit tests
avoid reading and rereading the test config file.
2014-07-03 17:50:20 -05:00
Reuben Hawkins
5dee7dab1b add dnssl and rdnss checks 2014-07-03 17:50:19 -05:00
Reuben Hawkins
c6e2667d08 add unit tests 2014-07-03 17:50:19 -05:00
Reuben Hawkins
69717d0254 util.c: clean up check_dnssl_presence and check_rdnss_presence 2014-07-03 17:49:02 -05:00
Reuben Hawkins
24577e3d9a build RA buffer through API
This makes a buffer overrun less likely.  Before this change the
buffer usage was tracked separately from the actually buffer
usage which can easily lead to bugs.  This change adds an API which
writes to the buffer and tracks the buffer usage through simple
functions.
2014-06-26 09:32:37 -05:00
Reuben Hawkins
193311e52c util.c: print_addr -> addrtostr 2014-06-04 12:28:09 -05:00
Reuben Hawkins
000058672f util.c: add strdupf 2014-06-04 12:28:09 -05:00
Reuben
ac6fc184fa reindented the code
... with  indent -linux -l180 *.c *.h
2014-01-05 05:49:50 -06:00
Reuben
00d0abcb76 remove unused mdelay 2013-11-30 21:00:55 -06:00
Reuben
9736417831 replaced pekkas@netcore.fi with reubenhwk@gmail.com 2012-11-20 08:28:14 -08:00
Reuben Hawkins
2e9ac5930b removing all CVS keywords with sed -i '/\$.*\$$/d' 2012-01-12 06:25:08 -08:00
psavola
79b5647150 Fix whitespaces; #includes; CLEANFILES; From Reuben Hawkins. 2010-12-14 11:58:21 +00:00
psavola
e50b49f55d Support RFC 6106 by adding DNS search list option.
Patch from Pierre Ossman.
2010-12-14 11:41:17 +00:00
psavola
beefe13fbd Fix some -Wconversion warnings, from Jim Paris. 2008-10-15 05:34:35 +00:00
psavola
731a643ceb Implement privilege separation (Linux only) so that
config_interface() works both with a user and root,
even after HUP signal.  Work by Jim Paris.
2008-01-24 10:03:17 +00:00
psavola
2b72a3e57e Also log an error message instead of just changing the string to "[invalid
string]" if converting the address to presentation format fails.
2006-10-08 19:20:02 +00:00
psavola
35efbb13aa Enhance RDNSS option support: implement bounding to {Min,Max}RtrAdvInterval,
check the contents of RDNSS options heard from other routers.
2006-06-09 11:46:49 +00:00
psavola
c79402edc2 Great cleanup of signed/unsigned values, add
-Wall and a number of other warnings to CFLAGS
by default.  Do not allow signed values for
HomeAgentPreference anymore.
2005-12-30 15:13:11 +00:00
lutchann
55cec7fb38 Replace Nathan's name and email with Pekka's and note maintainership change 2005-10-18 19:17:29 +00:00
psavola
11f7390e08 Support microsecond timestamps, fix delay between following RAs;
from USAGI.
2005-02-15 07:44:06 +00:00
lutchann
c46f557c3d Merged changes from -pX branch into official repository. VERSION changed to 0.7.0. See the radvd-p module for change between 0.6.2 and 0.7.0. 2001-11-14 19:58:10 +00:00
lf
455e79d86f *** empty log message *** 2000-11-26 22:17:10 +00:00
lf
39874fc057 Initial revision 1997-10-14 17:17:40 +00:00