Lines Matching full:endpoint

21 		 struct endpoint *endpoint, u8 ds, struct dst_cache *cache)  in send4()  argument
24 .saddr = endpoint->src4.s_addr, in send4()
25 .daddr = endpoint->addr4.sin_addr.s_addr, in send4()
26 .fl4_dport = endpoint->addr4.sin_port, in send4()
55 endpoint->src4.s_addr = 0; in send4()
56 endpoint->src_if4 = 0; in send4()
62 if (unlikely(endpoint->src_if4 && ((IS_ERR(rt) && in send4()
64 rt->dst.dev->ifindex != endpoint->src_if4)))) { in send4()
65 endpoint->src4.s_addr = 0; in send4()
66 endpoint->src_if4 = 0; in send4()
77 wg->dev->name, &endpoint->addr, ret); in send4()
98 struct endpoint *endpoint, u8 ds, struct dst_cache *cache) in send6() argument
102 .saddr = endpoint->src6, in send6()
103 .daddr = endpoint->addr6.sin6_addr, in send6()
104 .fl6_dport = endpoint->addr6.sin6_port, in send6()
106 .flowi6_oif = endpoint->addr6.sin6_scope_id, in send6()
135 endpoint->src6 = fl.saddr = in6addr_any; in send6()
144 wg->dev->name, &endpoint->addr, ret); in send6()
174 if (peer->endpoint.addr.sa_family == AF_INET) in wg_socket_send_skb_to_peer()
175 ret = send4(peer->device, skb, &peer->endpoint, ds, in wg_socket_send_skb_to_peer()
177 else if (peer->endpoint.addr.sa_family == AF_INET6) in wg_socket_send_skb_to_peer()
178 ret = send6(peer->device, skb, &peer->endpoint, ds, in wg_socket_send_skb_to_peer()
209 struct endpoint endpoint; in wg_socket_send_buffer_as_reply_to_skb() local
213 ret = wg_socket_endpoint_from_skb(&endpoint, in_skb); in wg_socket_send_buffer_as_reply_to_skb()
224 if (endpoint.addr.sa_family == AF_INET) in wg_socket_send_buffer_as_reply_to_skb()
225 ret = send4(wg, skb, &endpoint, 0, NULL); in wg_socket_send_buffer_as_reply_to_skb()
226 else if (endpoint.addr.sa_family == AF_INET6) in wg_socket_send_buffer_as_reply_to_skb()
227 ret = send6(wg, skb, &endpoint, 0, NULL); in wg_socket_send_buffer_as_reply_to_skb()
228 /* No other possibilities if the endpoint is valid, which it is, in wg_socket_send_buffer_as_reply_to_skb()
235 int wg_socket_endpoint_from_skb(struct endpoint *endpoint, in wg_socket_endpoint_from_skb() argument
238 memset(endpoint, 0, sizeof(*endpoint)); in wg_socket_endpoint_from_skb()
240 endpoint->addr4.sin_family = AF_INET; in wg_socket_endpoint_from_skb()
241 endpoint->addr4.sin_port = udp_hdr(skb)->source; in wg_socket_endpoint_from_skb()
242 endpoint->addr4.sin_addr.s_addr = ip_hdr(skb)->saddr; in wg_socket_endpoint_from_skb()
243 endpoint->src4.s_addr = ip_hdr(skb)->daddr; in wg_socket_endpoint_from_skb()
244 endpoint->src_if4 = skb->skb_iif; in wg_socket_endpoint_from_skb()
246 endpoint->addr6.sin6_family = AF_INET6; in wg_socket_endpoint_from_skb()
247 endpoint->addr6.sin6_port = udp_hdr(skb)->source; in wg_socket_endpoint_from_skb()
248 endpoint->addr6.sin6_addr = ipv6_hdr(skb)->saddr; in wg_socket_endpoint_from_skb()
249 endpoint->addr6.sin6_scope_id = ipv6_iface_scope_id( in wg_socket_endpoint_from_skb()
251 endpoint->src6 = ipv6_hdr(skb)->daddr; in wg_socket_endpoint_from_skb()
258 static bool endpoint_eq(const struct endpoint *a, const struct endpoint *b) in endpoint_eq()
274 const struct endpoint *endpoint) in wg_socket_set_peer_endpoint() argument
277 * that an endpoint will change. If we happen to be mid-write, and two in wg_socket_set_peer_endpoint()
281 if (endpoint_eq(endpoint, &peer->endpoint)) in wg_socket_set_peer_endpoint()
284 if (endpoint->addr.sa_family == AF_INET) { in wg_socket_set_peer_endpoint()
285 peer->endpoint.addr4 = endpoint->addr4; in wg_socket_set_peer_endpoint()
286 peer->endpoint.src4 = endpoint->src4; in wg_socket_set_peer_endpoint()
287 peer->endpoint.src_if4 = endpoint->src_if4; in wg_socket_set_peer_endpoint()
288 } else if (IS_ENABLED(CONFIG_IPV6) && endpoint->addr.sa_family == AF_INET6) { in wg_socket_set_peer_endpoint()
289 peer->endpoint.addr6 = endpoint->addr6; in wg_socket_set_peer_endpoint()
290 peer->endpoint.src6 = endpoint->src6; in wg_socket_set_peer_endpoint()
302 struct endpoint endpoint; in wg_socket_set_peer_endpoint_from_skb() local
304 if (!wg_socket_endpoint_from_skb(&endpoint, skb)) in wg_socket_set_peer_endpoint_from_skb()
305 wg_socket_set_peer_endpoint(peer, &endpoint); in wg_socket_set_peer_endpoint_from_skb()
311 memset(&peer->endpoint.src6, 0, sizeof(peer->endpoint.src6)); in wg_socket_clear_peer_endpoint_src()