dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

681 Commits

Author SHA1 Message Date
Коренберг Марк (дома) 420e4623fd nl_recv(): work with credentials only if "creds" given and NL_SOCK_PASSCRED set 2012-10-19 23:51:59 +06:00
Коренберг Марк (дома) da694e6c7b nl_recv(): small code cleanups
1. memset around nla is unnecessary
2. calloc() is unnecessary. malloc() used instead.
2012-10-19 23:49:30 +06:00
Коренберг Марк (дома) 2249eaebd4 nl_recv(): EWOULDBLOCK return value also checked 2012-10-19 23:49:30 +06:00
Коренберг Марк (дома) 69468517d0 nl_recv(): Memory allocation errors are handled properly now
1. all cleanup actions (like free()) now located at the end of function
2. in case of error or EOF, *buf and *creds (if given) set to NULL
   This protect from invalid code at user's side, like:
   char *buf;
   x = nl_recv(..., &buf, ...);
   if (x<=0)
      goto cleanup;
   cleanup:
      free(buf);
3. all intermediate buffers are stored into local variables, and user's
   variables only touches at the end.
2012-10-19 23:48:46 +06:00
Коренберг Марк (ноутбук дома) 9d6b104ec8 nl_recv(): "else if" logick simplified and refined 2012-10-19 22:43:17 +06:00
Коренберг Марк (дома) e7ec197da3 nf-log example: correct copy-range parsing 2012-10-19 22:43:17 +06:00
Коренберг Марк (ноутбук дома) e1b67fb23f Clang diagnostics
Based on clang diagnostics:

1. lib/nl.c: recvmsgs(): nla filling with zeros commented.
2. lib/route/classid.c: & lib/route/pktloc.c:
   remove zero-filling of struct stat
3. lib/route/qdisc/htb.c: Fix htb_qdisc_msg_fill(): fix zero-filling
4. ematch/container.c: container_parse:
   commented why only 4 bytes are copied
   len marked as unused to eliminate compiler warning
2012-10-19 22:32:59 +06:00
Коренберг Марк (ноутбук дома) fedb862ea5 ROUTE_DIFF result was not used in some place in route_compare 2012-10-19 22:16:44 +06:00
Коренберг Марк (ноутбук дома) 787f14dbe3 genl/family flags can be damaged during the auto-indentation.
"-" was never used in the names of the flags. "_" was used in all places
of the library. So, I just changed the undescore to the minus.

Automatic indentation can insert spaces on either side of the minus,
so the library will be compiled, but will not be usable (in this part of the code),
as the parser will split words by white space, and the flag "admin - perm"
will never work.
2012-10-19 22:16:44 +06:00
Thomas Graf 1fa61d1892 3.2.14 release 2012-10-19 16:35:51 +02:00
Thomas Graf 65c3919ff4 Only include doc/ in dist 2012-10-19 16:35:28 +02:00
Thomas Graf db138439ac doc: Split doc/ into separate packages
Separates all the documentation generation trickery to its own
configure.in and allows to easily generate a pre built doc dist
file for distribution.

Arguments to configure will be passed on to doc/configure

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-19 16:16:06 +02:00
Thomas Graf 2d674fed6c doc: mark route.txt as WIP 2012-10-19 15:06:50 +02:00
Rich Fought c3376e7df6 Conntrack Dump ICMP
Looks like a cut and paste oversight ...
2012-10-18 17:43:45 +02:00
Rich Fought 2d707513c6 Updated nfnetlink includes; removed ifdefs; added delete exp program 2012-10-16 12:13:33 -07:00
Rich Fought 07418658a6 define advanced attributes out 2012-10-12 17:44:27 -07:00
Rich Fought 416459570f Bugfixes 2012-10-10 13:08:23 -07:00
Rich Fought 547c8f6d50 reinit port numers on tuple dump 2012-10-09 15:22:16 -07:00
Rich Fought d3bec59eb9 bugfixes 2012-10-09 15:16:00 -07:00
Thomas Graf a35287a689 link: Support link grouping
New functions:
  rtnl_link_set_group(link, group)
  rtnl_link_get_group(link)

