Ralf S. Engelschall 23 лет назад
Родитель
Сommit
71e5bf4f4c
3 измененных файлов с 31 добавлено и 40 удалено
  1. 21 20
      arpd/arpd.spec
  2. 2 2
      arpd/fsl.arpd
  3. 8 18
      arpd/rc.arpd

+ 21 - 20
arpd/arpd.spec

@@ -23,12 +23,12 @@
 ##  SUCH DAMAGE.
 ##
 
-# FIXME: On FreeBSD arpd is not starting
-# FIXME: Log is not written
+#   FIXME: On FreeBSD arpd is not starting
+#   FIXME: Log is not written
 
 #   package information
 Name:         arpd
-Summary:      Arpd
+Summary:      Address Resolution Protocol (ARP) Reply Daemon
 URL:          http://www.citi.umich.edu/u/provos/honeyd/
 Vendor:       Niels Provos, Dug Song
 Packager:     The OpenPKG Project
@@ -36,23 +36,29 @@ Distribution: OpenPKG [EVAL]
 Group:        Network
 License:      GNU
 Version:      0.2
-Release:      20030311
+Release:      20030314
 
 #   list of sources
 Source0:      http://www.citi.umich.edu/u/provos/honeyd/arpd-%{version}.tar.gz
-#Source1:      rc.arpd
+Source1:      rc.arpd
 
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20030310, libdnet,libpcap, libevent, fsl
+BuildPreReq:  OpenPKG, openpkg >= 20030310, fsl, gcc, libdnet, libpcap, libevent
 PreReq:       OpenPKG, openpkg >= 20030310, fsl
 AutoReq:      no
 AutoReqProv:  no
 
 %description
-     Arpd
-
+    Arpd is an Address Resolution Protocol (ARP) daemon which replies to
+    any ARP request for an IP address matching the specified destination
+    network with the hardware MAC address of the own interface, but only
+    after determining if another host already claims it. Any IP address
+    claimed by arpd is eventually forgotten after a period of inactivity
+    or after a hard timeout, and is relinquished if the real owner shows
+    up. This enables a single host to claim all unassigned addresses on
+    a LAN for network monitoring or simulation.
 
 %prep
     %setup -q -n arpd
@@ -60,15 +66,10 @@ AutoReqProv:  no
 %build
     %{l_shtool} subst \
         -e 's;/var/run/arpd.pid;%{l_prefix}/var/arpd/arpd.pid;' \
-        arpd.c
-
-    %{l_shtool} subst \
-        -e 's;/var/run/arpd.pid;%{l_prefix}/var/arpd/arpd.pid;' \
-        arpd.8
-
+        arpd.c arpd.8
     CC="%{l_cc}" \
-    CFLAGS="%{l_cflags -O} `%{l_prefix}/bin/fsl-config --all --cflags`" \
-    CPPFLAGS="%{l_cppflags} `%{l_prefix}/bin/fsl-config --all --cflags`" \
+    CFLAGS="%{l_cflags -O}" \
+    CPPFLAGS="%{l_cppflags}" \
     LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --all --ldflags`" \
     LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
     ./configure \
@@ -76,7 +77,7 @@ AutoReqProv:  no
         --with-libdnet=%{l_prefix} \
         --with-libpcap=%{l_prefix} \
         --with-libevent=%{l_prefix}
-    %{l_make} %{l_mflags} 
+    %{l_make} %{l_mflags}
 
 %install
     rm -rf $RPM_BUILD_ROOT
@@ -86,8 +87,6 @@ AutoReqProv:  no
         $RPM_BUILD_ROOT%{l_prefix}/sbin \
         $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
         $RPM_BUILD_ROOT%{l_prefix}/var/arpd
-
-    #   install files
     %{l_shtool} install -c -s -m 755 \
         arpd $RPM_BUILD_ROOT%{l_prefix}/sbin/
     %{l_shtool} install -c -m 644 \
@@ -99,7 +98,9 @@ AutoReqProv:  no
     %{l_shtool} install -c -m 644 \
         -e 's;@l_prefix@;%{l_prefix};g' \
         %{SOURCE fsl.arpd} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%not %dir %{l_prefix}/etc/fsl'
 
 %files -f files
 

+ 2 - 2
arpd/fsl.arpd

@@ -1,8 +1,8 @@
 ##
-##  fsl.arpd -- OSSP fsl configuration for honeyd
+##  fsl.arpd -- OSSP fsl configuration for ARP daemon
 ##
 
-ident arpdd q{
+ident (arpd)/.+ q{
     prefix(
         prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
     ) 

+ 8 - 18
arpd/rc.arpd

@@ -1,22 +1,22 @@
 #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
 ##
-##  rc.arpd -- Run-Commands for arpd
+##  rc.arpd -- Run-Commands for ARP daemon
 ##
 
 %config
     arpd_enable="yes"
-    arpd_listen=""
     arpd_interface=""
+    arpd_listen=""
 
 %start -p 200 -u @l_susr@
     opServiceEnabled arpd || exit 0
-    if [ ".$arpd_interface" = "." ]; then
-        @l_prefix@/sbin/arpd $arpd_listen \
-           >/dev/null 2>&1
-    else 
-        @l_prefix@/sbin/arpd -i $arpd_interface $arpd_listen\
-           $arpd_listen >/dev/null 2>&1
+    opts=""
+    if [ ".$arpd_interface" != . ]; then
+        opts="$opts -i $arpd_interface"
     fi
+    if [ ".$arpd_listen" != . ]; then
+        opts="$opts $arpd_listen"
+    @l_prefix@/sbin/arpd $opts >/dev/null 2>&1
 
 %stop -p 200 -u @l_susr@
     opServiceEnabled arpd || exit 0
@@ -24,16 +24,6 @@
         kill -TERM `cat @l_prefix@/var/arpd/arpd.pid`
     fi
 
-%restart -u @l_susr@
-    opServiceEnabled arpd || exit 0
-    if [ -f @l_prefix@/var/arpd/arpd.pid ]; then
-        kill -TERM `cat @l_prefix@/var/arpd/arpd.pid`
-        sleep 2
-    fi
-    @l_prefix@/sbin/arpd \
-        -f @l_prefix@/etc/arpd/arpd.conf \
-        >/dev/null 2>&1
-
 %reload -u @l_susr@
     opServiceEnabled arpd || exit 0
     if [ -f @l_prefix@/var/arpd/arpd.pid ]; then