Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278490
b: refs/heads/master
c: 8d34172
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Dec 6, 2011
1 parent 2298513 commit 892e398
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f1fb60c4fc9fb29fbb406ac8c4cfb4e59e168d6
refs/heads/master: 8d34172dfdb762a306cdf58b547aa10d798622ec
1 change: 1 addition & 0 deletions trunk/include/linux/inet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* Just some random number */
#define TCPDIAG_GETSOCK 18
#define DCCPDIAG_GETSOCK 19
#define SOCK_DIAG_BY_FAMILY 20

#define INET_DIAG_GETSOCK_MAX 24

Expand Down
17 changes: 15 additions & 2 deletions trunk/net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
return skb->len;
}

static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
{
int hdrlen = sizeof(struct inet_diag_req);

Expand All @@ -877,9 +877,22 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
return inet_diag_get_exact(skb, nlh);
}

static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
return -EOPNOTSUPP;
}

static int sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
return inet_diag_rcv_msg(skb, nlh);
switch (nlh->nlmsg_type) {
case TCPDIAG_GETSOCK:
case DCCPDIAG_GETSOCK:
return inet_diag_rcv_msg_compat(skb, nlh);
case SOCK_DIAG_BY_FAMILY:
return __sock_diag_rcv_msg(skb, nlh);
default:
return -EINVAL;
}
}

static DEFINE_MUTEX(sock_diag_mutex);
Expand Down

0 comments on commit 892e398

Please sign in to comment.