Dear Alexey,
I came across a board that requires RARP to boot so I had to
do something about it. I modified your rarpd-ss981107 so that
it passes compiler. System is sparc 2.3.18 with glibc (RH 5.2).
Once compiled, it worked just fine.
Greetings,
--Pete
--- rarpd/rarpd.c Sat Nov 7 06:48:40 1998
+++ rarpd-p3/rarpd.c Sat Jan 22 10:53:04 2000
@@ -26,9 +26,15 @@
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
+#include <linux/types.h> /* needed for <linux/filter.h> */
#include <linux/if_packet.h>
+#include <linux/if_ether.h> /* ETH_P_RARP and so on. */
#include <linux/filter.h>
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0x40 /* Nonblocking io */
+#endif
+
int do_reload = 1;
int debug;
@@ -51,12 +57,12 @@
int hatype;
unsigned char lladdr[16];
unsigned char name[IFNAMSIZ];
- struct ifaddr *ifa_list;
+ struct ifadr *ifa_list;
} *ifl_list;
-struct ifaddr
+struct ifadr /* struct ifaddr leaks from kernel and conflicts. */
{
- struct ifaddr *next;
+ struct ifadr *next;
__u32 prefix;
__u32 mask;
__u32 local;
@@ -88,7 +94,7 @@
int fd;
struct ifreq *ifrp, *ifend;
struct iflink *ifl;
- struct ifaddr *ifa;
+ struct ifadr *ifa;
struct ifconf ifc;
struct ifreq ibuf[256];
@@ -179,7 +185,7 @@
if (ifa == NULL) {
if (mask == 0 || prefix == 0)
continue;
- ifa = (struct ifaddr*)malloc(sizeof(*ifa));
+ ifa = (struct ifadr*)malloc(sizeof(*ifa));
memset(ifa, 0, sizeof(*ifa));
ifa->local = addr;
ifa->prefix = prefix;
@@ -235,10 +241,10 @@
return dent != NULL;
}
-struct ifaddr *select_ipaddr(int ifindex, __u32 *sel_addr, __u32 **alist)
+struct ifadr *select_ipaddr(int ifindex, __u32 *sel_addr, __u32 **alist)
{
struct iflink *ifl;
- struct ifaddr *ifa;
+ struct ifadr *ifa;
int retry = 0;
int i;
@@ -294,7 +300,7 @@
if (r == NULL) {
if (hatype == ARPHRD_ETHER && halen == 6) {
- struct ifaddr *ifa;
+ struct ifadr *ifa;
struct hostent *hp;
char ename[256];
static struct rarp_map emap = {
@@ -363,7 +369,7 @@
{
__u32 laddr = 0;
struct iflink *ifl;
- struct ifaddr *ifa;
+ struct ifadr *ifa;
for (ifl=ifl_list; ifl; ifl = ifl->next)
if (ifl->index == ifindex)
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]