Commit ffce9082 authored by Atis Elsts's avatar Atis Elsts Committed by David S. Miller

net: Add sk_mark route lookup support for IPv4 listening sockets

Add support for route lookup using sk_mark on IPv4 listening sockets.
Signed-off-by: default avatarAtis Elsts <atis@mikrotik.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 996ccf49
...@@ -358,6 +358,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, ...@@ -358,6 +358,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
const struct inet_request_sock *ireq = inet_rsk(req); const struct inet_request_sock *ireq = inet_rsk(req);
struct ip_options *opt = inet_rsk(req)->opt; struct ip_options *opt = inet_rsk(req)->opt;
struct flowi fl = { .oif = sk->sk_bound_dev_if, struct flowi fl = { .oif = sk->sk_bound_dev_if,
.mark = sk->sk_mark,
.nl_u = { .ip4_u = .nl_u = { .ip4_u =
{ .daddr = ((opt && opt->srr) ? { .daddr = ((opt && opt->srr) ?
opt->faddr : opt->faddr :
......
...@@ -333,7 +333,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, ...@@ -333,7 +333,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
* no easy way to do this. * no easy way to do this.
*/ */
{ {
struct flowi fl = { .nl_u = { .ip4_u = struct flowi fl = { .mark = sk->sk_mark,
.nl_u = { .ip4_u =
{ .daddr = ((opt && opt->srr) ? { .daddr = ((opt && opt->srr) ?
opt->faddr : opt->faddr :
ireq->rmt_addr), ireq->rmt_addr),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment