]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: drop unused data in sd_dhcp_client 42138/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 3 May 2026 05:50:13 +0000 (14:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 13:44:17 +0000 (22:44 +0900)
With the previous commit, now sd_dhcp_client.link is not used anymore.
Let's drop it.

src/libsystemd-network/dhcp-client-internal.h
src/libsystemd-network/fuzz-dhcp-client.c
src/libsystemd-network/test-dhcp-client.c

index ccae831284326e541a0d02aff77b050b804530bf..bd9308e2d1d78f3da03582af143a0cc75e57fbc5 100644 (file)
@@ -44,7 +44,6 @@ struct sd_dhcp_client {
 
         uint16_t port;
         uint16_t server_port;
-        union sockaddr_union link;
         sd_event_source *receive_message;
         bool request_broadcast;
         Set *req_opts;
index ad289754ed1cd378a4b3e94aa79a3f4cd438d583..0737e0c2cd9b84ca88a820bae297dc4e1946be48 100644 (file)
@@ -40,17 +40,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         ASSERT_OK_ERRNO(socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, socket_fd));
         client->socket_fd = TAKE_FD(socket_fd[0]);
 
-        /* Set a fake socket address, as the client will never call dhcp_network_bind_raw_socket() when
-         * socket_fd is set. */
-        client->link.ll = (struct sockaddr_ll) {
-                .sll_family = AF_PACKET,
-                .sll_protocol = htobe16(ETH_P_IP),
-                .sll_ifindex = 42,
-                .sll_hatype = ARPHRD_ETHER,
-                .sll_halen = bcast_addr.length,
-        };
-        memcpy(client->link.ll.sll_addr, bcast_addr.bytes, bcast_addr.length);
-
         ASSERT_OK(sd_dhcp_client_attach_event(client, e, /* priority= */ 0));
 
         ASSERT_OK(sd_dhcp_client_set_ifindex(client, 42));
index 5407ccb0b3208542b83d15744c47eb85d0949db9..2098470becbcd247b2a952f6388f1f75b7796a95 100644 (file)
@@ -82,17 +82,6 @@ static void setup(sd_event_io_handler_t io_handler, sd_dhcp_client_callback_t cl
 
         client->socket_fd = TAKE_FD(socket_fd[0]);
 
-        /* Set a fake socket address, as the client will never call dhcp_network_bind_raw_socket() when
-         * socket_fd is set. */
-        client->link.ll = (struct sockaddr_ll) {
-                .sll_family = AF_PACKET,
-                .sll_protocol = htobe16(ETH_P_IP),
-                .sll_ifindex = 42,
-                .sll_hatype = ARPHRD_ETHER,
-                .sll_halen = bcast_addr.length,
-        };
-        memcpy(client->link.ll.sll_addr, bcast_addr.bytes, bcast_addr.length);
-
         ASSERT_OK(sd_dhcp_client_attach_event(client, e, SD_EVENT_PRIORITY_NORMAL));
         ASSERT_OK(sd_dhcp_client_set_ifindex(client, 42));
         ASSERT_OK(sd_dhcp_client_set_mac(client, hw_addr.bytes, bcast_addr.bytes, hw_addr.length, ARPHRD_ETHER));