The group identifier is printed in the brief section as "group N"

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 21:55:31 +02:00
Thomas Graf 36139cf1f0 doc: Provide documentation for link promis counter and rx/tx queues
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 21:37:31 +02:00
Thomas Graf f2e2e7feb5 link: Include IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES when building messages
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 21:24:35 +02:00
Thomas Graf 7f6880ceb9 link: Only print "promisc-mode" if users > 0
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 19:58:54 +02:00
Thomas Graf 36ed882e00 link: Support IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES
New functions:
  rtnl_link_set_num_tx_queues(link, nqueues)
  rtnl_link_get_num_tx_queues(link)
  rtnl_link_set_num_rx_queues(link, nqueues)
  rtnl_link_get_num_rx_queues(link)

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 19:57:22 +02:00
Rich Fought 3cb581d598 update gitignore 2012-10-09 10:54:07 -07:00
Rich Fought 453492c9b2 Expectation get cli tool 2012-10-09 10:52:34 -07:00
Thomas Graf d2876f8657 link: correctly set LINK_ATTR_PROMISCUITY
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 19:34:23 +02:00
Rich Fought daf5f93a13 Compile CLI 2012-10-09 09:50:31 -07:00
Thomas Graf 6ac07179e5 link: Support IFLA_PROMISCUITY link attribute
* read-only attribute
 * dumped in details sections "promisc-mode (N users)"

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 18:15:50 +02:00
Thomas Graf e4192ff97f nl: Provide API to specify the default buffer size when receiving netlink messages
New functions:
  nl_socket_set_msg_buf_size(sk, size)
  nl_socket_get_msg_buf_size(sk)

Default remains getpagesize()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-10-09 16:16:54 +02:00
Rich Fought 4a702e6b72 Starting CLI work 2012-10-08 17:31:42 -07:00
Rich Fought f111efd894 Successful compilation of libnl-nf with expectation 2012-10-08 16:49:06 -07:00
Rich Fought c675bf0486 Checkpoint before compilation attempt 2012-10-08 15:26:55 -07:00
Rich Fought e8b3356dd2 "checkpoint" 2012-10-05 17:32:20 -07:00
Rich Fought 20035ce021 Checkpoint: compare function 2012-10-05 11:09:45 -07:00
Rich Fought 40457db1f4 Exp checkpoint 2012-10-05 06:55:04 -07:00
Antoni S. Puimedon 72c2cb9e29 Enabled the use of Links as context managers.
With this change you can still set do modifications of
Links and then to change to pass the changes to the
kernel. But it additionally enables you to interact
with this part of libnl-python in a more pythonic
way. Instead of:

    eth0 = links['eth0']
    eth0.mtu = 5000
    eth0.change()

you can do:

    with links['eth0'] as eth0:
        eth0.mtu = 5000
2012-10-04 16:36:55 -04:00
Thomas Graf ce72837c90 3.2.13 release 2012-09-03 13:41:11 +02:00
Jeroen Roovers fddba713a8 libnl-3.2.12 - ./configure --disable-doc: error: conditional "LINK_DOC" was never defined. \ Usually this means the macro was only invoked conditionally.
configure: error: conditional "LINK_DOC" was never defined.
Usually this means the macro was only invoked conditionally.

Attached patch provided by Martin Jansa.

See also https://bugs.gentoo.org/show_bug.cgi?id=433565
2012-09-03 12:13:01 +02:00
Thomas Graf 4a9e92cbbc Merge branch 'asprintf' of https://github.com/socketpair/libnl 2012-08-31 16:25:47 +02:00
Thomas Graf eb8ff32b29 Merge branch 'doxyfile' of https://github.com/socketpair/libnl 2012-08-31 16:23:39 +02:00
Thomas Graf 49be8cd2b3 doc: Update Doxyfile.in to latest syntax 2012-08-31 16:23:07 +02:00
Коренберг Марк 49c94c3490 genl_ctrl_probe_by_name: fix checking of genlmsg_put() return value
It's a pointer! not an error code :) nasty bugs
2012-08-30 22:53:54 +06:00
Коренберг Марк b1e0a0ca5d Remove auto-generated Doxyfile from git
Also, add it to gitignore
2012-08-30 22:43:09 +06:00
Коренберг Марк a820222877 asprintf related fixed in yy parser
1. According to man asprintf:
   If memory allocation wasn't possible, or some other error occurs,
   these functions will return -1, and the contents of strp is undefined.
2. Sometimes, errp was not filled at all. In high-level code, free(errp)
   will called, so segmantation fault may appear in case of error in parser
3. The most cases of using asprintf is to report about allocation fail.
   So, probability of allocation of asprintf buffer is very high. And that
   will lead to trash in errp.
4. For simple casses I decide to replace asprintf with strdup
2012-08-30 22:35:25 +06:00
Коренберг Марк 00261259f0 Address comparison bug fixed
Bug introduced in 794ac78c56
2012-08-30 21:00:39 +06:00
Коренберг Марк 8f2ce4d791 More clean NL_AUTO_PORT and NL_AUTO_SEQ usage in nl_complete_msg 2012-08-30 18:40:25 +06:00
Thomas Graf 3bf8712feb 3.2.12 release 2012-08-30 13:46:29 +02:00
Thomas Graf 929bd0150f configure: Check for pygmentize when building docs
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2012-08-30 13:36:23 +02:00
Thomas Graf 5eeb3d3ea6 doc: Update Doxyfile config to latest release 2012-08-30 13:22:21 +02:00