summaryrefslogtreecommitdiff
path: root/accel-pppd/libnetlink/libnetlink.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-09-05 22:37:48 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-09-05 22:37:48 +0400
commita10ec0f4636cd559209659304709924daad96340 (patch)
tree15dee2e6e0e350127cbf0cf190300a581c0dea50 /accel-pppd/libnetlink/libnetlink.c
parentb4eec284b0814c01c575492af73dbe23ff81f5e8 (diff)
downloadaccel-ppp-a10ec0f4636cd559209659304709924daad96340.tar.gz
accel-ppp-a10ec0f4636cd559209659304709924daad96340.zip
libnetlink: remove unused function
Diffstat (limited to 'accel-pppd/libnetlink/libnetlink.c')
-rw-r--r--accel-pppd/libnetlink/libnetlink.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/accel-pppd/libnetlink/libnetlink.c b/accel-pppd/libnetlink/libnetlink.c
index 808e433..4630b30 100644
--- a/accel-pppd/libnetlink/libnetlink.c
+++ b/accel-pppd/libnetlink/libnetlink.c
@@ -482,61 +482,6 @@ int __export rtnl_listen(struct rtnl_handle *rtnl,
}
}
-int __export rtnl_from_file(FILE *rtnl, rtnl_filter_t handler,
- void *jarg)
-{
- int status;
- struct sockaddr_nl nladdr;
- char buf[8192];
- struct nlmsghdr *h = (void*)buf;
-
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nladdr.nl_pid = 0;
- nladdr.nl_groups = 0;
-
- while (1) {
- int err, len, type;
- int l;
-
- status = fread(&buf, 1, sizeof(*h), rtnl);
-
- if (status < 0) {
- if (errno == EINTR)
- continue;
- log_error("libnetlink: ""rtnl_from_file: fread");
- return -1;
- }
- if (status == 0)
- return 0;
-
- len = h->nlmsg_len;
- type= h->nlmsg_type;
- l = len - sizeof(*h);
-
- if (l<0 || len>sizeof(buf)) {
- log_error("libnetlink: ""!!!malformed message: len=%d @%lu\n",
- len, ftell(rtnl));
- return -1;
- }
-
- status = fread(NLMSG_DATA(h), 1, NLMSG_ALIGN(l), rtnl);
-
- if (status < 0) {
- log_error("libnetlink: ""rtnl_from_file: fread");
- return -1;
- }
- if (status < l) {
- log_error("libnetlink: ""rtnl-from_file: truncated message\n");
- return -1;
- }
-
- err = handler(&nladdr, h, jarg);
- if (err < 0)
- return err;
- }
-}
-
int __export addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
{
int len = RTA_LENGTH(4);