GithubHelp home page GithubHelp logo

nhorman / dropwatch Goto Github PK

View Code? Open in Web Editor NEW
614.0 18.0 89.0 1.06 MB

user space utility to interface to kernel dropwatch facility

License: GNU General Public License v2.0

Makefile 1.33% C 94.12% Shell 0.83% M4 2.38% Dockerfile 1.35%

dropwatch's Introduction

DropWatch

Build Status

Thanks for Downloading Dropwatch!

What is Dropwatch?

Dropwatch is a project I started in an effort to improve the ability for developers and system administrators to diagnose problems in the Linux Networking stack, specifically in our ability to diagnose where packets are getting dropped. From my probing, I've come to the conclusion that there are four main shortcomings in our current environment:

  1. Consolidation, or lack thereof. Currently, if you would like to check on the status of dropped packets in the kernel, you need to check at least 4 places, and possibly more: The /proc/net/snmp file, the netstat utility, the tc utility, and ethtool. This project aims to consolidate several of those checks into one tool, making it easier for a sysadmin or developer to detect lost packets

  2. Clarity of information. Dropped packets are not obvious. A sysadmin needs to be intimately familiar with each of the above tools to understand which events or statistics correlate to a dropped packet and which do not. While that is often self evident, it is also often not. Dropwatch aims to improve that clarity

  3. Ambiguity. Even when a dropped packet is detected, the causes for those dropped packets are not always clear. Does a UDPInError mean the application receive buffer was full, or does it mean its checksum was bad? Dropwatch attempts to disambiguate the causes for dropped packets.

  4. Performance. Utilities can be written to aggregate the data in the various other utilities to solve some of these problems, but such solutions require periodic polling of several interfaces, which is far from optimal, especially when lost packets are rare. This solution improves on the performance aspect by implementing a kernel feature which allows asynchronous notification of dropped packets when they happen.

Building Dropwatch

Dropwatch uses the autotools suite (autoconf/automake) to build. To build and install the utility run the following commands:

./autogen.sh
./configure
make
make install

Building and using Dropwatch in Docker

docker build -t dropwatch .
docker run -it --rm -v /usr/src:/usr/src:ro -v /lib/modules/:/lib/modules:ro -v /sys/:/sys/:rw --net=host --pid=host --privileged dropwatch

Questions

Feel free to email me directly at [email protected] with question, or if you find a bug, open an issue here on the github page

dropwatch's People

Contributors

ahans avatar ffontaine avatar idosch avatar jpirko avatar kmaehashi avatar lespocky avatar liuhangbin avatar loyou avatar menglongdong avatar mihalicyn avatar nhorman avatar peilin-ye avatar pmhahn avatar renha avatar sanjaymsh avatar sebastianw avatar xfan1024 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropwatch's Issues

dwcap appears to be missing from the centos 7 rpm

As I understand it, dwcap captures packets that would or will be dropped so they can be examined retrospectively with wireshark.

Examining the dropwatch-1.4-9.el7.x86_64.rpm shows no such file, though the source rpm shows src/dwcap.c.

Am I misunderstanding how to find this particular tool?

bin
└── dropwatch
share
├── doc
│   └── dropwatch-1.4
│       ├── COPYING
│       └── README
└── man
    └── man1
        └── dropwatch.1.gz

make error

Issue description

I'm trying to compile dropwatch on Ubuntu 20.04, but I get the following error when running make:

/usr/bin/ld: main.o: in function free_netlink_msg': /home/zhao/dropwatch/src/main.c:254: undefined reference to nlmsg_free’ /usr/bin/ld: main.o: in function handle_dm_config_new_msg': /home/zhao/dropwatch/src/main.c:565: undefined reference to genlmsg_parse’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:574: undefined reference to nla_get_u8' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:586: undefined reference to nla_get_u32’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:589: undefined reference to nla_get_u32' /usr/bin/ld: main.o: in function setup_netlink_socket’: /home/zhao/dropwatch/src/main.c:170: undefined reference to nl_socket_alloc' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:172: undefined reference to genl_connect’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:174: undefined reference to genl_ctrl_resolve' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:183: undefined reference to nl_close’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:184: undefined reference to nl_socket_free' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:186: undefined reference to nl_socket_alloc’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:187: undefined reference to nl_join_groups' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:189: undefined reference to nl_connect’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:194: undefined reference to nl_close' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:195: undefined reference to nl_socket_free’ /usr/bin/ld: main.o: in function alloc_netlink_msg': /home/zhao/dropwatch/src/main.c:210: undefined reference to nlmsg_alloc’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:211: undefined reference to genlmsg_put' /usr/bin/ld: main.o: in function recv_netlink_message’: /home/zhao/dropwatch/src/main.c:280: undefined reference to nl_recv' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:325: undefined reference to nlmsg_data’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:307: undefined reference to nlmsg_data' /usr/bin/ld: main.o: in function process_rx_message’: /home/zhao/dropwatch/src/main.c:354: undefined reference to nlmsg_data' /usr/bin/ld: main.o: in function print_nested_hw_entry’: /home/zhao/dropwatch/src/main.c:366: undefined reference to nla_parse_nested' /usr/bin/ld: /home/zhao/dropwatch/src/main.c:374: undefined reference to nla_get_string’ /usr/bin/ld: /home/zhao/dropwatch/src/main.c:374



I have installed the following packages:

- libpcap-dev
- binutils-dev
- libreadline-dev
- libnl-genl-3-dev

But it still doesn't work. How can I fix this issue?

## Environment information

- OS version : Ubuntu 20.04
- dropwatch version : 1.5.3
- gcc version : 9.3.0

main.c:23:10: fatal error: readline/readline.h: No such file or directory

I'm getting this error when running make. ./autogen.sh and ./configure appear to run sucessfully but make failes. Using Ubuntu 20.04.3 LTS

Complet output:

phil@phil-desktopubuntu-18-04-1-lts:~/Programs/dropwatch-1.5.3$ ./autogen.sh
+ mkdir -p m4
+ autoreconf -fv --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:7: installing './compile'
configure.ac:6: installing './missing'
src/Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
phil@phil-desktopubuntu-18-04-1-lts:~/Programs/dropwatch-1.5.3$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gawk... (cached) gawk
checking for getopt_long... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3... yes
checking for READLINE... no
checking for LIBPCAP... yes
checking bfd.h usability... yes
checking bfd.h presence... yes
checking for bfd.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
configure: 
configure: dropwatch Version:     1.5.3
configure: Target:                 
configure: Installation prefix:    /usr/local
configure: Compiler:               gcc
configure: Compiler flags: -g -O2
configure: BFD library support: yes
phil@phil-desktopubuntu-18-04-1-lts:~/Programs/dropwatch-1.5.3$ make
make  all-recursive
make[1]: Entering directory '/home/phil/Programs/dropwatch-1.5.3'
Making all in src
make[2]: Entering directory '/home/phil/Programs/dropwatch-1.5.3/src'
depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3  -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\
mv -f $depbase.Tpo $depbase.Po
main.c:23:10: fatal error: readline/readline.h: No such file or directory
   23 | #include <readline/readline.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:429: main.o] Error 1
