(fwd) Re: Apache error_log file

Andrey Gerzhov (kittle@ntu-kpi.kiev.ua)
Sat, 16 Jan 1999 00:35:22 +0200

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=README

This patch allows dynamic arp on particular ethernet interface
to be disabled via ifconfig <interface> -arp . After applying
this patch you have to recompile your kernel. If interface is
in -arp mode then it doesn't send or receive any arp requests/
replies. This means that you have total control over the content
of the arp table. Be sure to update arp table by hands only
when no router daemon is running. This can be achieved via some-
thing like this (assuming you use gated):
$ gdc stop; <altering arp table>; gdc start

If kernel is compiled with "options ARP_HACK" then an ethernet
interface when put in -arp mode will send replies to arp
queries on the network but will not send any arp requests and
won't alter the arp table.

Tested on FreeBSD 2.2.6-RELEASE, 2.2.7-RELEASE.

Alexander Matey
lx@hosix.ntu-kpi.kiev.ua

--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-aa

--- /sys/netinet/if_ether.c.org Wed May 14 19:43:56 1997
+++ /sys/netinet/if_ether.c Sun Apr 26 16:47:25 1998
@@ -277,8 +277,14 @@
register struct ether_header *eh;
register struct ether_arp *ea;
struct sockaddr sa;

+/* PATCH BEGIN -lx- */
+ if((ac->ac_if.if_flags & IFF_NOARP) != 0) {
+ return;
+ }
+/* PATCH END */
+
if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
return;
m->m_len = sizeof(*ea);
m->m_pkthdr.len = sizeof(*ea);
@@ -353,8 +359,14 @@
sdl->sdl_family == AF_LINK && sdl->sdl_alen != 0) {
bcopy(LLADDR(sdl), desten, sdl->sdl_alen);
return 1;
}
+/* PATCH BEGIN -lx- */
+ if((ac->ac_if.if_flags & IFF_NOARP) != 0) {
+ m_freem(m);
+ return (0);
+ }
+/* PATCH END */
/*
* There is an arptab entry, but no ethernet address
* response yet. Replace the held mbuf with this
* latest one.
@@ -399,8 +411,13 @@
splx(s);
if (m == 0 || (m->m_flags & M_PKTHDR) == 0)
panic("arpintr");
if (m->m_len >= sizeof(struct arphdr) &&
+/* PATCH BEGIN -lx- */
+#ifndef ARP_HACK
+ (m->m_pkthdr.rcvif->if_flags & IFF_NOARP) == 0 &&
+#endif
+/* PATCH END */
(ar = mtod(m, struct arphdr *)) &&
ntohs(ar->ar_hrd) == ARPHRD_ETHER &&
m->m_len >=
sizeof(struct arphdr) + 2 * ar->ar_hln + 2 * ar->ar_pln)
@@ -481,8 +498,16 @@
ea->arp_sha, ":", inet_ntoa(isaddr));
itaddr = myaddr;
goto reply;
}
+
+/* PATCH BEGIN -lx- */
+#ifdef ARP_HACK
+ if ((ac->ac_if.if_flags & IFF_NOARP) != 0) {
+ goto reply;
+ }
+#endif
+/* PATCH END */
la = arplookup(isaddr.s_addr, itaddr.s_addr == myaddr.s_addr, 0);
if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) {
if (sdl->sdl_alen &&
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))

--Nq2Wo0NMKNjxTN9z--