38 #include <linux/slab.h>
40 #include <linux/module.h>
76 init_completion(&client->
comp);
94 const unsigned char *dst_dev_addr)
132 #if IS_ENABLED(CONFIG_IPV6)
151 static void set_timeout(
unsigned long time)
156 if ((
long)delay <= 0)
172 list_add(&req->
list, &temp_req->
list);
174 if (req_list.next == &req->
list)
184 n = dst_neigh_lookup(dst, daddr);
189 neigh_event_send(n,
NULL);
202 static int addr4_resolve(
struct sockaddr_in *src_in,
212 memset(&fl4, 0,
sizeof(fl4));
216 rt = ip_route_output_key(&
init_net, &fl4);
222 src_in->
sin_addr.s_addr = fl4.saddr;
237 ret = dst_fetch_ha(&rt->
dst, addr, &fl4.daddr);
244 #if IS_ENABLED(CONFIG_IPV6)
253 memset(&fl6, 0,
sizeof fl6);
259 if ((ret = dst->
error))
262 if (ipv6_addr_any(&fl6.saddr)) {
264 &fl6.daddr, 0, &fl6.saddr);
285 ret = dst_fetch_ha(dst, addr, &fl6.daddr);
299 static int addr_resolve(
struct sockaddr *src_in,
304 return addr4_resolve((
struct sockaddr_in *) src_in,
317 INIT_LIST_HEAD(&done_list);
324 req->
status = addr_resolve(src_in, dst_in, req->
addr);
330 list_move_tail(&req->
list, &done_list);
333 if (!list_empty(&req_list)) {
372 memcpy(src_in, src_addr, ip_addr_size(src_addr));
377 memcpy(dst_in, dst_addr, ip_addr_size(dst_addr));
384 req->
status = addr_resolve(src_in, dst_in, addr);
412 if (req->
addr == addr) {
415 list_move(&req->
list, &req_list);
431 set_timeout(jiffies);
438 .notifier_call = netevent_callback
441 static int __init addr_init(
void)
451 static void __exit addr_cleanup(
void)