make[2]: Leaving directory '/home/phil/Programs/dropwatch-1.5.3/src'
make[1]: *** [Makefile:430: all-recursive] Error 1
make[1]: Leaving directory '/home/phil/Programs/dropwatch-1.5.3'
make: *** [Makefile:362: all] Error 2

Failed configure step for building Dropwatch

Hello, I was going to use dropwatch to do drop packet. However, the installation failed.
anything know about this?

error log
error : configure: error: libreadline is required

readline is already installed
/sbin/ldconfig -p | grep readline

libreadline.so.6 (libc6,x86-64) => /lib64/libreadline.so.6
libreadline.so (libc6,x86-64) => /lib64/libreadline.so

Please let me know if you need any more information, thank you.

libreadline in centos/rhel 7

Hitting this error:

[w.chandler@wuit-s-11408 dropwatch]$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
checking for LIBNLG3... yes
checking for READLINE... no
configure: error: libreadline is required

And I've got all these installed:
[w.chandler@wuit-s-11408 dropwatch]$ sudo yum list installed | grep readline
readline.x86_64 6.2-11.el7 @rhel-7-server-rpms
readline-devel.x86_64 6.2-11.el7 @rhel-7-server-rpms
readline-static.x86_64 6.2-11.el7 @rhel-7-server-optional-rpms

Looking at the config, does readline need to be version +8?

Any ideas on something else to install?

Thanks!

unable to run dropwatch in network namespace

Hi, thanks for working on the tool!
When I run it in my "default" namespace, it works fine.
But when I run it in a custom namespace, i get the error "Unable to find NET_DM family, dropwatch can't work"
I'm running DO Ubuntu 22.04 x64

Luckily I was running tcpdump & I saw this. Don't know if it's helpful but just thought i should add it.

18:40:35.373668 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.375820 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.375920 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.376005 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.376111 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.376189 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.376279 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75
18:40:35.376359 lo    In  IP 127.0.0.53 > 127.0.0.1: ICMP 127.0.0.53 udp port 53 unreachable, length 75

Unable to build on Ubuntu 18.04

./autogen.sh
+ mkdir -p m4
+ autoreconf -fv --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
configure.ac:16: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:21: error: possibly undefined macro: AC_CHECK_LIB
autoreconf: /usr/bin/autoconf failed with exit status: 1

It seems to be failing at PKG_CHECK_MODULES([LIBNL3], [libnl-3.0], [], [AC_MSG_ERROR([libnl-3.0 is required])]). I have the following packages installed however:

i A libnl-3-200 - library for dealing with netlink sockets
i  libnl-3-dev - development library and headers for libnl-3
i A libnl-genl-3-200 - library for dealing with netlink sockets - generic netlink
i  libnl-genl-3-dev - development library and headers for libnl-genl-3
i A libnl-route-3-200 - library for dealing with netlink sockets - route interface

Any help is appreciated.

not able to compile on ubuntu20.04/1804

getting following error while make
up_kas.o lookup_bfd.o -lnl-genl-3 -lnl-3 -lbfd -lpcap
main.o: In function enter_command_line_mode': /group/cdc_hd/members/nagarwal/x3/dropwatch/src/main.c:865: undefined reference to readline'
collect2: error: ld returned 1 exit status
Makefile:389: recipe for target 'dropwatch' failed
make[2]: *** [dropwatch] Error 1
make[2]: Leaving directory '/group/cdc_hd/members/nagarwal/x3/dropwatch/src'
Makefile:402: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/group/cdc_hd/members/nagarwal/x3/dropwatch'
Makefile:333: recipe for target 'all' failed
make: *** [all] Error 2

readline required but not checked in the configuration

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gawk... (cached) gawk
checking for getopt_long... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3... yes
checking for LIBNLG3... yes
checking for READLINE... no
checking for LIBPCAP... yes
checking bfd.h usability... yes
checking bfd.h presence... yes
checking for bfd.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
configure: dropwatch Version: 1.5.3
configure: Target:
configure: Installation prefix: /usr/local
configure: Compiler: gcc
configure: Compiler flags: -g -O2
configure: BFD library support: yes

$ make
make all-recursive
make[1]: Entering directory '/home/skalkoto/src/dropwatch'
Making all in src
make[2]: Entering directory '/home/skalkoto/src/dropwatch/src'
depbase=echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -g -Wall -Werror -I/usr/include/libnl3 -I/usr/include/libnl3 -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&
mv -f $depbase.Tpo $depbase.Po
main.c:23:10: fatal error: readline/readline.h: No such file or directory
23 | #include <readline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:431: main.o] Error 1
make[2]: Leaving directory '/home/skalkoto/src/dropwatch/src'
make[1]: *** [Makefile:432: all-recursive] Error 1
make[1]: Leaving directory '/home/skalkoto/src/dropwatch'
make: *** [Makefile:364: all] Error 2

use net_dropmon.h in sysroot

Hi,
when i use it in yocto. i found something that we can do it best.
dropwatch tools compile with
local head file,but it not matched with our real head file form
kernel.(net_dropmon.h) net_dropmon.h in dropwatch local src/net_dropmon.h.
linux kernel also have it in include/uapi/linux/net_dropmon.h

for example,our kernel is linux5.10:
diff tmp/work/cortexa57-poky-linux/dropwatch/1.5.4+git-r0/recipe-sysroot/usr/
include/linux/net_dropmon.h tmp/work/cortexa57-poky-linux/dropwatch/1.5.4+git-r0/git/src/net_dropmon.h
1c1,3
<
95a94

  NET_DM_ATTR_REASON,                     /* string */

it will cause missmatch when we use drop watch in lower kernel version(v5.10),
will cause dropwatch and kernel drop_monitor module missmatch with netlink talk.
we should build it with sysroot which comes from match kernel head file.

From 4872c52f55f9cb089e6681c3f1926663145b52ae Mon Sep 17 00:00:00 2001
From: chenheyun [email protected]
Date: Sun, 18 Feb 2024 05:08:25 -0800
Subject: [PATCH] fix bug: build with sysroot head file instead of local head
file:net_dropmon.h

Signed-off-by: chenheyun [email protected]

src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index e4746d9..81dc4da 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,8 +26,8 @@
#include <netlink/netlink.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
+#include <net_dropmon.h>

-#include "net_dropmon.h"
#include "lookup.h"

