Discussion:
[Dnsmasq-discuss] Hint needed: neither patched 'dnsmasq 2.75' nor '2.76test4' will compile
Matthias Fischer
2016-01-05 01:13:26 UTC
Permalink
Hi,

sorry, this will be rather long...

I'm trying to compile 'dnsmasq 2.75' (for use with 'IPFire 2.17 (i586) - core95') with
all available patches but I'm always runnning into errors.
Michael Tremer gave me the hint to ask here.

Building always stops with the exact same errors, regardless if I use
'2.75' with a total of 41 patches by now, or the original '2.75test4'-source.

Log from building '2.75', with 41 patches by now:

***SNIP***
Jan 4 23:34:10: Building dnsmasq dnsmasq-2.75.tar.xz checksum OK
+ cd /usr/src/lfs
+ make -f dnsmasq LFS_BASEDIR=/usr/src install
====================================== Installing dnsmasq-2.75 ...
Install started; saving file list to /usr/src/lsalr ...
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch
patching file CHANGELOG
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch
patching file CHANGELOG
patching file man/dnsmasq.8
patching file src/dnsmasq.h
patching file src/option.c
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch
patching file src/forward.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
patching file src/rfc3315.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
patching file src/network.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch
patching file man/dnsmasq.8
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch
patching file src/dhcp-common.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch
patching file CHANGELOG
patching file src/inotify.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch
patching file src/rfc3315.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
patching file src/dhcp.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch
patching file CHANGELOG
patching file src/cache.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch
patching file src/option.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/forward.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch
patching file src/cache.c
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch
patching file Makefile
patching file bld/Android.mk
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/forward.c
patching file src/rrfilter.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch
patching file src/dnssec.c
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/025-Major_tidy_up_of_EDNS0_handling_and_computation_use_of_udp.patch
patching file src/auth.c
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/forward.c
patching file src/netlink.c
patching file src/rfc1035.c
patching file src/rrfilter.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/026-More_tweaks_in_handling_unknown_DNSSEC_algorithms.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/027-Nasty_rare_and_obscure_off-by-one_in_DNSSEC_hostname_cmp.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/028-Minor_tweak_to_previous_commit.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/029-NSEC3_check_RFC5155_para_8_2.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/030-Split_EDNS0_stuff_into_its_own_source_file.patch
patching file Makefile
patching file bld/Android.mk
patching file src/dnsmasq.h
patching file src/edns0.c
patching file src/rfc1035.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/031-Handle_extending_EDNS0_OPT_RR.patch
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/edns0.c
patching file src/forward.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/032-Truncate_DNS_replies_bigger_512_bytes_that_the_client_isnt_expecting.patch
patching file src/edns0.c
patching file src/forward.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/033-Fix_build_failure_when_DNSSEC_code_omitted.patch
patching file src/dnsmasq.h
patching file src/edns0.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/034-Log_signature_algo_with_DNSKEY_and_DS_also_digest_with_DS.patch
patching file src/cache.c
patching file src/dnsmasq.h
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/035-More_EDNS0_packet_size_tweaks.patch
patching file src/dnsmasq.c
patching file src/dnsmasq.h
patching file src/forward.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/036-Cache_access_to_the_kernels_ARP_table.patch
patching file Makefile
patching file bld/Android.mk
patching file src/arp.c
patching file src/dhcp6.c
patching file src/dnsmasq.h
patching file src/edns0.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/037-First_complete_version_of_DNS-client-id_EDNS0_and_ARP_tracking_code.patch
patching file src/arp.c
patching file src/config.h
patching file src/dhcp6.c
patching file src/dns-protocol.h
patching file src/dnsmasq.c
patching file src/dnsmasq.h
patching file src/dnssec.c
patching file src/edns0.c
patching file src/forward.c
patching file src/helper.c
patching file src/option.c
patching file src/rfc3315.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/038-Correct_logic_for_when_to_start_helper.patch
patching file src/dnsmasq.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/039-Trivial_code_tweak.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/040-Fix_datatype-sixe_botch_which_broke_DNSSEC_sig_timestamps_when_far_in_the_future.patch
patching file src/dnssec.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/041-Fix_botch_in_new_arp-cache_linked-list_code_resulting_in_100percent_CPU_spin.patch
patching file src/arp.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
patching file src/cache.c
patching file src/dnsmasq.c
Hunk #1 succeeded at 990 (offset 8 lines).
patching file src/dnsmasq.h
patching file src/isc.c
patching file src/option.c
Hunk #1 succeeded at 1757 (offset 3 lines).
patching file Makefile
cd /usr/src/dnsmasq-2.75 && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
cd /usr/src/dnsmasq-2.75 && make CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer" COPTS="-DHAVE_ISC_READER -DNO_INOTIFY" \
PREFIX=/usr all install
make[1]: Entering directory '/usr/src/dnsmasq-2.75'
make[2]: Entering directory '/usr/src/dnsmasq-2.75/src'
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c cache.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c rfc1035.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c util.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c option.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c forward.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c network.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dnsmasq.c
dnsmasq.c: In function 'main':
dnsmasq.c:922:7: warning: implicit declaration of function 'do_script_run' [-Wimplicit-function-declaration]
while (helper_buf_empty() && do_script_run(now));
^
dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable]
int did_bind = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dhcp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c lease.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c rfc2131.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c netlink.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dbus.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c bpf.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c helper.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c tftp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c log.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c conntrack.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dhcp6.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c rfc3315.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dhcp-common.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c outpacket.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c radv.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c slaac.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c auth.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c ipset.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c domain.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dnssec.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c blockdata.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c tables.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c loop.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c inotify.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c poll.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c rrfilter.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c edns0.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c arp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c isc.c
isc.c: In function 'dhcp_lease_new':
isc.c:40:3: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
^
cc -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o rrfilter.o edns0.o arp.o isc.o -lidn -lnettle -lhogweed -lgmp
dnsmasq.o: In function `main':
dnsmasq.c:(.text.startup+0xa55): undefined reference to `do_script_run'
dnsmasq.o: In function `.L273':
dnsmasq.c:(.text.startup+0x12e8): undefined reference to `do_script_run'
collect2: error: ld returned 1 exit status
/usr/src/dnsmasq-2.75/Makefile:160: recipe for target 'dnsmasq' failed
make[2]: *** [dnsmasq] Error 1
make[2]: Leaving directory '/usr/src/dnsmasq-2.75/src'
Makefile:83: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/dnsmasq-2.75'
dnsmasq:74: recipe for target '/usr/src/log/dnsmasq-2.75' failed
make: *** [/usr/src/log/dnsmasq-2.75] Error 2
***SNAP***

Log from building '2.76test4':

***SNIP***
Jan 4 22:46:25: Building dnsmasq dnsmasq-2.76test4.tar.xz checksum OK
+ cd /usr/src/lfs
+ make -f dnsmasq LFS_BASEDIR=/usr/src install
====================================== Installing dnsmasq-2.76test4 ...
Install started; saving file list to /usr/src/lsalr ...
cd /usr/src/dnsmasq-2.76test4 && patch -Np1 -i /usr/src/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
patching file src/cache.c
patching file src/dnsmasq.c
Hunk #1 succeeded at 990 (offset 8 lines).
patching file src/dnsmasq.h
patching file src/isc.c
patching file src/option.c
Hunk #1 succeeded at 1757 (offset 3 lines).
patching file Makefile
cd /usr/src/dnsmasq-2.76test4 && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
cd /usr/src/dnsmasq-2.76test4 && make CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer" COPTS="-DHAVE_ISC_READER -DNO_INOTIFY" \
PREFIX=/usr all install
make[1]: Entering directory '/usr/src/dnsmasq-2.76test4'
make[2]: Entering directory '/usr/src/dnsmasq-2.76test4/src'
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c cache.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c rfc1035.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c util.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c option.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c forward.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c network.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dnsmasq.c
dnsmasq.c: In function 'main':
dnsmasq.c:922:7: warning: implicit declaration of function 'do_script_run' [-Wimplicit-function-declaration]
while (helper_buf_empty() && do_script_run(now));
^
dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable]
int did_bind = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dhcp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c lease.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c rfc2131.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c netlink.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dbus.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c bpf.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c helper.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c tftp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c log.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c conntrack.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dhcp6.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c rfc3315.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dhcp-common.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c outpacket.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c radv.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c slaac.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c auth.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c ipset.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c domain.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dnssec.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c blockdata.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c tables.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c loop.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c inotify.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c poll.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c rrfilter.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c edns0.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c arp.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c isc.c
isc.c: In function 'dhcp_lease_new':
isc.c:40:3: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
^
cc -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o rrfilter.o edns0.o arp.o isc.o -lidn -lnettle -lhogweed -lgmp
dnsmasq.o: In function `main':
dnsmasq.c:(.text.startup+0xa55): undefined reference to `do_script_run'
dnsmasq.o: In function `.L273':
dnsmasq.c:(.text.startup+0x12e8): undefined reference to `do_script_run'
collect2: error: ld returned 1 exit status
/usr/src/dnsmasq-2.76test4/Makefile:160: recipe for target 'dnsmasq' failed
make[2]: *** [dnsmasq] Error 1
make[2]: Leaving directory '/usr/src/dnsmasq-2.76test4/src'
Makefile:83: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/dnsmasq-2.76test4'
dnsmasq:74: recipe for target '/usr/src/log/dnsmasq-2.76test4' failed
make: *** [/usr/src/log/dnsmasq-2.76test4] Error 2
***SNAP***

