projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sock_diag: fetch source port from inet_sock
[cascardo/linux.git]
/
net
/
ipv4
/
inet_diag.c
diff --git
a/net/ipv4/inet_diag.c
b/net/ipv4/inet_diag.c
index
21985d8
..
ba6a80f
100644
(file)
--- a/
net/ipv4/inet_diag.c
+++ b/
net/ipv4/inet_diag.c
@@
-1095,6
+1095,8
@@
int inet_diag_handler_get_info(struct sk_buff *skb, struct sock *sk)
r = nlmsg_data(nlh);
memset(r, 0, sizeof(*r));
inet_diag_msg_common_fill(r, sk);
r = nlmsg_data(nlh);
memset(r, 0, sizeof(*r));
inet_diag_msg_common_fill(r, sk);
+ if (sk->sk_type == SOCK_DGRAM || sk->sk_type == SOCK_STREAM)
+ r->id.idiag_sport = inet_sk(sk)->inet_sport;
r->idiag_state = sk->sk_state;
if ((err = nla_put_u8(skb, INET_DIAG_PROTOCOL, sk->sk_protocol))) {
r->idiag_state = sk->sk_state;
if ((err = nla_put_u8(skb, INET_DIAG_PROTOCOL, sk->sk_protocol))) {