/*

2.25.1

build fails with -Wcast-align when cross-compiling for armv5

We usually set -Wcast-align in additional CFLAGS when cross-compiling for ARMv5 targets (see this blog post for explanation). This triggers the following warning (local build system paths shortened):

make[1]: Entering directory '***/platform-ncl/build-target/dropwatch-1.5.3'
make  all-recursive
make[2]: Entering directory '***/platform-ncl/build-target/dropwatch-1.5.3'
Making all in src
make[3]: Entering directory '***/platform-ncl/build-target/dropwatch-1.5.3/src'
  CC       main.o
main.c: In function 'recv_netlink_message':
main.c:297:25: error: cast increases required alignment of target type [-Werror=cast-align]
cc1: all warnings being treated as errors
Makefile:419: recipe for target 'main.o' failed
make[3]: *** [main.o] Error 1
make[3]: Leaving directory '***/platform-ncl/build-target/dropwatch-1.5.3/src'
Makefile:429: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '***/platform-ncl/build-target/dropwatch-1.5.3'
Makefile:361: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '***/platform-ncl/build-target/dropwatch-1.5.3'
/usr/local/lib/ptxdist-2018.05.0/rules/post/ptxd_make_world_compile.make:21: recipe for target '***/platform-ncl/state/dropwatch.compile' failed
make: *** [***/platform-ncl/state/dropwatch.compile] Error 2

The reason is this cast in line 297 of main.c:

        msg = wrap_netlink_msg((struct nlmsghdr *)buf);

Because dropwatch sets -Werror build fails. 🙁

Unable to compile Dropwatch for OpenWrt

Hello,
I am trying to compile Dropwatch for OpenWrt, for an x86_64 platform based on the musl standard C library.
However, I am unable to complete the configuration of the project, both if I try compiling inside OpenWrt, or if I try cross-compiling the project from Ubuntu 20 LTS.

In the first case, "./configure" fails even if libnl is installed:

checking for LIBNL3... no
configure: error: libnl-3.0 is required

root@OpenWrt:~/dropwatch# opkg install libnl
Package libnl (3.3.0-1) installed in root is up to date.

I suppose this is probably due to the absence of libnl as a libXXX-dev package for OpenWrt.

When I try cross-compiling, instead, "./configure" returns an error on bfd.h:

/mnt/xtra/dropwatch$ ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-openwrt-linux-musl
[...]
checking whether we are cross compiling... yes
[...]
checking bfd.h usability... no
checking bfd.h presence... no
checking for bfd.h... no
configure: error: Couldn't find or include bfd.h

The procedure does not fail if I just run "./configure" without any cross-compilation option.

Is this due to Dropwatch non supporting OpenWrt or musl-based systems? Or am I doing something wrong in the configuration procedure?

Thank you very much in advance.

Compiling on Ubuntu 18.04

Not really an issue but a thing worth having here:

When configuring on Ubuntu 18.04 there is an error about readline library.

checking for READLINE... no
configure: error: libreadline is required

It is caused by a lack of a proper definition file so that ./configure can properly recognize the lib.

It can be fixed by creating file /usr/share/pkgconfig/readline.pc containing:

Name: Readline
Description: Gnu Readline library for command line editing
URL: http://tiswww.cwru.edu/php/chet/readline/rltop.html
Version: 7.0
Requires.private: tinfo
Libs: -lreadline
Cflags: -I/usr/include/readline

Source:
https://www.marache.net/post/readline-pc.html

Unable to run autoreconf

./autogen.sh
+ mkdir -p m4
+ autoreconf -fv --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
configure.ac:18: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:22: error: possibly undefined macro: AC_CHECK_LIB
autoreconf: /usr/bin/autoconf failed with exit status: 1

Building failure on Ubuntu-22.04

Hi,
I have to modify those to get building success on such distribution.
I am not a specialist of "./autogen.sh ; ./configure " but after those two lines, I need to apply this patch and then everything works right:

diff -ur dropwatch/src/Makefile dropwatch-1.5.4/src/Makefile
--- dropwatch/src/Makefile	2023-09-05 10:20:47.042111354 +0100
+++ dropwatch-1.5.4/src/Makefile	2023-09-05 14:03:23.883769251 +0100
@@ -268,7 +268,7 @@
 top_builddir = ..
 top_srcdir = ..
 AM_CFLAGS = -g -Wall -Werror $(LIBNL3_CFLAGS) $(LIBNLG3_CFLAGS) $(READLINE_CFLAGS)
-LIBS = $(LIBNL3_LIBS) $(LIBNLG3_LIBS) $(READLINE_LIBS) -lpcap \
+AM_LDFLAGS = $(LIBNL3_LIBS) $(LIBNLG3_LIBS) $(READLINE_LIBS) -lpcap \
 	$(am__append_2)
 AM_CPPFLAGS = -D_GNU_SOURCE
 dropwatch_SOURCES = main.c lookup.c lookup_kas.c $(am__append_1)
@@ -351,11 +351,11 @@
 
 dropwatch$(EXEEXT): $(dropwatch_OBJECTS) $(dropwatch_DEPENDENCIES) $(EXTRA_dropwatch_DEPENDENCIES) 
 	@rm -f dropwatch$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(dropwatch_OBJECTS) $(dropwatch_LDADD) -Wl,--start-group $(LIBS) -Wl,--end-group
+	$(AM_V_CCLD)$(LINK) $(dropwatch_OBJECTS) $(dropwatch_LDADD) $(LIBS)
 
 dwdump$(EXEEXT): $(dwdump_OBJECTS) $(dwdump_DEPENDENCIES) $(EXTRA_dwdump_DEPENDENCIES) 
 	@rm -f dwdump$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(dwdump_OBJECTS) $(dwdump_LDADD) -Wl,--start-group $(LIBS)  -Wl,--end-group
+	$(AM_V_CCLD)$(LINK) $(dwdump_OBJECTS) $(dwdump_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)

The kind of errors I get without the patch is:

gcc -g -Wall -Werror -I/usr/include/libnl3 -I/usr/include/libnl3 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -g -O2 -lnl-3 -lnl-genl-3 -lnl-3 -lreadline -lpcap -lbfd  -o dropwatch main.o lookup.o lookup_kas.o lookup_bfd.o  
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/etienne/dropwatch-1.5.4/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `handle_dm_config_new_msg':
/home/etienne/dropwatch-1.5.4/src/main.c:565: undefined reference to `genlmsg_parse'
/usr/bin/ld: /home/etienne/dropwatch-1.5.4/src/main.c:574: undefined reference to `nla_get_u8'
/usr/bin/ld: /home/etienne/dropwatch-1.5.4/src/main.c:586: undefined reference to `nla_get_u32'
/usr/bin/ld: /home/etienne/dropwatch-1.5.4/src/main.c:589: undefined reference to `nla_get_u32'
/usr/bin/ld: main.o: in function `setup_netlink_socket':

I.e. libraries not listed at the end of the parameter list for the linker step...
Hope this helps, Thanks for providing dropwatch.

Should we update Makefile License?

Hi Neil,