Disabling our ISC DHCP patch made no difference.

I'm compiling on "Linux version 3.13.0-74-generic (***@lcy01-08) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #118-Ubuntu SMP" and never had problems like this before.

I would be grateful, if anyone got a hint since my programming skills are not so...~extensive... ;-)

Best,
Matthias--
tails, linux, USB, CD, secure desktop, IRC, truecrypt, tor, onion
Lonnie Abelbeck
2016-01-05 16:05:42 UTC
Permalink
Post by Matthias Fischer
Hi,
sorry, this will be rather long...
I'm trying to compile 'dnsmasq 2.75' (for use with 'IPFire 2.17 (i586) - core95') with
all available patches but I'm always runnning into errors.
...
Post by Matthias Fischer
cd /usr/src/dnsmasq-2.76test4 && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
cd /usr/src/dnsmasq-2.76test4 && make CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer" COPTS="-DHAVE_ISC_READER -DNO_INOTIFY" \
PREFIX=/usr all install
make[1]: Entering directory '/usr/src/dnsmasq-2.76test4'
...
dnsmasq.c
dnsmasq.c:922:7: warning: implicit declaration of function 'do_script_run' [-Wimplicit-function-declaration]
while (helper_buf_empty() && do_script_run(now));
^
Hi Matthias,

It seems you have disabled HAVE_DHCP with enabled HAVE_SCRIPT.

Try disabling HAVE_SCRIPT in your build system...
--
-e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
--

Lonnie
Matthias Fischer
2016-01-05 16:29:58 UTC
Permalink
Hi,
Post by Lonnie Abelbeck
Hi Matthias,
It seems you have disabled HAVE_DHCP with enabled HAVE_SCRIPT.
Try disabling HAVE_SCRIPT in your build system...
--
-e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
--
Thanks, but sorry, it seems that this worked only partially:

***SNIP***
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq/041-Fix_botch_in_new_arp-cache_linked-list_code_resulting_in_100percent_CPU_spin.patch
patching file src/arp.c
cd /usr/src/dnsmasq-2.75 && patch -Np1 -i /usr/src/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
patching file src/cache.c
patching file src/dnsmasq.c
patching file src/dnsmasq.h
patching file src/isc.c
patching file src/option.c
patching file Makefile
cd /usr/src/dnsmasq-2.75 && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
cd /usr/src/dnsmasq-2.75 && make CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer" COPTS="-DHAVE_ISC_READER -DNO_INOTIFY" \
PREFIX=/usr all install
make[1]: Entering directory '/usr/src/dnsmasq-2.75'
make[2]: Entering directory '/usr/src/dnsmasq-2.75/src'
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c cache.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c rfc1035.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c util.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c option.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c forward.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c network.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dnsmasq.c
dnsmasq.c: In function 'main':
dnsmasq.c:933:7: warning: implicit declaration of function 'do_script_run' [-Wimplicit-function-declaration]
while (do_script_run(now));
^
dnsmasq.c:934:14: error: too many arguments to function 'do_arp_script_run'
while (do_arp_script_run(now));
^
In file included from dnsmasq.c:20:0:
dnsmasq.h:1534:5: note: declared here
int do_arp_script_run(void);
^
dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable]
int did_bind = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
/usr/src/dnsmasq-2.75/Makefile:157: recipe for target 'dnsmasq.o' failed
make[2]: *** [dnsmasq.o] Error 1
make[2]: Leaving directory '/usr/src/dnsmasq-2.75/src'
Makefile:83: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/dnsmasq-2.75'
dnsmasq:74: recipe for target '/usr/src/log/dnsmasq-2.75' failed
make: *** [/usr/src/log/dnsmasq-2.75] Error 2
***SNAP***

