aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_diag.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2011-12-06 02:58:21 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-06 13:58:01 -0500
commit126fdc3249c9ced2a0d20f916858fec26a445f61 (patch)
tree3472fb17cbe27014ee45c70535dc96ad7ae28195 /net/ipv4/inet_diag.c
parentd366477a52f1df29fa066ffb18e4e6101ee2ad04 (diff)
inet_diag: Introduce new inet_diag_req header
This one coinsides with the sock_diag_req in the beginning and contains only used fields from its previous analogue. The existing code is patched to use the _compat version of it for now. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r--net/ipv4/inet_diag.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 877875ea3d71..f37b1284b46b 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -265,7 +265,7 @@ static int inet_diag_get_exact(struct sk_buff *in_skb,
265{ 265{
266 int err; 266 int err;
267 struct sock *sk; 267 struct sock *sk;
268 struct inet_diag_req *req = NLMSG_DATA(nlh); 268 struct inet_diag_req_compat *req = NLMSG_DATA(nlh);
269 struct sk_buff *rep; 269 struct sk_buff *rep;
270 struct inet_hashinfo *hashinfo; 270 struct inet_hashinfo *hashinfo;
271 const struct inet_diag_handler *handler; 271 const struct inet_diag_handler *handler;
@@ -504,7 +504,7 @@ static int inet_csk_diag_dump(struct sock *sk,
504 struct netlink_callback *cb, 504 struct netlink_callback *cb,
505 const struct nlattr *bc) 505 const struct nlattr *bc)
506{ 506{
507 struct inet_diag_req *r = NLMSG_DATA(cb->nlh); 507 struct inet_diag_req_compat *r = NLMSG_DATA(cb->nlh);
508 508
509 if (bc != NULL) { 509 if (bc != NULL) {
510 struct inet_diag_entry entry; 510 struct inet_diag_entry entry;
@@ -541,7 +541,7 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw,
541 struct netlink_callback *cb, 541 struct netlink_callback *cb,
542 const struct nlattr *bc) 542 const struct nlattr *bc)
543{ 543{
544 struct inet_diag_req *r = NLMSG_DATA(cb->nlh); 544 struct inet_diag_req_compat *r = NLMSG_DATA(cb->nlh);
545 545
546 if (bc != NULL) { 546 if (bc != NULL) {
547 struct inet_diag_entry entry; 547 struct inet_diag_entry entry;
@@ -629,7 +629,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
629 const struct nlattr *bc) 629 const struct nlattr *bc)
630{ 630{
631 struct inet_diag_entry entry; 631 struct inet_diag_entry entry;
632 struct inet_diag_req *r = NLMSG_DATA(cb->nlh); 632 struct inet_diag_req_compat *r = NLMSG_DATA(cb->nlh);
633 struct inet_connection_sock *icsk = inet_csk(sk); 633 struct inet_connection_sock *icsk = inet_csk(sk);
634 struct listen_sock *lopt; 634 struct listen_sock *lopt;
635 struct inet_sock *inet = inet_sk(sk); 635 struct inet_sock *inet = inet_sk(sk);
@@ -712,12 +712,12 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
712{ 712{
713 int i, num; 713 int i, num;
714 int s_i, s_num; 714 int s_i, s_num;
715 struct inet_diag_req *r = NLMSG_DATA(cb->nlh); 715 struct inet_diag_req_compat *r = NLMSG_DATA(cb->nlh);
716 const struct inet_diag_handler *handler; 716 const struct inet_diag_handler *handler;
717 struct inet_hashinfo *hashinfo; 717 struct inet_hashinfo *hashinfo;
718 const struct nlattr *bc = NULL; 718 const struct nlattr *bc = NULL;
719 719
720 if (nlmsg_attrlen(cb->nlh, sizeof(struct inet_diag_req))) 720 if (nlmsg_attrlen(cb->nlh, sizeof(struct inet_diag_req_compat)))
721 bc = nlmsg_find_attr(cb->nlh, sizeof(*r), INET_DIAG_REQ_BYTECODE); 721 bc = nlmsg_find_attr(cb->nlh, sizeof(*r), INET_DIAG_REQ_BYTECODE);
722 722
723 handler = inet_diag_lock_handler(inet_diag_type2proto(cb->nlh->nlmsg_type)); 723 handler = inet_diag_lock_handler(inet_diag_type2proto(cb->nlh->nlmsg_type));
@@ -863,7 +863,7 @@ unlock:
863 863
864static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh) 864static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
865{ 865{
866 int hdrlen = sizeof(struct inet_diag_req); 866 int hdrlen = sizeof(struct inet_diag_req_compat);
867 867
868 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX || 868 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX ||
869 nlmsg_len(nlh) < hdrlen) 869 nlmsg_len(nlh) < hdrlen)