All our src codes are GPLv2+ License, while the Makefile.am is LGPLv2+ (Lesser General Public License). Would you update the Makefile license to GPLv2+?

Thanks
Hangbin

Debian 10 - libreadline is required

I am currently trying to install the tool.
However, it stops at the "configure" command.

Error:

checking for READLINE... no
configure: error: libreadline is required

I already have installed libreadline-dev even libreadline5 and libreadline7.

Maybe someone can help out.

make fail

When trying to compile from master branch, make fails.

make  all-recursive
make[1]: Entering directory '/home/pi/drop/dropwatch'
Making all in src
make[2]: Entering directory '/home/pi/drop/dropwatch/src'
depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3  -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\
mv -f $depbase.Tpo $depbase.Po
main.c: In function ‘handle_dm_packet_alert_msg’:
main.c:505:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
          (void *) nla_get_u64(attrs[NET_DM_ATTR_PC]));
          ^
main.c:530:29: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
   printf("timestamp: %s %09ld nsec\n", tstr, ts % 1000000000);
                             ^
main.c: In function ‘print_nested_stats’:
main.c:605:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=]
   printf("Tail dropped: %lu\n",
                           ^
cc1: all warnings being treated as errors
Makefile:409: recipe for target 'main.o' failed
make[2]: *** [main.o] Error 1
make[2]: Leaving directory '/home/pi/drop/dropwatch/src'
Makefile:428: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/drop/dropwatch'
Makefile:360: recipe for target 'all' failed
make: *** [all] Error 2

Error when running make in Amazon Linux server

Hi,

I am trying to install dropwatch in my Amazon Linux 1 server but am running into an error in the make step.

dwdump.c:512:39: error: ‘DLT_NETLINK’ undeclared (first use in this function)
dwdump->pcap_handle = pcap_open_dead(DLT_NETLINK, dwdump->snaplen);

How can I fix this? I tried looking it up online but couldn't find a way to fix it.

The complete text when running make:

make  all-recursive
make[1]: Entering directory `/home/ec2-user/dropwatch'
Making all in src
make[2]: Entering directory `/home/ec2-user/dropwatch/src'
depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo lookup.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -MT lookup.o -MD -MP -MF $depbase.Tpo -c -o lookup.o lookup.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo lookup_kas.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -MT lookup_kas.o -MD -MP -MF $depbase.Tpo -c -o lookup_kas.o lookup_kas.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo lookup_bfd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -MT lookup_bfd.o -MD -MP -MF $depbase.Tpo -c -o lookup_bfd.o lookup_bfd.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -lnl-3   -lnl-genl-3 -lnl-3   -lreadline -lpcap -lbfd  -o dropwatch main.o lookup.o lookup_kas.o lookup_bfd.o  -lpcap
libtool: link: gcc -g -Wall -Werror -I/usr/include/libnl3 -I/usr/include/libnl3 -g -O2 -o dropwatch main.o lookup.o lookup_kas.o lookup_bfd.o  -lnl-genl-3 -lnl-3 -lreadline -lbfd -lpcap
depbase=`echo dwdump.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3   -I/usr/include/libnl3    -g -O2 -MT dwdump.o -MD -MP -MF $depbase.Tpo -c -o dwdump.o dwdump.c &&\
mv -f $depbase.Tpo $depbase.Po
dwdump.c: In function ‘dwdump_pcap_init’:
dwdump.c:512:39: error: ‘DLT_NETLINK’ undeclared (first use in this function)
  dwdump->pcap_handle = pcap_open_dead(DLT_NETLINK, dwdump->snaplen);
                                       ^
dwdump.c:512:39: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [dwdump.o] Error 1
make[2]: Leaving directory `/home/ec2-user/dropwatch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ec2-user/dropwatch'
make: *** [all] Error 2

configure doesn't detect libnl3 on CentOS 7

checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3... no
configure: error: libnl-3.0 is required

# rpm -qa|grep libnl
libnl3-cli-3.2.28-4.el7.x86_64
libnl-1.1.4-3.el7.x86_64
libnl3-3.2.28-4.el7.x86_64

pkg-config Readline Not Found

I'm running Devuan Beowulf (Debian Buster) and I downloaded the master branch. When running configure I see:

configure: error: libreadline is required

Running:

pkg-config --cflags "readline"
Package readline was not found in the pkg-config search path.
Perhaps you should add the directory containing `readline.pc'
to the PKG_CONFIG_PATH environment variable
No package 'readline' found

I have libreadline-dev installed. This is probably the same problem as #39
It looks like flags definition is not provided in Debian https://www.marache.net/post/readline-pc.html

I downloaded the Debian libreadline pkg source, compiled it and copied
cp ./build/readline.pc /usr/share/pkgconfig/readline.pc
Master branch now compiles fine.

Not sure if you want to add a different check or not for readline.

libreadline is required

Hi team!
I am complying dropwatch on Ubuntu 18.04.I have problem when configure:
#./configure
checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3... yes
checking for LIBNLG3... yes
checking for READLINE... no
configure: error: libreadline is required
My server install readline packages:
#apt list --installed | grep -i readline

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libreadline-dev/bionic,now 7.0-3 amd64 [installed]
libreadline5/bionic,now 5.2+dfsg-3build1 amd64 [installed]
libreadline7/bionic,now 7.0-3 amd64 [installed]
php7.2-readline/now 7.2.24-0ubuntu0.18.04.7 amd64 [installed,upgradable to: 7.2.24-0ubuntu0.18.04.9]
readline-common/bionic,bionic,now 7.0-3 all [installed]
#whereis readline
readline: /usr/include/readline /usr/share/readline /usr/share/man/man3/readline.3readline.gz

Why configure dropwatch still notice about missing libreadline?

  • EDIT 1: I have compile & install readline from GNU but it's still not work? Do I missing anything?
    #git clone https://git.savannah.gnu.org/git/readline.git
    #cd readline
    #./configure
    #make
    #make install
  • EDIT 2: After install readline, I tried to copiy readline.pc and readline.pc.in into pkg-config directory. I tried to configure dropwatch again, readline ERROR is gone but I have another error:
    #./configure
    checking for LIBNL3... no
    configure: error: libnl-3.0 is required
    How can I fix this? Please advise me.
  • EDIT 3: I tried to upgrade from Ubuntu 18.04 to Ubuntu 20.04. After that, I tested by command:
    #pkg-config --cflags "readline"
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/readline
  • I tried to compile and install dropwatch again, everything worked fine.

Ubuntu 16.04: configure fails to find libreadline even though installed

Running ./configure on Ubuntu 16.04 (also tried Ubuntu 18 with same result), I get this:

checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3... yes
checking for LIBNLG3... yes
checking for READLINE... no
configure: error: libreadline is required

... yet it is already installed:

$ sudo apt install -y libreadline-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libreadline-dev is already the newest version (7.0-3).
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.

Worked around by commenting out the readline check code in configure and then adding -lreadline to LIBS in src/Makefile, as follows:

LIBS = -lpcap -lreadline

dropwatch not working anymore with latest kernel 5.17.4

Hello,

it seems the CONFIG_NET_DROP_MONITOR option was removed from the kernel config, thus dropwatch is not working anymore(Unable to find NET_DM family, dropwatch can't work).
It looks like that they switched to devlink traps

Does dropwatch need a code update or am I doing something wrong?

TCP InCsumErrors increase but no drop packet report

Hi expert,
First, thanks for this great tool, it's really awesome. I was investigating a server side checksum error issue, each time I curl the server endpoint, the InCsumErrors increase exactly the number (11) that I could observe from client side, the packets(11 packets) are retransmitted. But when I use dropWatch to monitor the process (with both hw and sw set to true), not related drop reported, only below random drop shows up, which looks not like what I expected the 11 packets drop of checksum error. BTW, this is a https request and the server side is a vm on ESXi host.

1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
2 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at tcp_v4_do_rcv+70 (0xffffffffa96e87a0) [software]
1 drops at tcp_v4_rcv+163 (0xffffffffa96e95e3) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
2 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at tcp_v4_do_rcv+70 (0xffffffffa96e87a0) [software]
1 drops at tcp_v4_rcv+163 (0xffffffffa96e95e3) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
2 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
2 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]
1 drops at tcp_v4_do_rcv+70 (0xffffffffa96e87a0) [software]
1 drops at sk_stream_kill_queues+5f (0xffffffffa966364f) [software]

Could you please help? Is there any flag I should turn on or dropWatch cannot detect this kind of error? Thanks a lot!

when i run the dropwatch iam not getting normal output of dropped packets

please solve my error
@nhorman
root@user-HP-Z420-WOrkstation:/home/user/Udhayakumar/DROPWATCH# dropwatch -l kas
Initializing kallsyms db
dropwatch> start
Enabling monitoring..
drop at: ip_rcv_finish_core.isra.0+0x1de/0x440 (0xffffffff96b6294e)
origin: software
input port ifindex: 3
timestamp: Thu Dec 22 13:14:21 2022 005165840 nsec
protocol: 0x800
length: 1358
original length: 1358

drop at: ip_rcv_finish_core.isra.0+0x1de/0x440 (0xffffffff96b6294e)
origin: software
input port ifindex: 3
timestamp: Thu Dec 22 13:14:21 2022 005166271 nsec
protocol: 0x800
length: 1358
original length: 1358

[PETALINUX] Unable to find NET_DM family, dropwatch can't work

I'm trying to use dropwatch on my petalinux installation on Xilinx zcu102 for debugging purposes. I have installed it following the instructions in README.md. However, when I try to run it with "dropwatch -lkas" it gives the following error:
"Unable to find NET_DM family, dropwatch can't work
Cleaning up on socket creation error"
How can this be fixed?

error in make

depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -D_GNU_SOURCE  -g -Wall -Werror -I/usr/include/libnl3 -I/usr/include/libnl3  -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&\
mv -f $depbase.Tpo $depbase.Po
main.c:23:31: fatal error: readline/readline.h: No such file or directory
 #include <readline/readline.h>
                               ^
compilation terminated.
Makefile:422: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1

Got this error when I run make. Does anyone know how I could solve this?

Normal drops?

Hello!
We see two main sources of drops on our server:

33 drops at tcp_v4_do_rcv+8e (0xffffffff8178619e)
413 drops at skb_release_data+b1 (0xffffffff816ea931)
  1. addr2line does not work with those addresses:
# addr2line -f -e /boot/vmlinuz-4.19.30-1.el7.x86_64  0xffffffff816ea931
addr2line: /boot/vmlinuz-4.19.30-1.el7.x86_64: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .bss
??
??:0
# addr2line -f -e /boot/vmlinuz-4.19.30-1.el7.x86_64  0xffffffff8178619e
addr2line: /boot/vmlinuz-4.19.30-1.el7.x86_64: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .bss
??
??:0
  1. I see both functions with perf record -g -a -e skb:kfree_skb -F 100:
java 26982 [026] 330543.363561: skb:kfree_skb: skbaddr=0xffff88803dd83a00 protocol=2048 location=0xffffffff816ea931
        ffffffff816e9c9b kfree_skb+0x7b ([kernel.kallsyms])
        ffffffff816ea931 skb_release_data+0xb1 ([kernel.kallsyms])
        ffffffff816e9bf4 skb_release_all+0x24 ([kernel.kallsyms])
        ffffffff816e9c12 __kfree_skb+0x12 ([kernel.kallsyms])
        ffffffff8176c4dc tcp_recvmsg+0x63c ([kernel.kallsyms])
        ffffffff8179fa89 inet_recvmsg+0x59 ([kernel.kallsyms])
        ffffffff816dcb73 sock_recvmsg+0x43 ([kernel.kallsyms])
        ffffffff816df2c7 __sys_recvfrom+0xe7 ([kernel.kallsyms])
        ffffffff816df368 __x64_sys_recvfrom+0x28 ([kernel.kallsyms])
        ffffffff81004150 do_syscall_64+0x60 ([kernel.kallsyms])
        ffffffff81a00088 entry_SYSCALL_64_after_hwframe+0x44 ([kernel.kallsyms])
            7f4cc6340a8b __libc_recv+0x7b (/usr/lib64/libpthread-2.17.so)

java 26719 [013] 330543.363601: skb:kfree_skb: skbaddr=0xffff88814a72a000 protocol=2048 location=0xffffffff8178619e
        ffffffff816e9c9b kfree_skb+0x7b ([kernel.kallsyms])
        ffffffff8178619e tcp_v4_do_rcv+0x8e ([kernel.kallsyms])
        ffffffff817877ac tcp_v4_rcv+0xa6c ([kernel.kallsyms])
        ffffffff8175cd9f ip_local_deliver_finish+0x9f ([kernel.kallsyms])
        ffffffff8175d3df ip_local_deliver+0x6f ([kernel.kallsyms])
        ffffffff8175cf7b ip_rcv_finish+0x8b ([kernel.kallsyms])
        ffffffff8175d4a6 ip_rcv+0x56 ([kernel.kallsyms])
        ffffffff81702dc7 __netif_receive_skb_one_core+0x57 ([kernel.kallsyms])
        ffffffff81702e28 __netif_receive_skb+0x18 ([kernel.kallsyms])
        ffffffff81702f20 process_backlog+0xb0 ([kernel.kallsyms])
        ffffffff81703709 net_rx_action+0x289 ([kernel.kallsyms])
        ffffffff81c000d1 __softirqentry_text_start+0xd1 ([kernel.kallsyms])
        ffffffff81092198 irq_exit+0xe8 ([kernel.kallsyms])
        ffffffff81a01cd9 do_IRQ+0x59 ([kernel.kallsyms])
        ffffffff81a0098f ret_from_intr+0x0 ([kernel.kallsyms])
        ffffffff810b962d finish_task_switch+0x7d ([kernel.kallsyms])
        ffffffff818736a3 __schedule+0x2b3 ([kernel.kallsyms])
        ffffffff81873ca6 schedule+0x36 ([kernel.kallsyms])
        ffffffff818781d8 schedule_hrtimeout_range_clock+0x128 ([kernel.kallsyms])
        ffffffff81878203 schedule_hrtimeout_range+0x13 ([kernel.kallsyms])
        ffffffff812dad4d ep_poll+0x33d ([kernel.kallsyms])
        ffffffff812daee9 do_epoll_wait+0xb9 ([kernel.kallsyms])
        ffffffff812daf1e __x64_sys_epoll_wait+0x1e ([kernel.kallsyms])
        ffffffff81004150 do_syscall_64+0x60 ([kernel.kallsyms])
        ffffffff81a00088 entry_SYSCALL_64_after_hwframe+0x44 ([kernel.kallsyms])
            7f4cc5c49483 [unknown] (/usr/lib64/libc-2.17.so)
            7f4cb8d3d3a4 [unknown] (/tmp/perf-25546.map)
              6cf805333a [unknown] ([unknown])

If I understood correctly, both cases are not problems as it's just drop of already consumed packet. Am I right? Is it possible to exclude such cases from reporting?

dwdump can't configure drop monitor kernel module

"Failed to configure drop monitor kernel module" is written when providing any option, -o sw or -o hw.

nl_send_sync returns -1, "Unspecific error"

libnl libraries installed:
~/dropwatch$ dpkg -l | grep libnl
ii libnl-3-200:amd64 3.2.27-1ubuntu0.16.04.1 amd64 library for dealing with netlink sockets
ii libnl-3-dev:amd64 3.2.27-1ubuntu0.16.04.1 amd64 development library and headers for libnl-3
ii libnl-genl-3-200:amd64 3.2.27-1ubuntu0.16.04.1 amd64 library for dealing with netlink sockets - generic netlink
ii libnl-genl-3-dev:amd64 3.2.27-1ubuntu0.16.04.1 amd64 development library and headers for libnl-genl-3
ii libnl-route-3-200:amd64 3.2.27-1ubuntu0.16.04.1 amd64 library for dealing with netlink sockets - route interface

kernel:
Linux ubuntu-dev 4.4.0-93-generic #116-Ubuntu SMP Fri Aug 11 21:17:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

`-Werror=format-overflow` failed compilation

I'm compiling on Manjaro (Arch) and running into an issue with compiling:

../../src/lookup_bfd.c: In function ‘lookup_bfd_init’:
../../src/lookup_bfd.c:39:54: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
   39 |         sprintf(dbibuf,"/usr/lib/debug/lib/modules/%s", uts.release);
      |                                                      ^
../../src/lookup_bfd.c:39:9: note: ‘sprintf’ output between 28 and 287 bytes into a destination of size 286
   39 |         sprintf(dbibuf,"/usr/lib/debug/lib/modules/%s", uts.release);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Entirely possible there's an issue with my setup, but wanted to flag this as a potential problem.

License clarification

Hello,

We're included dropwatch for a number of years in Buildroot, but recently noticed a potential licensing issue regarding readline. Can you clarify please? Judging by the lack of "any later version", dropwatch is GPL-2.0 only, but it links against libreadline which is GPL-3.0+.

Those two licenses are not compatible, so that is no good. What is the effective license of dropwatch linked with libreadline supposed to be?

Unable to cross compile for arm

checking pkg-config is at least version 0.9.0... yes
checking for libnl-3.0... yes
checking for libnl-genl-3.0... yes
checking for readline... yes
checking for libpcap... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
configure: dropwatch Version: 1.5.3
configure: Target:
configure: Installation prefix: /usr/local
configure: Compiler: armv7-cortex_a7_v3-linux-gnueabihf-gcc
configure: Compiler flags: -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include/libnl3/
configure: BFD library support: no
INSTALL
make[5]: Entering directory '/home/dek2/sums_gds/sums1/build/CSeriesM7/apps/open-src/dropwatch/dropwatch-master'
Making install in src
make[6]: Entering directory '/home/dek2/sums_gds/sums1/build/CSeriesM7/apps/open-src/dropwatch/dropwatch-master/src'
depbase=echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
armv7-cortex_a7_v3-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -g -Wall -Werror -I/usr/local/include/libnl3 -I/usr/local/include/libnl3 -I/usr/local/include -I/usr/local/include/ncurses -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include/libnl3/ -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo lookup.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
armv7-cortex_a7_v3-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -g -Wall -Werror -I/usr/local/include/libnl3 -I/usr/local/include/libnl3 -I/usr/local/include -I/usr/local/include/ncurses -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include/libnl3/ -MT lookup.o -MD -MP -MF $depbase.Tpo -c -o lookup.o lookup.c &&
mv -f $depbase.Tpo $depbase.Po
depbase=echo lookup_kas.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
armv7-cortex_a7_v3-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -g -Wall -Werror -I/usr/local/include/libnl3 -I/usr/local/include/libnl3 -I/usr/local/include -I/usr/local/include/ncurses -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include/libnl3/ -MT lookup_kas.o -MD -MP -MF $depbase.Tpo -c -o lookup_kas.o lookup_kas.c &&
mv -f $depbase.Tpo $depbase.Po
/bin/sh ../libtool --tag=CC --mode=link armv7-cortex_a7_v3-linux-gnueabihf-gcc -g -Wall -Werror -I/usr/local/include/libnl3 -I/usr/local/include/libnl3 -I/usr/local/include -I/usr/local/include/ncurses -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include -I/home/dek2/sums_gds/sums1/build/CSeriesM7/include/libnl3/ -L/home/dek2/sums_gds/sums1/build/CSeriesM7/lib -lnl-3 -L/usr/local/lib -lnl-genl-3 -lnl-3 -L/home/dek2/sums_gds/sums1/build/CSeriesM7/lib -lncurses -lpcap -o dropwatch main.o lookup.o lookup_kas.o
libtool: link: warning: library /home/dek2/sums_gds/sums1/build/CSeriesM7/lib/libnl-genl-3.la' was moved. libtool: link: cannot find the library /usr/local/lib/libnl-3.la' or unhandled argument `/usr/local/lib/libnl-3.la'
make[6]: *** [Makefile:404: dropwatch] Error 1
make[6]: Leaving directory '/home/dek2/sums_gds/sums1/build/CSeriesM7/apps/open-src/dropwatch/dropwatch-master/src'
make[5]: *** [Makefile:414: install-recursive] Error 1
make[5]: Leaving directory '/home/dek2/sums_gds/sums1/build/CSeriesM7/apps/open-src/dropwatch/dropwatch-master'
make[4]: *** [Makefile:50: install] Error 2
make[4]: Leaving directory '/home/dek2/sums_gds/sums1/apps/open-src/dropwatch'
Populating the /home/dek2/sums_gds/sums1/build/CSeriesM7
Traceback (most recent call last):
File "/home/dek2/sums_gds/sums1/tools/bin/sums_opkg_build.py", line 464, in
sys.exit( main() )
File "/home/dek2/sums_gds/sums1/tools/bin/sums_opkg_build.py", line 458, in main
ExtractOPKG(results.INFOPATH)
File "/home/dek2/sums_gds/sums1/tools/bin/sums_opkg_build.py", line 255, in ExtractOPKG
raise IOError("File %s not found" %(InfoPath))
OSError: File /home/dek2/sums_gds/sums1/build/CSeriesM7/OPKGS/dropwatch.json not found
make[3]: *** [/home/dek2/sums_gds/sums1/mk/sums-OPKG-support.mk:52: populate-dev-sysroot] Error 1
make[3]: Leaving directory '/home/dek2/sums_gds/sums1/apps/open-src/dropwatch'
make[2]: *** [/home/dek2/sums_gds/sums1/build/CSeriesM7/APPSBUILD-qaeqe0_e.mk:31: apps/open-src/dropwatch] Error 2
make[2]: Leaving directory '/home/dek2/sums_gds/sums1'
make[1]: *** [mk/sums_build.mk:17: app] Error 2
make[1]: Leaving directory '/home/dek2/sums_gds/sums1'
make: *** [app] Error 2

Although, libnl-genl-3.la is properly cross compiled and copied to the location

./configure fails to find libreadline

Install deps:

$ sudo apt-get install -y libnl-3-dev libnl-genl-3-dev binutils-dev libreadline6-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libreadline-dev' instead of 'libreadline6-dev'
libnl-3-dev is already the newest version (3.2.29-0ubuntu3).
libnl-genl-3-dev is already the newest version (3.2.29-0ubuntu3).
libreadline-dev is already the newest version (7.0-3).
binutils-dev is already the newest version (2.30-21ubuntu1~18.04.7).
The following package was automatically installed and is no longer required:
  chromium-codecs-ffmpeg-extra
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 182 not upgraded.

Autogen:

$ ./autogen.sh 
+ mkdir -p m4
+ autoreconf -fv --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:9: installing './compile'
configure.ac:8: installing './missing'
src/Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'

Configure fails:

./configure
...
checking for LIBNL3... yes
checking for LIBNLG3... yes
checking for READLINE... no
configure: error: libreadline is required

Find libreadline:

$ find /usr -name libreadline*
/usr/lib/x86_64-linux-gnu/libreadline.a
/usr/lib/x86_64-linux-gnu/libreadline.so
/usr/share/doc/libreadline-dev
/usr/share/doc/libreadline7

Any ideas? Thanks.

New release?

1.5.3 has been released two years ago, and in the meantime several things have been changed or fixed.

For example, the openSUSE Tumbleweed build for s390x is running into a build failure which looks exactly like what what was fixed in commit 2093d1a

Now of course we could include this (and maybe other) upstream commits as patches, but having a new release would make life easier for everybody ;-)

