From 20a5e15443bfbbb7e6624a754832cdce19d462a0 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Thu, 4 Aug 2016 19:30:19 +0300 Subject: netsniff-ng: Allow to compile without libnl One might not want to install libnl just for sniffing packets, for example if netsniff-ng will be compiled on embedded or switch system. Hide libnl dependend code if CONFIG_LIBNL=0. In case the `--rfraw' option is used, the user will get a panic message. In case of netlink messages being sniffed, they will not be dissected. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- dissector_sll.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dissector_sll.c') diff --git a/dissector_sll.c b/dissector_sll.c index cde0d54..10fd7d9 100644 --- a/dissector_sll.c +++ b/dissector_sll.c @@ -3,12 +3,15 @@ * Subject to the GPL, version 2. */ +#include + #include "protos.h" #include "pcap_io.h" #include "pkt_buff.h" #include "dissector.h" #include "dissector_sll.h" #include "dissector_eth.h" +#include "dissector_netlink.h" #include "lookup.h" static char *pkt_type2str(uint8_t pkttype) @@ -56,7 +59,7 @@ static void sll_print_full(struct pkt_buff *pkt) break; case LINKTYPE_NETLINK: case ___constant_swab32(LINKTYPE_NETLINK): - pkt->dissector = &nlmsg_ops; + pkt->dissector = dissector_get_netlink_entry_point(); break; default: tprintf(" [ Unknown protocol ]\n"); -- cgit v1.2.3-54-g00ecf