inet_diag.c (c8991362a0d3cf317dfbfb6cb946607870654e6d) | inet_diag.c (3b09c84cb622ffbcdb5d541986b1eaf7d5812602) |
---|---|
1/* 2 * inet_diag.c Module for monitoring INET transport protocols sockets. 3 * 4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 895 unchanged lines hidden (view full) --- 904 return IPPROTO_DCCP; 905 default: 906 return 0; 907 } 908} 909 910static int inet_diag_dump_compat(struct sk_buff *skb, struct netlink_callback *cb) 911{ | 1/* 2 * inet_diag.c Module for monitoring INET transport protocols sockets. 3 * 4 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version --- 895 unchanged lines hidden (view full) --- 904 return IPPROTO_DCCP; 905 default: 906 return 0; 907 } 908} 909 910static int inet_diag_dump_compat(struct sk_buff *skb, struct netlink_callback *cb) 911{ |
912 struct inet_diag_req_compat *rc = NLMSG_DATA(cb->nlh); | 912 struct inet_diag_req *rc = NLMSG_DATA(cb->nlh); |
913 struct inet_diag_req_v2 req; 914 struct nlattr *bc = NULL; | 913 struct inet_diag_req_v2 req; 914 struct nlattr *bc = NULL; |
915 int hdrlen = sizeof(struct inet_diag_req_compat); | 915 int hdrlen = sizeof(struct inet_diag_req); |
916 917 req.sdiag_family = AF_UNSPEC; /* compatibility */ 918 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type); 919 req.idiag_ext = rc->idiag_ext; 920 req.idiag_states = rc->idiag_states; 921 req.id = rc->id; 922 923 if (nlmsg_attrlen(cb->nlh, hdrlen)) 924 bc = nlmsg_find_attr(cb->nlh, hdrlen, INET_DIAG_REQ_BYTECODE); 925 926 return __inet_diag_dump(skb, cb, &req, bc); 927} 928 929static int inet_diag_get_exact_compat(struct sk_buff *in_skb, 930 const struct nlmsghdr *nlh) 931{ | 916 917 req.sdiag_family = AF_UNSPEC; /* compatibility */ 918 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type); 919 req.idiag_ext = rc->idiag_ext; 920 req.idiag_states = rc->idiag_states; 921 req.id = rc->id; 922 923 if (nlmsg_attrlen(cb->nlh, hdrlen)) 924 bc = nlmsg_find_attr(cb->nlh, hdrlen, INET_DIAG_REQ_BYTECODE); 925 926 return __inet_diag_dump(skb, cb, &req, bc); 927} 928 929static int inet_diag_get_exact_compat(struct sk_buff *in_skb, 930 const struct nlmsghdr *nlh) 931{ |
932 struct inet_diag_req_compat *rc = NLMSG_DATA(nlh); | 932 struct inet_diag_req *rc = NLMSG_DATA(nlh); |
933 struct inet_diag_req_v2 req; 934 935 req.sdiag_family = rc->idiag_family; 936 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type); 937 req.idiag_ext = rc->idiag_ext; 938 req.idiag_states = rc->idiag_states; 939 req.id = rc->id; 940 941 return inet_diag_get_exact(in_skb, nlh, &req); 942} 943 944static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh) 945{ | 933 struct inet_diag_req_v2 req; 934 935 req.sdiag_family = rc->idiag_family; 936 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type); 937 req.idiag_ext = rc->idiag_ext; 938 req.idiag_states = rc->idiag_states; 939 req.id = rc->id; 940 941 return inet_diag_get_exact(in_skb, nlh, &req); 942} 943 944static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh) 945{ |
946 int hdrlen = sizeof(struct inet_diag_req_compat); | 946 int hdrlen = sizeof(struct inet_diag_req); |
947 948 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX || 949 nlmsg_len(nlh) < hdrlen) 950 return -EINVAL; 951 952 if (nlh->nlmsg_flags & NLM_F_DUMP) { 953 if (nlmsg_attrlen(nlh, hdrlen)) { 954 struct nlattr *attr; --- 126 unchanged lines hidden --- | 947 948 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX || 949 nlmsg_len(nlh) < hdrlen) 950 return -EINVAL; 951 952 if (nlh->nlmsg_flags & NLM_F_DUMP) { 953 if (nlmsg_attrlen(nlh, hdrlen)) { 954 struct nlattr *attr; --- 126 unchanged lines hidden --- |