The only thing that disappeared where the 'warning' about 'isc.c':

...
isc.c: In function 'dhcp_lease_new':
isc.c:40:3: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
^
...

This no longer shows up.

If it helps, this is the lfs-file I'm using right now:

***SNIP***
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2015 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################

###############################################################################
# Definitions
###############################################################################

include Config

VER = 2.75

THISAPP = dnsmasq-$(VER)
DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)

# We cannot use INOTIFY because our ISC reader code does not support that
COPTS = -DHAVE_ISC_READER -DNO_INOTIFY

###############################################################################
# Top-level Rules
###############################################################################

objects = $(DL_FILE)

$(DL_FILE) = $(DL_FROM)/$(DL_FILE)

$(DL_FILE)_MD5 = 887236f1ddde6eb57cdb9d01916c9f72

install : $(TARGET)

check : $(patsubst %,$(DIR_CHK)/%,$(objects))

download :$(patsubst %,$(DIR_DL)/%,$(objects))

md5 : $(subst %,%_MD5,$(objects))

###############################################################################
# Downloading, checking, md5sum
###############################################################################

$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)

$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)

$(subst %,%_MD5,$(objects)) :
@$(MD5)

###############################################################################
# Installation Details
###############################################################################

$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/025-Major_tidy_up_of_EDNS0_handling_and_computation_use_of_udp.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/026-More_tweaks_in_handling_unknown_DNSSEC_algorithms.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/027-Nasty_rare_and_obscure_off-by-one_in_DNSSEC_hostname_cmp.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/028-Minor_tweak_to_previous_commit.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/029-NSEC3_check_RFC5155_para_8_2.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/030-Split_EDNS0_stuff_into_its_own_source_file.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/031-Handle_extending_EDNS0_OPT_RR.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/032-Truncate_DNS_replies_bigger_512_bytes_that_the_client_isnt_expecting.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/033-Fix_build_failure_when_DNSSEC_code_omitted.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/034-Log_signature_algo_with_DNSKEY_and_DS_also_digest_with_DS.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/035-More_EDNS0_packet_size_tweaks.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/036-Cache_access_to_the_kernels_ARP_table.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/037-First_complete_version_of_DNS-client-id_EDNS0_and_ARP_tracking_code.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/038-Correct_logic_for_when_to_start_helper.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/039-Trivial_code_tweak.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/040-Fix_datatype-sixe_botch_which_broke_DNSSEC_sig_timestamps_when_far_in_the_future.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/041-Fix_botch_in_new_arp-cache_linked-list_code_resulting_in_100percent_CPU_spin.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch

cd $(DIR_APP) && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'

cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" \
PREFIX=/usr all install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
***SNAP***

Best,
Matthias
Lonnie Abelbeck
2016-01-05 17:18:57 UTC
Permalink
Hi,
Post by Lonnie Abelbeck
Hi Matthias,
It seems you have disabled HAVE_DHCP with enabled HAVE_SCRIPT.
Try disabling HAVE_SCRIPT in your build system...
--
-e 's|#define HAVE_SCRIPT|//#define HAVE_SCRIPT|g' \
--
When you disable HAVE_DHCP then do_script_run() is no longer defined in lease.c .

So this section needs needs a #ifdef HAVE_DHCP ... #endif, either in whole or in pieces. As 2.75 (original) did.

-- dnsmasq.c [4ab56f1610750f16ef2afb86a369406f3aa906c3] --
921 #ifdef HAVE_SCRIPT
922 while (helper_buf_empty() && do_script_run(now));
923 while (helper_buf_empty() && do_arp_script_run());
924
925 # ifdef HAVE_TFTP
926 while (helper_buf_empty() && do_tftp_script_run());
927 # endif
928
929 if (!helper_buf_empty())
930 poll_listen(daemon->helperfd, POLLOUT);
931 #else
932 /* need this for other side-effects */
933 while (do_script_run(now));
934 while (do_arp_script_run(now));
935
936 # ifdef HAVE_TFTP
937 while (do_tftp_script_run());
938 # endif
939
940 #endif
--
Also the do_arp_script_run() has inconstant args (ie. remove "now").

