提交 82862742 编写于 作者: H Herbert Xu 提交者: David S. Miller

tun: Update classid on packet injection

This patch makes tun update its socket classid every time we
inject a packet into the network stack.  This is so that any
updates made by the admin to the process writing packets to
tun is effected.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f8451725
...@@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun, ...@@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
struct sk_buff *skb; struct sk_buff *skb;
int err; int err;
sock_update_classid(sk);
/* Under a page? Don't bother with paged skb. */ /* Under a page? Don't bother with paged skb. */
if (prepad + len < PAGE_SIZE || !linear) if (prepad + len < PAGE_SIZE || !linear)
linear = len; linear = len;
......
...@@ -1064,6 +1064,7 @@ void sock_update_classid(struct sock *sk) ...@@ -1064,6 +1064,7 @@ void sock_update_classid(struct sock *sk)
if (classid && classid != sk->sk_classid) if (classid && classid != sk->sk_classid)
sk->sk_classid = classid; sk->sk_classid = classid;
} }
EXPORT_SYMBOL(sock_update_classid);
#endif #endif
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册