So - can you please provide a 1.5.4 release?

Instructions to build

I would like to run dropwatch on our CI machines to discover packet loss during tests and then find out out where exactly things are droped.

Unfortunately the Readme.md doesn't contain any instructions on how to build this project. Could you maybe add such instructions please?

Cannot find readline lib

After running ./autogen.sh, the ./configure step is complaining about libreadline:

checking for READLINE... no
configure: error: libreadline is required

However, I do have that package installed (v7). I installed it successfully with apt. From apt list, I see

libreadline-dev/bionic,now 7.0-3 amd64 [installed]

I can see libreadline.so and the include directory under /usr/lib/x86_64-linux-gnu and /usr/include, respectively.

Any ideas how I can get configure to see the installl? I'm on Ubuntu 18.04

Thanks

lookup_kas assumes an ordered file

Hi, using your software I noticed an anomalous behavior when using the "-l kas" option, the name resolution is not accurate. The look_kas.c file, assumes that the kallsyms file is sorted, which is not true in my case.

In my case I solved it by creating a new sorted file and used look_kas.c, but a cleaner solution might be useful.

before:
2 drops at __entry_SYSCALL_64_trampoline+1ffbb6b06a7 (0xffffffffbbaaa6a7) [software]

after:
2 drops at unix_stream_connect+587 (0xffffffffbbaaa6a7) [software]

