/*
* Process a newly received packet.
*/
+void
rip_input(from, rip, size)
struct sockaddr *from;
register struct rip *rip;
if (count < sizeof (struct netinfo))
break;
count -= sizeof (struct netinfo);
-
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family = ntohs(n->rip_dst.sa_family);
-#else
-#define osa(x) ((struct osockaddr *)(&(x)))
- n->rip_dst.sa_family =
- ntohs(osa(n->rip_dst)->sa_family);
- n->rip_dst.sa_len = sizeof(n->rip_dst);
-#endif
n->rip_metric = ntohl(n->rip_metric);
/*
* A single entry with sa_family == AF_UNSPEC and
#define min(a, b) (a < b ? a : b)
n->rip_metric = rt == 0 ? HOPCNT_INFINITY :
min(rt->rt_metric + 1, HOPCNT_INFINITY);
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family = htons(n->rip_dst.sa_family);
-#else
- osa(n->rip_dst)->sa_family =
- htons(n->rip_dst.sa_family);
-#endif
n->rip_metric = htonl(n->rip_metric);
}
rip->rip_cmd = RIPCMD_RESPONSE;
for (; size > 0; size -= sizeof (struct netinfo), n++) {
if (size < sizeof (struct netinfo))
break;
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family =
- ntohs(n->rip_dst.sa_family);
-#else
- n->rip_dst.sa_family =
- ntohs(osa(n->rip_dst)->sa_family);
- n->rip_dst.sa_len = sizeof(n->rip_dst);
-#endif
n->rip_metric = ntohl(n->rip_metric);
if (n->rip_dst.sa_family >= af_max ||
(afp = &afswitch[n->rip_dst.sa_family])->af_hash ==
timercmp(&nextbcast, &now, <)) {
if (traceactions)
fprintf(ftrace, "send dynamic update\n");
- toall(supply, RTS_CHANGED, ifp);
+ toall((int (*)())supply, RTS_CHANGED, ifp);
lastbcast = now;
needupdate = 0;
nextbcast.tv_sec = 0;
delay = RANDOMDELAY();
if (traceactions)
fprintf(ftrace,
- "inhibit dynamic update for %d usec\n",
+ "inhibit dynamic update for %lu usec\n",
delay);
nextbcast.tv_sec = delay / 1000000;
nextbcast.tv_usec = delay % 1000000;