build: Add continuous integration support via travis-ci

This allows any libnl github repo to link to travis-ci which
will result in new commits and pull requests to be automatically
built with both gcc and clang. Any build failures including the
addition of warnings are reported to the author and committer.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
nf: nfnl_*_str2copy_mode() should return int

... to be able to return a negative error code for unknown modes.

[thaller@redhat.com: This is potentially an ABI break, but since
the size of the enum is implementation defined, it seems
anyway unstable to have them as function arguments/return values.]

http://lists.infradead.org/pipermail/libnl/2014-August/001616.html

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
xfrm: Remove unused function __assign_addr()

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
nf: Remove unused function htonll()

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
xfrm: Remove unused variable sp_id and sa_id

Cc: Sruthi Yellamraju <ysruthi@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
src: Silence all warnings

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Merge branch 'tgraf/trivial-fixes'

http://lists.infradead.org/pipermail/libnl/2014-August/001614.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
Remove pointless N < 0 checks

route/tc.c:553:9: warning: comparison of unsigned enum expression < 0 is
always false [-Wtautological-compare]
              if (id < 0 || id > RTNL_TC_STATS_MAX)

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
travis-ci: run `make check` in travis build

Test programs are only compiled when running `make check`.
Also, fix passing $CFLAGS argument to make.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
xfrm: fix calling free() with a bad pointer

sp->sec_ctx->ctx is a zero-length member, so it's already allocated

https://github.com/thom311/libnl/pull/61

Signed-off-by: Thomas Haller <thaller@redhat.com>
qdisc: avoid calling strstr() with a NULL haystack

Signed-off-by: Thomas Haller <thaller@redhat.com>
xfrm: fix an unintialized return value on memory allocation error in xfrmnl_ae_parse()

fix : err = -ENOMEM if calloc() failed

Signed-off-by: Thomas Haller <thaller@redhat.com>
xfrm: fix xfrm_sa_msg_parser() to return the value from the callback

Signed-off-by: Thomas Haller <thaller@redhat.com>
cls: check data before memcpy() it

[thaller@redhat.com: I modified the condition "if (data && len)"
 in the original patch to just check "len > 0".
 Note that all call sites of meta_alloc() make sure to pass a
 valid data pointer with a non-zero length (anything else would
 be a bug). But indeed, calling memcpy with invalid src pointer
 is undefined behavior, even if len is zero.]

Signed-off-by: Thomas Haller <thaller@redhat.com>
Merge branch 'enovance-sa_fixup'

https://github.com/thom311/libnl/pull/62

[thaller@redhat.com: I changed the original patches
 to indent with tabs (vs. spaces) and reworded the
 commit messages.]

Signed-off-by: Thomas Haller <thaller@redhat.com>
build: generate libnl-idiag-3.0.pc

That file was not generated due to a missing line in Makefile.am
and configure.ac

http://lists.infradead.org/pipermail/libnl/2014-September/001649.html

Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Signed-off-by: Thomas Haller <thaller@redhat.com>
idiag: fix a typo in idiagnl_req_set_ifindex()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
build/trivial: prettify makefiles by wrapping long lines

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
build: move copy of linux headers to private directory

libnl3 contains a private copy of some kernel header files.

Normally, users are expected to install libnl and specify
-I$PREFIX/include/libnl3 as include path. As the private kernel
header files are not installed, this works fine.

However, it can be convenient to build against the libnl source
directory, without installing libnl. In this case, the private kernel
header files shaddow the system provided ones. This is undesired.

Move these files to a different directory to avoid this clash.

http://lists.infradead.org/pipermail/libnl/2014-September/001645.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
netlink/netlink.h: fix build including <poll.h> with the musl C library

https://github.com/thom311/libnl/pull/64

Signed-off-by: Thomas Haller <thaller@redhat.com>