* [PATCH] Use sk_mark for routing lookup in more places
@ 2009-10-01 15:14 Atis Elsts
2009-10-01 16:30 ` Eric Dumazet
0 siblings, 1 reply; 12+ messages in thread
From: Atis Elsts @ 2009-10-01 15:14 UTC (permalink / raw)
To: Laszlo Attila Toth; +Cc: David S. Miller, netdev
This patch against v2.6.31 adds support for route lookup using sk_mark in some
more places. The benefits from this patch are the following.
First, SO_MARK option now has effect on UDP sockets too.
Second, ip_queue_xmit() and inet_sk_rebuild_header() could fail to do routing
lookup correctly if TCP sockets with SO_MARK were used.
Signed-off-by: Atis Elsts <atis@mikrotik.com>
---
net/ipv4/af_inet.c | 1 +
net/ipv4/ip_output.c | 1 +
net/ipv4/udp.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 566ea6c..7917963 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1103,6 +1103,7 @@ int inet_sk_rebuild_header(struct sock *sk)
{
struct flowi fl = {
.oif = sk->sk_bound_dev_if,
+ .mark = sk->sk_mark,
.nl_u = {
.ip4_u = {
.daddr = daddr,
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 7ffcd96..e088a97 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -335,6 +335,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
{
struct flowi fl = { .oif = sk->sk_bound_dev_if,
+ .mark = sk->sk_mark,
.nl_u = { .ip4_u =
{ .daddr = daddr,
.saddr = inet->saddr,
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 80e3812..f90cdcc 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -688,6 +688,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg,
if (rt == NULL) {
struct flowi fl = { .oif = ipc.oif,
+ .mark = sk->sk_mark,
.nl_u = { .ip4_u =
{ .daddr = faddr,
.saddr = saddr,
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-01 15:14 [PATCH] Use sk_mark for routing lookup in more places Atis Elsts
@ 2009-10-01 16:30 ` Eric Dumazet
2009-10-01 22:18 ` David Miller
0 siblings, 1 reply; 12+ messages in thread
From: Eric Dumazet @ 2009-10-01 16:30 UTC (permalink / raw)
To: Atis Elsts; +Cc: Laszlo Attila Toth, David S. Miller, netdev
Atis Elsts a écrit :
> This patch against v2.6.31 adds support for route lookup using sk_mark in some
> more places. The benefits from this patch are the following.
> First, SO_MARK option now has effect on UDP sockets too.
> Second, ip_queue_xmit() and inet_sk_rebuild_header() could fail to do routing
> lookup correctly if TCP sockets with SO_MARK were used.
>
> Signed-off-by: Atis Elsts <atis@mikrotik.com>
Good catch, thanks !
I used SO_MARK on connected UDP sockets so did not notice the lack
of functionality. (ip_route_connect() does use sk->sk_mark)
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> net/ipv4/af_inet.c | 1 +
> net/ipv4/ip_output.c | 1 +
> net/ipv4/udp.c | 1 +
> 3 files changed, 3 insertions(+)
>
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 566ea6c..7917963 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -1103,6 +1103,7 @@ int inet_sk_rebuild_header(struct sock *sk)
> {
> struct flowi fl = {
> .oif = sk->sk_bound_dev_if,
> + .mark = sk->sk_mark,
> .nl_u = {
> .ip4_u = {
> .daddr = daddr,
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index 7ffcd96..e088a97 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -335,6 +335,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
>
> {
> struct flowi fl = { .oif = sk->sk_bound_dev_if,
> + .mark = sk->sk_mark,
> .nl_u = { .ip4_u =
> { .daddr = daddr,
> .saddr = inet->saddr,
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 80e3812..f90cdcc 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -688,6 +688,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
> struct msghdr *msg,
>
> if (rt == NULL) {
> struct flowi fl = { .oif = ipc.oif,
> + .mark = sk->sk_mark,
> .nl_u = { .ip4_u =
> { .daddr = faddr,
> .saddr = saddr,
> --
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-01 16:30 ` Eric Dumazet
@ 2009-10-01 22:18 ` David Miller
2009-10-02 5:14 ` Eric Dumazet
0 siblings, 1 reply; 12+ messages in thread
From: David Miller @ 2009-10-01 22:18 UTC (permalink / raw)
To: eric.dumazet; +Cc: atis, panther, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 01 Oct 2009 18:30:06 +0200
> Atis Elsts a écrit :
>> This patch against v2.6.31 adds support for route lookup using sk_mark in some
>> more places. The benefits from this patch are the following.
>> First, SO_MARK option now has effect on UDP sockets too.
>> Second, ip_queue_xmit() and inet_sk_rebuild_header() could fail to do routing
>> lookup correctly if TCP sockets with SO_MARK were used.
>>
>> Signed-off-by: Atis Elsts <atis@mikrotik.com>
>
> Good catch, thanks !
>
> I used SO_MARK on connected UDP sockets so did not notice the lack
> of functionality. (ip_route_connect() does use sk->sk_mark)
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks.
But Atis, your patch was whitespace corrupted by your email
client so I had to apply your patch by hand. Please correct
this problem before submitting future patches, thank you.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-01 22:18 ` David Miller
@ 2009-10-02 5:14 ` Eric Dumazet
2009-10-02 6:08 ` Eric Dumazet
2009-10-07 8:27 ` [PATCH] Use sk_mark for routing lookup in more places David Miller
0 siblings, 2 replies; 12+ messages in thread
From: Eric Dumazet @ 2009-10-02 5:14 UTC (permalink / raw)
To: David Miller; +Cc: atis, panther, netdev
Here is a followup on this area, thanks.
[RFC] af_packet: fill skb->mark at xmit
skb->mark may be used by classifiers, so fill it in case user
set a SO_MARK option on socket.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/packet/af_packet.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index d7ecca0..610f150 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -490,6 +490,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
skb->protocol = proto;
skb->dev = dev;
skb->priority = sk->sk_priority;
+ skb->mark = sk->sk_mark;
if (err)
goto out_free;
@@ -856,6 +857,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
skb->protocol = proto;
skb->dev = dev;
skb->priority = po->sk.sk_priority;
+ skb->mark = po->sk.sk_mark;
skb_shinfo(skb)->destructor_arg = ph.raw;
switch (po->tp_version) {
@@ -1125,6 +1127,7 @@ static int packet_snd(struct socket *sock,
skb->protocol = proto;
skb->dev = dev;
skb->priority = sk->sk_priority;
+ skb->mark = sk->sk_mark;
/*
* Now send it
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-02 5:14 ` Eric Dumazet
@ 2009-10-02 6:08 ` Eric Dumazet
2009-10-02 17:25 ` Maciej Żenczykowski
2009-10-07 8:27 ` [PATCH] Use sk_mark for routing lookup in more places David Miller
1 sibling, 1 reply; 12+ messages in thread
From: Eric Dumazet @ 2009-10-02 6:08 UTC (permalink / raw)
Cc: David Miller, atis, panther, netdev
Eric Dumazet a écrit :
> Here is a followup on this area, thanks.
>
> [RFC] af_packet: fill skb->mark at xmit
>
> skb->mark may be used by classifiers, so fill it in case user
> set a SO_MARK option on socket.
>
Maybe a more generic way to handle this for various protocols
would be to fill skb->mark in sock_alloc_send_pskb()
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-02 6:08 ` Eric Dumazet
@ 2009-10-02 17:25 ` Maciej Żenczykowski
2009-10-02 18:00 ` David Miller
2009-10-02 18:19 ` [PATCH] Use sk_mark for IPv6 routing lookups Brian Haley
0 siblings, 2 replies; 12+ messages in thread
From: Maciej Żenczykowski @ 2009-10-02 17:25 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, atis, panther, netdev
Cool!
As I've already pointed out in a post 2 or so weeks ago, we need the
exact same treatment in a ton of places throughout the code (tcp,
ipv6, decnet, etc...).
Maybe it would make more sense to create some constructor-like
functions for the flowi struct?
On Thu, Oct 1, 2009 at 23:08, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Eric Dumazet a écrit :
>> Here is a followup on this area, thanks.
>>
>> [RFC] af_packet: fill skb->mark at xmit
>>
>> skb->mark may be used by classifiers, so fill it in case user
>> set a SO_MARK option on socket.
>>
>
> Maybe a more generic way to handle this for various protocols
> would be to fill skb->mark in sock_alloc_send_pskb()
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-02 17:25 ` Maciej Żenczykowski
@ 2009-10-02 18:00 ` David Miller
2009-10-02 18:19 ` [PATCH] Use sk_mark for IPv6 routing lookups Brian Haley
1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2009-10-02 18:00 UTC (permalink / raw)
To: zenczykowski; +Cc: eric.dumazet, atis, panther, netdev
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Fri, 2 Oct 2009 10:25:13 -0700
> Maybe it would make more sense to create some constructor-like
> functions for the flowi struct?
Maybe just an initializer like "FLOWI_SOCK(sk)" or similar.
So you can say:
struct flowi fl = FLOWI_SOCK(sk);
But the thing is we usually want to initialize all of the
details in one go, so we'd need a very messy macro for this
that would take many arguments.
It's important to use an initializer rather than assignments in some
inline function so that GCC can better coalesce many small members
into since large stores to the stack. It doesn't do this as well with
real assignment statements.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] Use sk_mark for IPv6 routing lookups
2009-10-02 17:25 ` Maciej Żenczykowski
2009-10-02 18:00 ` David Miller
@ 2009-10-02 18:19 ` Brian Haley
2009-10-05 12:55 ` Atis Elsts
2009-10-07 8:29 ` David Miller
1 sibling, 2 replies; 12+ messages in thread
From: Brian Haley @ 2009-10-02 18:19 UTC (permalink / raw)
To: Maciej Żenczykowski
Cc: Eric Dumazet, David Miller, atis, panther, netdev
Maciej Żenczykowski wrote:
> Cool!
>
> As I've already pointed out in a post 2 or so weeks ago, we need the
> exact same treatment in a ton of places throughout the code (tcp,
> ipv6, decnet, etc...).
Here's a try at the IPv6 part...
Add support for IPv6 route lookups using sk_mark.
Signed-off-by: Brian Haley <brian.haley@hp.com>
---
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index e2bdc6d..a615b4d 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -147,6 +147,7 @@ ipv4_connected:
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index cc4797d..a9f4a21 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -194,6 +194,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
fl.fl6_flowlabel = np->flow_label;
IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_sport = inet->sport;
fl.fl_ip_dport = inet->dport;
security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 7161539..d98df54 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1523,6 +1523,7 @@ static int ip6mr_forward2(struct sk_buff *skb, struct mfc6_cache *c, int vifi)
fl = (struct flowi) {
.oif = vif->link,
+ .mark = skb->mark,
.nl_u = { .ip6_u =
{ .daddr = ipv6h->daddr, }
}
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 14f54eb..dc0f736 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -424,6 +424,7 @@ sticky_done:
fl.fl6_flowlabel = 0;
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
if (optlen == 0)
goto update;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index dbd19a7..03a64c1 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -629,6 +629,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
.saddr = tiph->saddr,
.tos = RT_TOS(tos) } },
.oif = tunnel->parms.link,
+ .mark = skb->mark,
.proto = IPPROTO_IPV6 };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
stats->tx_carrier_errors++;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 21d100b..321aafd 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -243,6 +243,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
ipv6_addr_copy(&fl.fl6_src,
(saddr ? saddr : &np->saddr));
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = usin->sin6_port;
fl.fl_ip_sport = inet->sport;
@@ -383,6 +384,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
security_skb_classify_flow(skb, &fl);
@@ -477,6 +479,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req)
ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
fl.fl6_flowlabel = 0;
fl.oif = treq->iif;
+ 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);
@@ -1345,6 +1348,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
}
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);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3a60f12..3842c55 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -879,6 +879,8 @@ do_udp_sendmsg:
if (!fl.oif)
fl.oif = np->sticky_pktinfo.ipi6_ifindex;
+ fl.mark = sk->sk_mark;
+
if (msg->msg_controllen) {
opt = &opt_space;
memset(opt, 0, sizeof(struct ipv6_txoptions));
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for IPv6 routing lookups
2009-10-02 18:19 ` [PATCH] Use sk_mark for IPv6 routing lookups Brian Haley
@ 2009-10-05 12:55 ` Atis Elsts
2009-10-05 18:24 ` Brian Haley
2009-10-07 8:29 ` David Miller
1 sibling, 1 reply; 12+ messages in thread
From: Atis Elsts @ 2009-10-05 12:55 UTC (permalink / raw)
To: Brian Haley; +Cc: Maciej Żenczykowski, Eric Dumazet, David Miller, netdev
On Friday 02 October 2009 21:19:05 Brian Haley wrote:
> Maciej Żenczykowski wrote:
> > Cool!
> >
> > As I've already pointed out in a post 2 or so weeks ago, we need the
> > exact same treatment in a ton of places throughout the code (tcp,
> > ipv6, decnet, etc...).
>
> Here's a try at the IPv6 part...
>
>
> Add support for IPv6 route lookups using sk_mark.
>
Not sure if there is need to fill the mark from skb in tunnel xmit functions. In any case, it's not done for GRE or IPIP tunnels at the moment.
Also, in this patch you are doing that for SIT (v6-in-v4) tunnels only, and not doing it for v4-in-v6 or v6-in-v6 tunnels. Any reason for that?
Atis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for IPv6 routing lookups
2009-10-05 12:55 ` Atis Elsts
@ 2009-10-05 18:24 ` Brian Haley
0 siblings, 0 replies; 12+ messages in thread
From: Brian Haley @ 2009-10-05 18:24 UTC (permalink / raw)
To: Atis Elsts; +Cc: Maciej Żenczykowski, Eric Dumazet, David Miller, netdev
Atis Elsts wrote:
> Not sure if there is need to fill the mark from skb in tunnel xmit functions. In any case, it's not done for GRE or IPIP tunnels at the moment.
Ok, I'll just drop that part, I'm not sure what should be done in this case.
> Also, in this patch you are doing that for SIT (v6-in-v4) tunnels only, and not doing it for v4-in-v6 or v6-in-v6 tunnels. Any reason for that?
I just sent that patch out too quickly, here's a better one with the updates.
Add support for IPv6 route lookups using sk_mark.
Signed-off-by: Brian Haley <brian.haley@hp.com>
---
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e127a32..da36497 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -654,6 +654,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.fl6_flowlabel = np->flow_label;
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index e2bdc6d..a615b4d 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -147,6 +147,7 @@ ipv4_connected:
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index cc4797d..a9f4a21 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -194,6 +194,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
fl.fl6_flowlabel = np->flow_label;
IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_sport = inet->sport;
fl.fl_ip_dport = inet->dport;
security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 14f54eb..dc0f736 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -424,6 +424,7 @@ sticky_done:
fl.fl6_flowlabel = 0;
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
if (optlen == 0)
goto update;
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 6b6ae91..cbe55e5 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -252,6 +252,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
}
ipv6_addr_copy(&fl.fl6_src, &ireq6->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_sk(sk)->sport;
security_req_classify_flow(req, &fl);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 21d100b..321aafd 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -243,6 +243,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
ipv6_addr_copy(&fl.fl6_src,
(saddr ? saddr : &np->saddr));
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = usin->sin6_port;
fl.fl_ip_sport = inet->sport;
@@ -383,6 +384,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
security_skb_classify_flow(skb, &fl);
@@ -477,6 +479,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req)
ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
fl.fl6_flowlabel = 0;
fl.oif = treq->iif;
+ 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);
@@ -1345,6 +1348,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
}
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);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3a60f12..3842c55 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -879,6 +879,8 @@ do_udp_sendmsg:
if (!fl.oif)
fl.oif = np->sticky_pktinfo.ipi6_ifindex;
+ fl.mark = sk->sk_mark;
+
if (msg->msg_controllen) {
opt = &opt_space;
memset(opt, 0, sizeof(struct ipv6_txoptions));
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for routing lookup in more places
2009-10-02 5:14 ` Eric Dumazet
2009-10-02 6:08 ` Eric Dumazet
@ 2009-10-07 8:27 ` David Miller
1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2009-10-07 8:27 UTC (permalink / raw)
To: eric.dumazet; +Cc: atis, panther, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 02 Oct 2009 07:14:46 +0200
> Here is a followup on this area, thanks.
>
> [RFC] af_packet: fill skb->mark at xmit
>
> skb->mark may be used by classifiers, so fill it in case user
> set a SO_MARK option on socket.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Looks fine, applied, thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Use sk_mark for IPv6 routing lookups
2009-10-02 18:19 ` [PATCH] Use sk_mark for IPv6 routing lookups Brian Haley
2009-10-05 12:55 ` Atis Elsts
@ 2009-10-07 8:29 ` David Miller
1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2009-10-07 8:29 UTC (permalink / raw)
To: brian.haley; +Cc: zenczykowski, eric.dumazet, atis, panther, netdev
From: Brian Haley <brian.haley@hp.com>
Date: Fri, 02 Oct 2009 14:19:05 -0400
> Add support for IPv6 route lookups using sk_mark.
>
> Signed-off-by: Brian Haley <brian.haley@hp.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-10-07 8:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 15:14 [PATCH] Use sk_mark for routing lookup in more places Atis Elsts
2009-10-01 16:30 ` Eric Dumazet
2009-10-01 22:18 ` David Miller
2009-10-02 5:14 ` Eric Dumazet
2009-10-02 6:08 ` Eric Dumazet
2009-10-02 17:25 ` Maciej Żenczykowski
2009-10-02 18:00 ` David Miller
2009-10-02 18:19 ` [PATCH] Use sk_mark for IPv6 routing lookups Brian Haley
2009-10-05 12:55 ` Atis Elsts
2009-10-05 18:24 ` Brian Haley
2009-10-07 8:29 ` David Miller
2009-10-07 8:27 ` [PATCH] Use sk_mark for routing lookup in more places David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).