Skip to content

Commit 8286274

Browse files
herbertxdavem330
authored andcommitted
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: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f845172 commit 8286274

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/net/tun.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
526526
struct sk_buff *skb;
527527
int err;
528528

529+
sock_update_classid(sk);
530+
529531
/* Under a page? Don't bother with paged skb. */
530532
if (prepad + len < PAGE_SIZE || !linear)
531533
linear = len;

‎net/core/sock.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ void sock_update_classid(struct sock *sk)
10641064
if (classid && classid != sk->sk_classid)
10651065
sk->sk_classid = classid;
10661066
}
1067+
EXPORT_SYMBOL(sock_update_classid);
10671068
#endif
10681069

10691070
/**

0 commit comments

Comments
 (0)