From miquels@Q.cistron.nl Thu Mar 25 15:07:39 1999
Received: from janeway.cistron.nl (root@janeway.cistron.nl [195.64.65.23]) by ms2.inr.ac.ru (8.6.13/ANK) with ESMTP id OAA29315 for <kuznet@ms2.inr.ac.ru>; Thu, 25 Mar 1999 14:58:42 +0300
Received: from Q.cistron.nl (miquels@q.cistron.nl [195.64.65.42])
	by janeway.cistron.nl (8.9.2/8.9.2/Debian/GNU) with ESMTP id MAA25472
	for <kuznet@ms2.inr.ac.ru>; Thu, 25 Mar 1999 12:58:12 +0100 (CET)
Received: (from miquels@localhost)
	by Q.cistron.nl (8.9.2/8.9.2/Debian/GNU) id MAA04591
	for kuznet@ms2.inr.ac.ru; Thu, 25 Mar 1999 12:58:10 +0100 (CET)
Date: Thu, 25 Mar 1999 12:58:10 +0100
From: Miquel van Smoorenburg <miquels@cistron.nl>
To: kuznet@ms2.inr.ac.ru
Subject: Gated & GLIBC
Message-ID: <19990325125809.A4583@cistron.nl>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.1i
X-NCC-RegID: nl.cistron
Status: RO

Hello,

	I combined gated-3.5.10 with your gated-3.5.10-dif990307.gz
patch, and tried to compile it with glibc-2.0. It failed, I assume
your are still using libc5 or a glibc-2.0 with include files fixed
by yourself.

Here's a quick fix to get gated to compile with glibc-2.0 and glibc-2.1
relative to gated-3-5-10+dif990307.gz

diff -ruN --exclude=obj gated-3-5-10.ank.orig/src/configs/linux-2.2-glibc gated-3-5-10/src/configs/linux-2.2-glibc
--- gated-3-5-10.ank.orig/src/configs/linux-2.2-glibc	Thu Jan  1 01:00:00 1970
+++ gated-3-5-10/src/configs/linux-2.2-glibc	Thu Mar 25 12:51:51 1999
@@ -0,0 +1,94 @@
+#
+#	Configuration file for Linux 2.2.x systems with glibc
+#	By miquels@cistron.nl based on 2.0 version from babydr@nwrain.net
+#
+#  set path_unix to the location of vmlinux on your system
+
+path_unix	/usr/src/linux/vmlinux
+
+#signal_h	/usr/include/signal.h
+
+#
+#  set path_pid to the location of `name`.pid file to your preference.
+path_pid	/var/run/%s.pid
+
+#
+#  set path_version to the location of `name`.version file to your preference.
+path_version	/var/run/%s.version
+
+#
+#	Other options which can be set to your preference (	just make sure
+#								they exist )
+path_dumpdir	/var/tmp
+path_dump	/var/tmp/%s_dump
+path_config	/etc/%s.conf
+
+# This is the directory for binaries. gdc ripquery ospf_monitor ...
+bindir		/usr/sbin
+
+# This is the directory for gated binary.
+sbindir		/usr/sbin
+
+## set mkdep to mkdep
+mkdep	mkdep -flag -M
+
+# set your favourite protocol set. NOTE: gii is required if you want
+# to be able to use the Gated Interactive Interface
+#
+
+protocols       icmp ospf rip rdisc gii
+#hello
+#protocols	bgp egp hello icmp rip ospf rdisc gii
+# isode_snmp
+#protocols       bgp hello icmp ospf rip gii		# for R3_6Alpha_2
+#protocols       icmp rip gii 
+
+# ospf_monitor options needed for Linux
+#ospfm_readline	-lreadline
+#ospfm_termcap	-ltermcap
+ospfm_termcap	-lncurses
+
+# Which incarntation of lex to use, IE: flex for all linux distr.s
+lex	flex
+lflags	-p -s -C -I
+
+# Which incarntation of yacc to use, IE: yacc,bison,.. for all linux distr.s
+yacc	bison
+yflags	-d -y -v
+
+# List libraries required for your environment
+#ldflags		-ldb
+ldflags		-ldb -lcrypt
+
+# If and only if you get the error mentioned at bottom of configs/README.Linux
+#ldflags		-ldb -lresolv -lcrypt
+
+# Options to include
+options	RIB_HASH
+options	NO_MBUF_H
+options	INCLUDE_UNISTD
+options	INCLUDE_TYPES
+
+options	INCLUDE_PATHS
+options USE_SETPGRP
+options	HAVE_DIRENT
+options	GID_T=gid_t
+options	POSIX_SIGNALS
+options NEED_SIGNAME
+options	HAVE_SYS_SIGLIST
+options	HAVE_WAITPID
+#options	KRT_RTREAD_PROC
+#options	KRT_LLADDR_LINUX
+options	ROUTES_WO_MBUFS
+#options	KRT_IFREAD_IOCTL
+#options	KRT_RT_IOCTL
+#options	PROTO_ICMP
+options KRT_NETLINK2
+options KRT_SYMBOLS_PROC  
+options KRT_SOCKET_TYPE=AF_NETLINK,SOCK_RAW,0
+#options KRT_SOCKET_TYPE=PF_INET,SOCK_DGRAM,AF_UNSPEC
+options KVM_TYPE_NONE
+options VARIABLE_MASKS
+options KRT_IPMULTI_TTL0
+options SHADOW_PASSWD
+options tzsetwall()={unsetenv("TZ");tzset();}
diff -ruN --exclude=obj gated-3-5-10.ank.orig/src/include.h gated-3-5-10/src/include.h
--- gated-3-5-10.ank.orig/src/include.h	Thu Mar 25 11:42:20 1999
+++ gated-3-5-10/src/include.h	Thu Mar 25 12:47:57 1999
@@ -149,6 +149,45 @@
 #ifdef	linux
 #include <linux/sockios.h>
 #include <netinet/in_systm.h>
+/*
+ *	Glibc-2.0 and 2.1 don't include kernel headers as-is, so
+ *	sometimes there is a conflict. This attempts to solve it.
+ */
+#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 2)
+
+  #include <linux/types.h>
+
+  /* linux/socket.h */
+  #define MSG_TRUNC		0x20
+  #define MSG_DONTWAIT		0x40
+
+  /* linux/in.h */
+  #define _LINUX_IN_H
+  #define IP_PKTINFO	8
+  struct in_pktinfo
+  {
+	int		ipi_ifindex;
+	struct in_addr	ipi_spec_dst;
+	struct in_addr	ipi_addr;
+  };
+
+  #if (__GLIBC_MINOR__ < 1)
+  #define SCM_CREDENTIALS	0x02
+  struct ucred {
+	__u32	pid;
+	__u32	uid;
+	__u32	gid;
+  };
+  struct ip_mreqn
+  {
+	struct in_addr	imr_multiaddr;
+	struct in_addr	imr_address;
+	int		imr_ifindex;
+  };
+  #endif
+
+#endif /* Linux Glibc-2.[01] */
+
 #ifndef NBBY
 /* If NBBY is not set in sys/params.h, it is libc5 and
    bsd/bsd.h must be included
-- 
Indifference will certainly be the downfall of mankind, but who cares?