Meaningless error message?

Perhaps this is a non-issue (if so, sorry for the noise), but I wanted to point out that if attempting to look up kernel symbols as a non-privileged user, error messages (which are arguably useless) are interleaved with the output. It looks like we could just add a check to see if errno is non-zero before doing that which would lead to cleaner output. I'll submit a pull request in case that approach is acceptable.

[bholman@coffee src]$ ./dropwatch -l kas
Initializing kallsyms db
dropwatch> start
Enabling monitoring...
Kernel monitoring activated.
Issue Ctrl-C to stop monitoring
Error Scanning File: : Success
2 drops at location 0xffffffff96a76d79 [software]

netlink library required but not checked in configure step

After installing the missing libraries that configure pointed out, 'make' gave this error:

/usr/bin/ld: cannot find -lnl-genl-3

After installing libnl-genl-3-dev, the build completed.

I expected that after configure completed with no errors, the make should also complete with no errors.

build issues on ubuntu 21.10

Probably user error, but figure I'll report this just in case. My system

  • Ubuntu 21.10
  • Linux ubunuc 5.13.0-27-generic #29-Ubuntu SMP Wed Jan 12 17:36:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
  • GNU ld (GNU Binutils for Ubuntu) 2.37
  • GNU Make 4.3

After doing the follow dependency related installs:

  • apt-get install libnl-3-dev
  • apt-get install libnl-genl-3-dev
  • apt-get install libreadline-dev
  • apt-get install libpcap-dev
  • apt-get install binutils-dev

