hello, I'm not going to comment on the patch itself, just note that dnsmasq
init script already checks for another dhcp server in the network
(dnsmasq.init:346):
udhcpc -n -q -s /bin/true -t 1 -i $ifname >&- && {
logger -t dnsmasq \
"found already running DHCP-server on interface '$ifname'" \
"refusing to start, use 'option force 1' to override"
return 0
}
perhaps this approach is enough to your use case?
2012/11/3 Sebastian Muszynski <[email protected]>
> **
>
>
>
> This small tool provides an opportunity for a system administrator to
>
> perform a DHCP request to find out if a DHCP server is still running.
>
>
>
> Signed-off-by: Sebastian Muszynski <[email protected]>
>
>
>
> ---
>
>
>
> Index: feeds/packages/net/dhcping/patches/dhcping-getopt.patch
>
> ===================================================================
>
> --- feeds/packages/net/dhcping/patches/dhcping-getopt.patch (Revision 0)
>
> +++ feeds/packages/net/dhcping/patches/dhcping-getopt.patch (Revision 0)
>
> @@ -0,0 +1,11 @@
>
> +--- dhcping-1.2.orig/dhcping.c 2002-01-27 03:18:58.000000000 +0100
>
> ++++ dhcping-1.2/dhcping.c 2012-11-03 17:45:24.000000000 +0100
>
> +@@ -70,7 +70,7 @@
>
> + int maxwait=3;
>
> +
>
> + void doargs(int argc,char **argv) {
>
> +- char ch;
>
> ++ int ch;
>
> +
>
> + inform=request=verbose=VERBOSE=quiet=0;
>
> + ci=gi=server="0.0.0.0";
>
> Index: feeds/packages/net/dhcping/Makefile
>
> ===================================================================
>
> --- feeds/packages/net/dhcping/Makefile (Revision 0)
>
> +++ feeds/packages/net/dhcping/Makefile (Revision 0)
>
> @@ -0,0 +1,34 @@
>
> +include $(TOPDIR)/rules.mk
>
> +
>
> +PKG_NAME:=dhcping
>
> +PKG_VERSION:=1.2
>
> +PKG_RELEASE:=1
>
> +
>
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
>
> +PKG_SOURCE_URL:=http://www.mavetju.org/download/
>
> +PKG_MD5SUM:=c4b22bbf3446c8567e371c40aa552d5d
>
> +
>
> +include $(INCLUDE_DIR)/package.mk
>
> +
>
> +define Package/dhcping
>
> + SECTION:=net
>
> + CATEGORY:=Network
>
> + TITLE:=DHCP Daemon Ping Program
>
> +endef
>
> +
>
> +define Package/dhcping/description
>
> +This small tool provides an opportunity for a system administrator to
>
> +perform a DHCP request to find out if a DHCP server is still running.
>
> +endef
>
> +
>
> +#TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
>
> +#TARGET_CFLAGS += -ggdb3
>
> +#CMAKE_OPTIONS += -DDEBUG=1
>
> +
>
> +define Package/dhcping/install
>
> + $(INSTALL_DIR) $(1)/usr/sbin
>
> + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcping $(1)/usr/sbin/
>
> +endef
>
> +
>
> +$(eval $(call BuildPackage,dhcping))
>
> +
>
>
>
>
>
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>
>
--
Jonh Wendell
http://www.bani.com.br
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel