summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/test-dhcp-option.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: always call test_setup_logging()Yu Watanabe2023-11-171-0/+3
|
* dhcp: split dhcp-internal.h into twoYu Watanabe2023-10-201-2/+3
|
* tree-wide: Fix format specifier warnings for %xJan Janssen2022-08-301-2/+2
| | | | | | Unfortunately, hex output can only be produced with unsigned types. Some cases can be fixed by producing the correct type, but a few simply have to be cast. At least casting makes it explicit.
* tree-wide: add a space after if, switch, for, and whileYu Watanabe2022-04-011-2/+2
|
* sd-dhcp-client,sd-dhcp-client-server: set chaddr in dhcp_message_init()Yu Watanabe2022-01-231-1/+2
| | | | | And also set chaddr and hlen for packets on non-Ethernet interfaces, except for InfiniBand.
* test-dhcp-option: inline iterator variable declarationsZbigniew Jędrzejewski-Szmek2021-12-081-12/+8
|
* test-dhcp-option: rename variable to avoid global/local name conflictZbigniew Jędrzejewski-Szmek2021-12-081-11/+11
| | | | | | CodeQL was complaining that the local variable obscurs the global one. It is indeed a bit confusing when reading this… Let's rename the variable to avoid confusing the reader.
* test: use assert_se() instead of assert()Yu Watanabe2021-10-121-1/+1
|
* rfc3046 implementationYegor Alexeyev2021-05-081-0/+15
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* sd-dhcp: clean-up of DHCP lease server codeLennart Poettering2020-05-301-0/+3
| | | | | | | | | | | | | | | | | | This is an attempt to clean-up the DHCP lease server type code a bit. We now strictly use the same enum everywhere, and store server info in an array. Moreover, we use the same nomenclature everywhere. This only makes the changes in the sd-dhcp code. The networkd code is untouched so far (but should be fixed up like this too. But it's more complicated since this would then touch actual settings in .network files). Note that this also changes some field names in serialized lease files. But given that these field names have not been part of a released version of systemd yet, such a change should be ok. This is pure renaming/refactoring, shouldn't actually change any behaviour.
* util: split out memcmp()/memset() related calls into memory-util.[ch]Lennart Poettering2019-03-131-1/+1
| | | | Just some source rearranging.
* Merge pull request #2589 from keszybz/resolve-tool-2Lennart Poettering2016-02-131-8/+3
|\ | | | | Better support of OPENPGPKEY, CAA, TLSA packets and tests
| * Add memcpy_safeZbigniew Jędrzejewski-Szmek2016-02-111-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISO/IEC 9899:1999 §7.21.1/2 says: Where an argument declared as size_t n specifies the length of the array for a function, n can have the value zero on a call to that function. Unless explicitly stated otherwise in the description of a particular function in this subclause, pointer arguments on such a call shall still have valid values, as described in 7.1.4. In base64_append_width memcpy was called as memcpy(x, NULL, 0). GCC 4.9 started making use of this and assumes This worked fine under -O0, but does something strange under -O3. This patch fixes a bug in base64_append_width(), fixes a possible bug in journal_file_append_entry_internal(), and makes use of the new function to simplify the code in other places.
* | tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
|/ | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* dhcp: make DHCP_OPTION_* enum publicBeniamino Galvani2016-01-201-22/+22
| | | | | | | | libsystemd-network provides the public function sd_dhcp_client_set_request_option() to enable the request of a given DHCP option. However the enum defining such options is defined in the internal header dhcp-protocol.h. Move the enum definition to the public header sd-dhcp-client.h and properly namespace values.
* sd-dhcp: parse error message in DECLINE or NAKTom Gundersen2015-11-251-15/+7
| | | | | | If a client sends a DECLINE or a server sends a NAK, they can include a string with a message to explain the error. Parse this and print it at debug level.
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-2/+2
| | | | Sort the includes accoding to the new coding style.
* util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering2015-10-271-4/+4
|
* dhcp: generic data should be void*, not uint8_t*Lennart Poettering2015-08-261-3/+3
| | | | | If we handly arbitrary data we should use "void*" pointers, not "uint8_t*", how go intended C to be used.
* network: s/user_data/userdata/Lennart Poettering2015-08-261-2/+2
| | | | | Everywhere else we call the generic user data pointer just "userdata", rather than "user_data". Let's do this here, too.
* test-dhcp-option: conform to usual coding styleZbigniew Jędrzejewski-Szmek2015-03-141-20/+11
|
* test-dhcp-option: add assert to check index is nonnegativeZbigniew Jędrzejewski-Szmek2015-03-141-0/+2
| | | | CID #1237623.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-1/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* use correct format typesThomas Hindoe Paaboel Andersen2014-12-111-2/+2
|
* sd-dhcp-client: support non-Ethernet hardware addressesDan Williams2014-10-111-1/+1
| | | | | | | Like Infiniband. See RFC 4390 section 2.1 for details on DHCP and Infiniband; chaddr is zeroed, hlen is set to 0, and htype is set to ARPHRD_INFINIBAND because IB hardware addresses are 20 bytes in length.
* libsystemd-network: dhcp-test - assert that malloc0 succeedsTom Gundersen2014-09-171-0/+1
| | | | | | Otherwise we would get a nullptr dereference later on. Found by coverity. Fixes CID #1237655.
* sd-dhcp: fix test of magic cookieThomas Hindoe Paaboel Andersen2014-09-141-3/+3
| | | | | | | The magic cookie is set in dhcp_message_init. Test the magic cookie value intead of writing the last 3/4 of it directly. Found with Coverity. Fixes: CID#1237732 CID#1237734 CID#1237735
* test-dhcp-option: fix memleakTom Gundersen2014-05-261-1/+1
|
* sd-dhcp: option_append - support falling back to 'sname' and 'file'Tom Gundersen2014-05-211-18/+44
|
* sd-dhcp: make sure we can not fill options so much that there is no space ↵Tom Gundersen2014-05-211-1/+1
| | | | for END
* sd-dhcp: refactor dhcp_option_appendTom Gundersen2014-05-201-37/+21
| | | | | | | | | | | | | Store a pointer to the options in the DHCPMessage struct, and pass this together with an offset around, rather than a uint8_t**. This avoids us having to (re)compute the pointer; and changes dhcp_option_append from adjusting both the pointer to the next option and the remaining size of the options, to just adjusting the current offset. This makes the code a bit simpler to follow IMHO, but there should be no functional change.
* sd-dhcp-client: test - fix for jenkinsTom Gundersen2014-04-101-23/+24
| | | | | | This test should have been updated when changing the magic cookie handling around. Reported by Ken MacLeod.
* sd-network: add new libraryTom Gundersen2014-02-281-0/+378
This is similar to sd-login, but exposes the state of networkd rather than logind. Include it in libsystemd-dhcp and rename it to libsystemd-network.