slight cleanups on yesterday's patches
This commit is contained in:
julian 1996-07-23 22:00:14 +00:00
parent 507c870974
commit 16ad55d2ab
5 changed files with 18 additions and 16 deletions

View File

@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
*/
static const char rcsid[] =
"$Id: route.c,v 1.9 1996/07/09 19:02:28 julian Exp $";
"$Id: route.c,v 1.10 1996/07/23 01:18:47 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -891,7 +891,8 @@ getaddr(which, s, hpp)
case AF_APPLETALK:
if (!atalk_aton(s, &su->sat.sat_addr))
errx(EX_NOHOST, "bad address: %s", s);
return(su->sat.sat_addr.s_node != 0);
rtm_addrs |= RTA_NETMASK;
return(forcehost || su->sat.sat_addr.s_node != 0);
case AF_LINK:
link_addr(s, &su->sdl);

View File

@ -136,7 +136,7 @@ at_control( int cmd, caddr_t data, struct ifnet *ifp, struct proc *p )
}
aa->aa_ifa.ifa_addr = (struct sockaddr *)&aa->aa_addr;
aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_addr;
aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_dstaddr;
aa->aa_ifa.ifa_netmask = (struct sockaddr *)&aa->aa_netmask;
/*
@ -378,29 +378,30 @@ at_ifinit( ifp, aa, sat )
return( error );
}
/* Initialize interface netmask, which is silly for us */
/* Initialize netmask and broadcast address */
bzero(&aa->aa_netmask, sizeof(aa->aa_netmask));
aa->aa_ifa.ifa_netmask = (struct sockaddr *) &aa->aa_netmask;
aa->aa_netmask.sat_len = sizeof(struct sockaddr_at);
aa->aa_netmask.sat_family = AF_APPLETALK;
aa->aa_ifa.ifa_netmask = (struct sockaddr *) &aa->aa_netmask;
bzero(&aa->aa_broadaddr, sizeof(aa->aa_broadaddr));
aa->aa_ifa.ifa_broadaddr = (struct sockaddr *) &aa->aa_broadaddr;
aa->aa_broadaddr.sat_len = sizeof(struct sockaddr_at);
aa->aa_broadaddr.sat_family = AF_APPLETALK;
/* "Add a route to the network" */
aa->aa_ifa.ifa_metric = ifp->if_metric;
if (ifp->if_flags & IFF_BROADCAST) {
bzero(&aa->aa_broadaddr, sizeof(aa->aa_broadaddr));
aa->aa_broadaddr.sat_len = sat->sat_len;
aa->aa_broadaddr.sat_family = AF_APPLETALK;
aa->aa_broadaddr.sat_addr.s_net = htons(0);
aa->aa_broadaddr.sat_addr.s_node = 0xff;
aa->aa_ifa.ifa_broadaddr = (struct sockaddr *) &aa->aa_broadaddr;
aa->aa_netmask.sat_addr.s_net = htons(0xffff); /* XXX */
aa->aa_netmask.sat_addr.s_node = htons(0); /* XXX */
aa->aa_netmask.sat_addr.s_node = 0; /* XXX */
} else if (ifp->if_flags & IFF_LOOPBACK) {
aa->aa_ifa.ifa_dstaddr = aa->aa_ifa.ifa_addr;
aa->aa_netmask.sat_addr.s_net = htons(0xffff); /* XXX */
aa->aa_netmask.sat_addr.s_node = htons(0xffff); /* XXX */
aa->aa_netmask.sat_addr.s_node = 0xff; /* XXX */
flags |= RTF_HOST;
} else if (ifp->if_flags & IFF_POINTOPOINT) {
aa->aa_ifa.ifa_dstaddr = aa->aa_ifa.ifa_addr;
@ -408,7 +409,7 @@ at_ifinit( ifp, aa, sat )
aa->aa_netmask.sat_addr.s_node = htons(0xffff);
flags |= RTF_HOST;
}
error = rtinit(&(aa->aa_ifa), (int)RTM_ADD, flags);
error = rtinit(&aa->aa_ifa, RTM_ADD, flags);
#if 0
if ( ifp->if_flags & IFF_LOOPBACK ) {

View File

@ -66,7 +66,7 @@ struct domain atalkdomain = {
AF_APPLETALK, "appletalk", 0, 0, 0,
atalksw, &atalksw[sizeof(atalksw)/sizeof(atalksw[0])],
0, rn_inithead,
((caddr_t) &((struct sockaddr_at *) 0)->sat_addr - (caddr_t)0),
8 * (u_long) &((struct sockaddr_at *) 0)->sat_addr,
sizeof(struct sockaddr_at)
};

View File

@ -32,7 +32,7 @@ struct at_ifaddr {
# define aa_ifp aa_ifa.ifa_ifp
struct sockaddr_at aa_addr;
struct sockaddr_at aa_broadaddr;
# define aa_dstaddr aa_netmask
# define aa_dstaddr aa_broadaddr;
struct sockaddr_at aa_netmask;
int aa_flags;
u_short aa_firstnet, aa_lastnet;

View File

@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: route.c,v 1.16 1996/06/15 17:08:40 peter Exp $";
"$Id: route.c,v 1.17 1996/07/23 01:18:17 julian Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -418,7 +418,7 @@ p_sockaddr(sa, mask, flags, width)
}
case AF_APPLETALK:
{
if (mask)
if (!(flags & RTF_HOST) && mask)
cp = atalk_print2(sa,mask,11);
else
cp = atalk_print(sa,11);