Also HAVE_DHCP possibly here ?...
--
1315 #if defined(HAVE_SCRIPT)
1316 /* handle pending lease transitions */
1317 if (daemon->helperfd != -1)
1318 {
1319 /* block in writes until all done */
1320 if ((i = fcntl(daemon->helperfd, F_GETFL)) != -1)
1321 fcntl(daemon->helperfd, F_SETFL, i & ~O_NONBLOCK);
1322 do {
1323 helper_write();
1324 } while (!helper_buf_empty() || do_script_run(now));
1325 while (retry_send(close(daemon->helperfd)));
1326 }
1327 #endif
--

Simon knows best on how to fix this.

I suspect disabling HAVE_DHCP is somewhat unusual, hence you are hitting these issues.

Alternatively, you could build with HAVE_DHCP, disable HAVE_DHCP6 (leave HAVE_SCRIPT the default) and then disable (don't enable) dhcp at runtime via your /etc/dnsmasq.conf .

Lonnie
Matthias Andree
2016-01-05 19:11:59 UTC
Permalink
Post by Matthias Fischer
Hi,
sorry, this will be rather long...
I'm trying to compile 'dnsmasq 2.75' (for use with 'IPFire 2.17 (i586) - core95') with
all available patches but I'm always runnning into errors.
Michael Tremer gave me the hint to ask here.
Building always stops with the exact same errors, regardless if I use
'2.75' with a total of 41 patches by now, or the original
'2.75test4'-source.
Does either compile without third-party patches?
Matthias Fischer
2016-01-05 20:01:41 UTC
Permalink
Hi,
Post by Matthias Andree
Post by Matthias Fischer
Building always stops with the exact same errors, regardless if I use
'2.75' with a total of 41 patches by now, or the original
'2.75test4'-source.
Does either compile without third-party patches?
Until now, it made no difference compiling "2.75" with *all* patches or
"2.76test4" without them: errors remain, building stops.

I tried "2.76test4" yesterday:

***SNIP***
Jan 4 22:46:25: Building dnsmasq dnsmasq-2.76test4.tar.xz checksum OK
+ cd /usr/src/lfs
+ make -f dnsmasq LFS_BASEDIR=/usr/src install
====================================== Installing dnsmasq-2.76test4 ...
Install started; saving file list to /usr/src/lsalr ...
cd /usr/src/dnsmasq-2.76test4 && patch -Np1 -i /usr/src/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
patching file src/cache.c
patching file src/dnsmasq.c
Hunk #1 succeeded at 990 (offset 8 lines).
patching file src/dnsmasq.h
patching file src/isc.c
patching file src/option.c
Hunk #1 succeeded at 1757 (offset 3 lines).
patching file Makefile
cd /usr/src/dnsmasq-2.76test4 && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'
cd /usr/src/dnsmasq-2.76test4 && make CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer" COPTS="-DHAVE_ISC_READER -DNO_INOTIFY" \
PREFIX=/usr all install
make[1]: Entering directory '/usr/src/dnsmasq-2.76test4'
make[2]: Entering directory '/usr/src/dnsmasq-2.76test4/src'
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c cache.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c rfc1035.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c util.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c option.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c forward.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c network.c
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.76test4"' -c dnsmasq.c
dnsmasq.c: In function 'main':
dnsmasq.c:922:7: warning: implicit declaration of function 'do_script_run' [-Wimplicit-function-declaration]
while (helper_buf_empty() && do_script_run(now));
^
dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable]
int did_bind = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
***SNAP***

Right now "2.75 + patches" is building after I removed:

...
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
...

Best,
Matthias
Matthias Andree
2016-01-05 20:55:03 UTC
Permalink
Post by Matthias Fischer
Hi,
Post by Matthias Andree
Post by Matthias Fischer
Building always stops with the exact same errors, regardless if I use
'2.75' with a total of 41 patches by now, or the original
'2.75test4'-source.
Does either compile without third-party patches?
Until now, it made no difference compiling "2.75" with *all* patches or
"2.76test4" without them: errors remain, building stops.
***SNIP***
Jan 4 22:46:25: Building dnsmasq dnsmasq-2.76test4.tar.xz checksum OK
+ cd /usr/src/lfs
+ make -f dnsmasq LFS_BASEDIR=/usr/src install
====================================== Installing dnsmasq-2.76test4 ...
Install started; saving file list to /usr/src/lsalr ...
cd /usr/src/dnsmasq-2.76test4 && patch -Np1 -i
/usr/src/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
That's not "without all patches".

