Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82862742 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8451725
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
	struct sk_buff *skb;
	int err;

	sock_update_classid(sk);

	/* Under a page?  Don't bother with paged skb. */
	if (prepad + len < PAGE_SIZE || !linear)
		linear = len;
+1 −0
Original line number Diff line number Diff line
@@ -1064,6 +1064,7 @@ void sock_update_classid(struct sock *sk)
	if (classid && classid != sk->sk_classid)
		sk->sk_classid = classid;
}
EXPORT_SYMBOL(sock_update_classid);
#endif

/**