Skip to content

Commit c5dab09

Browse files
julianwiedmannkuba-moo
authored andcommitted
net/af_iucv: set correct sk_protocol for child sockets
Child sockets erroneously inherit their parent's sk_type (ie. SOCK_*), instead of the PF_IUCV protocol that the parent was created with in iucv_sock_create(). We're currently not using sk->sk_protocol ourselves, so this shouldn't have much impact (except eg. getting the output in skb_dump() right). Fixes: eac3731 ("[S390]: Add AF_IUCV socket support") Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Link: https://lore.kernel.org/r/20201120100657.34407-1-jwi@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f33d9e2 commit c5dab09

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/iucv/af_iucv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ static int iucv_callback_connreq(struct iucv_path *path,
16451645
}
16461646

16471647
/* Create the new socket */
1648-
nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC, 0);
1648+
nsk = iucv_sock_alloc(NULL, sk->sk_protocol, GFP_ATOMIC, 0);
16491649
if (!nsk) {
16501650
err = pr_iucv->path_sever(path, user_data);
16511651
iucv_path_free(path);
@@ -1851,7 +1851,7 @@ static int afiucv_hs_callback_syn(struct sock *sk, struct sk_buff *skb)
18511851
goto out;
18521852
}
18531853

1854-
nsk = iucv_sock_alloc(NULL, sk->sk_type, GFP_ATOMIC, 0);
1854+
nsk = iucv_sock_alloc(NULL, sk->sk_protocol, GFP_ATOMIC, 0);
18551855
bh_lock_sock(sk);
18561856
if ((sk->sk_state != IUCV_LISTEN) ||
18571857
sk_acceptq_is_full(sk) ||

0 commit comments

Comments
 (0)