summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHarout Hedeshian <harouth@codeaurora.org>2015-04-15 14:59:27 -0600
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:09:41 -0700
commit04be6f96ac4a26346f4bf70132a82b2547f14a50 (patch)
tree9d28c4f1afc6ca5fa68e8b417dc11dcf9cc6ad3b /net
parentbf669ab2dd79566504cdc492a7cae988b897ba05 (diff)
net: udp: Adjust UDP socket state for encapsulation sockets
UDP IPv4 encapsulation sockets will have their state printed as 0xF0 binary ORed with the actual state such that they can be distinguished from regular UDP sockets in /proc/net/udp. CRs-Fixed: 821341 Change-Id: I240ab1526a4280e5e996d9577a904581684fc84a Signed-off-by: Harout Hedeshian <harouth@codeaurora.org> [subashab@codeaurora.org: resolve trivial merge conflicts] Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/udp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index d8946929813e..6b0887de150f 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2425,14 +2425,18 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
int bucket)
{
struct inet_sock *inet = inet_sk(sp);
+ struct udp_sock *up = udp_sk(sp);
__be32 dest = inet->inet_daddr;
__be32 src = inet->inet_rcv_saddr;
__u16 destp = ntohs(inet->inet_dport);
__u16 srcp = ntohs(inet->inet_sport);
+ __u8 state = sp->sk_state;
+ if (up->encap_rcv)
+ state |= 0xF0;
seq_printf(f, "%5d: %08X:%04X %08X:%04X"
" %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d",
- bucket, src, srcp, dest, destp, sp->sk_state,
+ bucket, src, srcp, dest, destp, state,
sk_wmem_alloc_get(sp),
sk_rmem_alloc_get(sp),
0, 0L, 0,