Lines Matching refs:endpoint

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