Lines Matching refs:socket_packet
128 struct batadv_socket_packet *socket_packet; in batadv_socket_read() local
146 socket_packet = list_first_entry(&socket_client->queue_list, in batadv_socket_read()
148 list_del(&socket_packet->list); in batadv_socket_read()
153 packet_len = min(count, socket_packet->icmp_len); in batadv_socket_read()
154 error = copy_to_user(buf, &socket_packet->icmp_packet, packet_len); in batadv_socket_read()
156 kfree(socket_packet); in batadv_socket_read()
332 struct batadv_socket_packet *socket_packet; in batadv_socket_add_packet() local
335 socket_packet = kmalloc(sizeof(*socket_packet), GFP_ATOMIC); in batadv_socket_add_packet()
337 if (!socket_packet) in batadv_socket_add_packet()
342 if (len > sizeof(socket_packet->icmp_packet)) in batadv_socket_add_packet()
343 len = sizeof(socket_packet->icmp_packet); in batadv_socket_add_packet()
345 INIT_LIST_HEAD(&socket_packet->list); in batadv_socket_add_packet()
346 memcpy(&socket_packet->icmp_packet, icmph, len); in batadv_socket_add_packet()
347 socket_packet->icmp_len = len; in batadv_socket_add_packet()
356 kfree(socket_packet); in batadv_socket_add_packet()
360 list_add_tail(&socket_packet->list, &socket_client->queue_list); in batadv_socket_add_packet()
364 socket_packet = list_first_entry(&socket_client->queue_list, in batadv_socket_add_packet()
368 list_del(&socket_packet->list); in batadv_socket_add_packet()
369 kfree(socket_packet); in batadv_socket_add_packet()