Skip to content

Commit

Permalink
Use sk_mark for routing lookup in more places
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Oct 7, 2009
1 parent fa857af commit 2d37a18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d37a18

Please sign in to comment.