However, I can reproduce the issue on a vanilla 2.76test4, apparently an
#undef HAVE_DHCP isn't properly supported in 2.76test4.

Simon, do you need to comment out the do_script_run() calls in
dnsmasq.c::main(), or does the do_script_run() need to remain enabled?
Minimum command to reproduce the issue on a pristine 2.76test4:

sed -i src/config.h -e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
&& make -j4
Matthias Fischer
2016-01-05 21:21:51 UTC
Permalink
Hi,
Post by Matthias Andree
That's not "without all patches".
Sorry, you're right of course...

But as far as I know, the ISC patch is needed for IPFire.

Best,
Matthias
Simon Kelley
2016-01-06 18:04:19 UTC
Permalink
Post by Matthias Andree
However, I can reproduce the issue on a vanilla 2.76test4,
apparently an #undef HAVE_DHCP isn't properly supported in
2.76test4.
Simon, do you need to comment out the do_script_run() calls in
dnsmasq.c::main(), or does the do_script_run() need to remain
enabled? Minimum command to reproduce the issue on a pristine
sed -i src/config.h -e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g'
\ && make -j4
The do_script_run calls need to be removed from the compilation when
DHCP is not included. Since the scripting system used to just about
DHCP events, it was automatically removed from the compilation when
DHCP was removed. Now the script system handles tftp and (in the
latest code) ARP events, so it's no longer conditional on DHCP being
included. This is fall-out from that change.

Conditional combination has a nasty combinatorial explosion. I should
hack up a regression test to build all possible variants.

Fix pushed to git.

Cheers,

Simon.
Lonnie Abelbeck
2016-01-06 19:39:50 UTC
Permalink
Post by Simon Kelley
The do_script_run calls need to be removed from the compilation when
DHCP is not included. Since the scripting system used to just about
DHCP events, it was automatically removed from the compilation when
DHCP was removed. Now the script system handles tftp and (in the
latest code) ARP events, so it's no longer conditional on DHCP being
included. This is fall-out from that change.
Conditional combination has a nasty combinatorial explosion. I should
hack up a regression test to build all possible variants.
Fix pushed to git.
http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blobdiff;f=src/dnsmasq.c;h=5cbfdbdf28cf1d03d95e50308107ee3225852c3b;hp=4ab56f1610750f16ef2afb86a369406f3aa906c3;hb=53a9173fc0b36d9427adb4ee9ac44df425717e84;hpb=d917275e481add809cd5c40650f339ae994ee35f

Simon, do_arp_script_run() does not have arguments, shouldn't ... ?

- while (do_arp_script_run(now));
+ while (do_arp_script_run());

Lonnie
Simon Kelley
2016-01-06 22:52:29 UTC
Permalink
Good call. Fixed now.


Cheers,

Simon.
Post by Lonnie Abelbeck
Simon, do_arp_script_run() does not have arguments, shouldn't ... ?
- while (do_arp_script_run(now)); + while (do_arp_script_run());
Lonnie
Matthias Fischer
2016-01-07 19:51:36 UTC
Permalink
Hi,

many thanks! - with the last two patches the build ran through.

But to be complete, two "warnings" still remain:

I'm using these options from IPFire GIT while building 'dnsmasq' (the latest
'lfs'-file and 'dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch'
are attached, all other patches are *original* from 'thekelleys.org'):

***SNIP***
...
# We cannot use INOTIFY because our ISC reader code does not support that
COPTS = -DHAVE_ISC_READER -DNO_INOTIFY
...

cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/043-Update_copyright_notices_Happy_new_year.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/044-Fix_FTBFS_when_scripts_excluded_at_compilation_time.patch
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch

cd $(DIR_APP) && sed -i src/config.h \
-e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
-e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
-e 's|#define HAVE_DHCP|//#define HAVE_DHCP|g' \
-e 's|#define HAVE_DHCP6|//#define HAVE_DHCP6|g' \
-e 's|#define HAVE_TFTP|//#define HAVE_TFTP|g'

