Use sk_mark for routing lookup in more places
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 1 Oct 2009 19:14:46 +0000 (19:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2009 08:07:38 +0000 (01:07 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c

index d398a9bf690314ec92b98f292b55863cbbc61897..efc1174af7169a8eff2d7d89e576daf8c8e0e918 100644 (file)
@@ -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;
 
@@ -884,6 +885,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) {
@@ -1153,6 +1155,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