From 95c6823f9d0eb7110d8327bccfa52f57cc391bc4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Jan 2004 23:20:25 +0000 Subject: compatibility with 2.6 documentation update git-svn-id: file:///home/lennart/svn/public/ifmetric/trunk@16 b1ab5a0b-19c4-0310-9d9a-ef184d715f50 --- src/nlrequest.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') 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, */ - int addattr32(struct nlmsghdr *n, int maxlen, int type, int data) { int len; struct rtattr *rta; -- cgit