cd $(DIR_APP) && make CFLAGS="$(CFLAGS)" COPTS="$(COPTS)" \
PREFIX=/usr all install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
***SNAP***

Build was finished, new version is running, but I'm still getting two
warnings during compilation whose importance or possible consequences
I can't rate:

***SNIP***
...
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dnsmasq.c
dnsmasq.c: In function 'main':
dnsmasq.c:55:7: warning: unused variable 'did_bind' [-Wunused-variable]
int did_bind = 0;
^
dnsmasq.c:54:9: warning: unused variable 'bound_device' [-Wunused-variable]
char *bound_device = NULL;
^
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c dhcp.c
.
.
.
cc -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC -fstack-protector-all --param=ssp-buffer-size=4 -march=i586 -mtune=generic -fomit-frame-pointer -DHAVE_ISC_READER -DNO_INOTIFY -DVERSION='"2.75"' -c isc.c
isc.c: In function 'dhcp_lease_new':
isc.c:40:3: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result]
asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
^
cc -o dnsmasq cache.o rfc1035.o util.o option.o forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o rrfilter.o edns0.o arp.o isc.o -lidn -lnettle -lhogweed -lgmp
make[2]: Leaving directory '/usr/src/dnsmasq-2.75/src'
...
***SNAP***

Furthermore from time to time we get several forum postings and mails
about sudden crashes and 'segmentation faults' of 'dnsmasq' as described
here from 'Rodolico' (Mail, ***@lists.ipfire.org) or 'sideeffect
(IPFire Forum):

***SNIP***
'Rodolico':
"I just had it break on me. It lasted longer than the last time, but
dnsmasq just broke on me.

Basically, the same error message. This is dnsmasq_275_2015_12_24 which
I got from Matthias, I think.

Jan 3 01:25:43 dd-router kernel: dnsmasq[26066]: segfault at 0 ip
0805d4ae sp 5a8252d0 error 4 in dnsmasq[8048000+34000]
Jan 3 01:25:43 dd-router kernel: grsec: Segmentation fault occurred at
(nil) in /usr/sbin/dnsmasq[dnsmasq:26066] uid/euid:99/99
gid/egid:40/40, parent /sbin/init[init:1] uid/euid:0/0 gid/egid:0/0
Jan 3 01:25:43 dd-router kernel: grsec: bruteforce prevention initiated
due to crash of /usr/sbin/dnsmasq against uid 99, banning suid/sgid
execs for 15 minutes. Please investigate the crash report for
/usr/sbin/dnsmasq[dnsmasq:26066] uid/euid:99/99 gid/egid:40/40, parent
/sbin/init[init:1] uid/euid:0/0 gid/egid:0/0

I'm guessing on my client machines I need to write an fcron job to check
it and bring it back up if it dies."

'sideeffect':
"Some web pages like ipfire forums taking ages to load.
I have to disable DNSSEC like in previous build.
All the problems go away with ENABLE_DNSSEC=0 in dnsmasq."
***SNAP***

Sorry, if this is a stupid question but since I'm not able to reproduce
these crashes and because we're trying to get a grip on this:

Could it be that those errors are related to the problems with seg faults
and DNSSEC sites?

Best,
Matthias
Post by Lonnie Abelbeck
Post by Simon Kelley
The do_script_run calls need to be removed from the compilation when
DHCP is not included. Since the scripting system used to just about
DHCP events, it was automatically removed from the compilation when
DHCP was removed. Now the script system handles tftp and (in the
latest code) ARP events, so it's no longer conditional on DHCP being
included. This is fall-out from that change.
Conditional combination has a nasty combinatorial explosion. I should
hack up a regression test to build all possible variants.
Fix pushed to git.
http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blobdiff;f=src/dnsmasq.c;h=5cbfdbdf28cf1d03d95e50308107ee3225852c3b;hp=4ab56f1610750f16ef2afb86a369406f3aa906c3;hb=53a9173fc0b36d9427adb4ee9ac44df425717e84;hpb=d917275e481add809cd5c40650f339ae994ee35f
Simon, do_arp_script_run() does not have arguments, shouldn't ... ?
- while (do_arp_script_run(now));
+ while (do_arp_script_run());
Lonnie
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...