summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network/test-dhcp-option.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.