autogen and configure run fine, but make fails with:

make  all-recursive
make[1]: Entering directory '/home/mathias/src/dropwatch'
Making all in src
make[2]: Entering directory '/home/mathias/src/dropwatch/src'
gcc -g -Wall -Werror -I/usr/include/libnl3 -I/usr/include/libnl3 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -g -O2 -lnl-3 -lnl-genl-3 -lnl-3 -lreadline -lpcap -lbfd  -o dropwatch main.o lookup.o lookup_kas.o lookup_bfd.o  
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `handle_dm_config_new_msg':
/home/mathias/src/dropwatch/src/main.c:561: undefined reference to `genlmsg_parse'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:570: undefined reference to `nla_get_u8'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:582: undefined reference to `nla_get_u32'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:585: undefined reference to `nla_get_u32'
/usr/bin/ld: main.o: in function `setup_netlink_socket':
/home/mathias/src/dropwatch/src/main.c:170: undefined reference to `nl_socket_alloc'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:172: undefined reference to `genl_connect'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:174: undefined reference to `genl_ctrl_resolve'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:183: undefined reference to `nl_close'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:184: undefined reference to `nl_socket_free'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:186: undefined reference to `nl_socket_alloc'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:187: undefined reference to `nl_join_groups'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:189: undefined reference to `nl_connect'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:194: undefined reference to `nl_close'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:195: undefined reference to `nl_socket_free'
/usr/bin/ld: main.o: in function `alloc_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:210: undefined reference to `nlmsg_alloc'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:211: undefined reference to `genlmsg_put'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `recv_netlink_message':
/home/mathias/src/dropwatch/src/main.c:280: undefined reference to `nl_recv'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:325: undefined reference to `nlmsg_data'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `recv_netlink_message':
/home/mathias/src/dropwatch/src/main.c:307: undefined reference to `nlmsg_data'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `process_rx_message':
/home/mathias/src/dropwatch/src/main.c:354: undefined reference to `nlmsg_data'
/usr/bin/ld: main.o: in function `print_nested_hw_entry':
/home/mathias/src/dropwatch/src/main.c:366: undefined reference to `nla_parse_nested'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:374: undefined reference to `nla_get_string'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:374: undefined reference to `nla_get_u32'
/usr/bin/ld: main.o: in function `print_nested_hw_entries':
/home/mathias/src/dropwatch/src/main.c:384: undefined reference to `nla_data'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:384: undefined reference to `nla_len'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:384: undefined reference to `nla_next'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:384: undefined reference to `nla_ok'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:385: undefined reference to `nla_type'
/usr/bin/ld: main.o: in function `handle_dm_alert_msg':
/home/mathias/src/dropwatch/src/main.c:404: undefined reference to `nlmsg_data'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:406: undefined reference to `genlmsg_data'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:406: undefined reference to `nla_data'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `handle_dm_alert_msg':
/home/mathias/src/dropwatch/src/main.c:412: undefined reference to `genlmsg_parse'
/usr/bin/ld: main.o: in function `print_nested_port':
/home/mathias/src/dropwatch/src/main.c:443: undefined reference to `nla_parse_nested'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:449: undefined reference to `nla_get_u32'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:453: undefined reference to `nla_get_string'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `handle_dm_packet_alert_msg':
/home/mathias/src/dropwatch/src/main.c:485: undefined reference to `genlmsg_parse'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:490: undefined reference to `nla_get_u64'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:490: undefined reference to `nla_get_string'
/usr/bin/ld: main.o: in function `print_packet_origin':
/home/mathias/src/dropwatch/src/main.c:462: undefined reference to `nla_get_u16'
/usr/bin/ld: main.o: in function `handle_dm_packet_alert_msg':
/home/mathias/src/dropwatch/src/main.c:506: undefined reference to `nla_data'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:507: undefined reference to `nla_len'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:522: undefined reference to `nla_get_u64'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:533: undefined reference to `nla_get_u16'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:536: undefined reference to `nla_len'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:539: undefined reference to `nla_get_u32'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:495: undefined reference to `nla_get_string'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:495: undefined reference to `nla_get_string'
/usr/bin/ld: main.o: in function `print_packet_origin':
/home/mathias/src/dropwatch/src/main.c:462: undefined reference to `nla_get_u16'
/usr/bin/ld: main.o: in function `print_nested_stats':
/home/mathias/src/dropwatch/src/main.c:597: undefined reference to `nla_parse_nested'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:603: undefined reference to `nla_get_u64'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `handle_dm_stats_new_msg':
/home/mathias/src/dropwatch/src/main.c:614: undefined reference to `genlmsg_parse'
/usr/bin/ld: main.o: in function `enable_drop_monitor':
/home/mathias/src/dropwatch/src/main.c:709: undefined reference to `nla_put_flag'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `enable_drop_monitor':
/home/mathias/src/dropwatch/src/main.c:712: undefined reference to `nla_put_flag'
/usr/bin/ld: main.o: in function `disable_drop_monitor':
/home/mathias/src/dropwatch/src/main.c:730: undefined reference to `nla_put_flag'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `disable_drop_monitor':
/home/mathias/src/dropwatch/src/main.c:733: undefined reference to `nla_put_flag'
/usr/bin/ld: main.o: in function `set_alert_mode':
/home/mathias/src/dropwatch/src/main.c:765: undefined reference to `nla_put_u8'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `set_trunc_len':
/home/mathias/src/dropwatch/src/main.c:785: undefined reference to `nla_put_u32'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `set_queue_len':
/home/mathias/src/dropwatch/src/main.c:805: undefined reference to `nla_put_u32'
/usr/bin/ld: main.o: in function `free_netlink_msg':
/home/mathias/src/dropwatch/src/main.c:254: undefined reference to `nlmsg_free'
/usr/bin/ld: main.o: in function `enter_command_line_mode':
/home/mathias/src/dropwatch/src/main.c:865: undefined reference to `readline'
/usr/bin/ld: main.o: in function `send_netlink_message':
/home/mathias/src/dropwatch/src/main.c:265: undefined reference to `nl_send'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:265: undefined reference to `nl_send'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:265: undefined reference to `nl_send'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:265: undefined reference to `nl_send'
/usr/bin/ld: /home/mathias/src/dropwatch/src/main.c:265: undefined reference to `nl_send'
/usr/bin/ld: main.o:/home/mathias/src/dropwatch/src/main.c:265: more undefined references to `nl_send' follow
/usr/bin/ld: main.o: in function `main':
/home/mathias/src/dropwatch/src/main.c:1151: undefined reference to `nl_close'
/usr/bin/ld: lookup_bfd.o: in function `lookup_bfd_init':
/home/mathias/src/dropwatch/src/lookup_bfd.c:48: undefined reference to `bfd_init'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:357: dropwatch] Error 1
make[2]: Leaving directory '/home/mathias/src/dropwatch/src'
make[1]: *** [Makefile:375: all-recursive] Error 1
make[1]: Leaving directory '/home/mathias/src/dropwatch'
make: *** [Makefile:316: all] Error 2

configure.ac:18: error: possibly undefined macro: AC_MSG_ERROR

ubuntu server 20.04

/home/dropwatch/dropwatch-1.5.4# ./autogen.sh
+ mkdir -p m4
+ autoreconf -fv --install
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:18: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:22: error: possibly undefined macro: AC_CHECK_LIB
autoreconf: /usr/bin/autoconf failed with exit status: 1

Receive operation failed:: No buffer space available

Hi!
i'm using dropwatch to debug drops in my system.

I tried launching dropwatch with and without -l kas
I set it with set sw 1 set hw 0 set alertmode packet
Every time i have a drop dropwatch prints:
Receive operation failed:: No buffer space available
if i set sw 0 set hw 1 it prints nothing.
I can i debug this further?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.