From 0f86cd6c1dcc2129285e6081751bae3a53058aeb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 22 Apr 2014 13:42:19 +0200 Subject: conf: Use configuration file path from Makefile instead of hardcoded paths Currently, the path to the configuration files is hardcoded to $PREFIX/etc/netsniff-ng. If we want to keep the configuration files outside of prefix (e.g. during development), we need to pass the complete path as specified in $ETCDIRE (and $ETCDIR respectively, which could e.g. be overriden on the command line during build install) as a preprocessor define. This way, we can e.g. install the configuration files to /etc while installing the binaries in /usr/local with: $ make PREFIX=/usr/local ETCDIR=/etc $ make PREFIX=/usr/local ETCDIR=/etc install Signed-off-by: Tobias Klauser --- dissector_eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dissector_eth.c') diff --git a/dissector_eth.c b/dissector_eth.c index 3beff72..4a696c5 100644 --- a/dissector_eth.c +++ b/dissector_eth.c @@ -119,15 +119,15 @@ static void dissector_init_ports(enum ports which) switch (which) { case PORTS_UDP: - file = PREFIX_STRING "/etc/netsniff-ng/udp.conf"; + file = ETCDIRE_STRING "/udp.conf"; table = ð_ports_udp; break; case PORTS_TCP: - file = PREFIX_STRING "/etc/netsniff-ng/tcp.conf"; + file = ETCDIRE_STRING "/tcp.conf"; table = ð_ports_tcp; break; case PORTS_ETHER: - file = PREFIX_STRING "/etc/netsniff-ng/ether.conf"; + file = ETCDIRE_STRING "/ether.conf"; table = ð_ether_types; break; default: -- cgit v1.2.3-54-g00ecf