Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224738
b: refs/heads/master
c: ae4694b
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Dec 2, 2010
1 parent cfac83f commit 915d09c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15c054251ab84895ec043e90826612c1a3d6d4f1
refs/heads/master: ae4694b2d3e4c0f47c0e804a68417be57e5daf85
3 changes: 3 additions & 0 deletions trunk/include/net/inet6_connection_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ struct sockaddr;
extern int inet6_csk_bind_conflict(const struct sock *sk,
const struct inet_bind_bucket *tb);

extern struct dst_entry* inet6_csk_route_req(struct sock *sk,
const struct request_sock *req);

extern struct request_sock *inet6_csk_search_req(const struct sock *sk,
struct request_sock ***prevp,
const __be16 rport,
Expand Down
32 changes: 32 additions & 0 deletions trunk/net/ipv6/inet6_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,38 @@ int inet6_csk_bind_conflict(const struct sock *sk,

EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict);

struct dst_entry *inet6_csk_route_req(struct sock *sk,
const struct request_sock *req)
{
struct inet6_request_sock *treq = inet6_rsk(req);
struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *final_p, final;
struct dst_entry *dst;
struct flowi fl;

memset(&fl, 0, sizeof(fl));
fl.proto = IPPROTO_TCP;
ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
final_p = fl6_update_dst(&fl, np->opt, &final);
ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
fl.oif = sk->sk_bound_dev_if;
fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet_rsk(req)->rmt_port;
fl.fl_ip_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, &fl);

if (ip6_dst_lookup(sk, &dst, &fl))
return NULL;

if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p);

if ((xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0)) < 0)
return NULL;

return dst;
}

/*
* request_sock (formerly open request) hash tables.
*/
Expand Down

0 comments on commit 915d09c

Please sign in to comment.