summaryrefslogtreecommitdiffstats
path: root/src/nlrequest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nlrequest.c')
-rw-r--r--src/nlrequest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nlrequest.c b/src/nlrequest.c
index 1f72357..99fd3d0 100644
--- a/src/nlrequest.c
+++ b/src/nlrequest.c
@@ -44,7 +44,7 @@ int netlink_request(int s, struct nlmsghdr *n, int (*callback) (struct nlmsghdr
for (;;) {
int bytes;
- char replybuf[1024];
+ char replybuf[2048];
struct nlmsghdr *p = (struct nlmsghdr *) replybuf;
if ((bytes = recv(s, &replybuf, sizeof(replybuf), 0)) < 0) {
@@ -55,8 +55,8 @@ int netlink_request(int s, struct nlmsghdr *n, int (*callback) (struct nlmsghdr
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
int ret;
- if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
- fprintf(stderr, "NETLINK: Packet too small or truncated!\n");
+ if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
+ fprintf(stderr, "NETLINK: Packet too small or truncated! %u!=%u!=%u\n", bytes, sizeof(struct nlmsghdr), p->nlmsg_len);
return -1;
}
@@ -114,11 +114,10 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen) {
}
/*
- * Utility function comes from iproute2.
+ * Utility function originated from iproute2.
* Author: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
-
int addattr32(struct nlmsghdr *n, int maxlen, int type, int data) {
int len;
struct rtattr *rta;