Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Apr 1998 10:17:15 -0500 (EST)
From:      "Gregory D. Moncreaff" <moncrg@am026091.res.ray.com>
To:        freebsd-bugs@FreeBSD.ORG, moncrg@bt340707.res.ray.com, phk@FreeBSD.ORG
Subject:   Re: bin/5256
Message-ID:  <199804211517.KAA27333@am026091.res.ray.com>

next in thread | raw e-mail | index | archive | help
"$Id: route.c,v 1.21.2.2 1997/07/30 06:52:06 charnier Exp $"


diff -u route.c.orig route.c.fix
--- route.c.orig        Tue Apr 21 10:09:35 1998
+++ route.c.fix Tue Apr 21 10:12:48 1998
@@ -98,11 +98,12 @@
        { RTF_BROADCAST,'b' },
        { 0 }
 };
-
-static union {
+typedef union {
        struct  sockaddr u_sa;
        u_short u_data[128];
-} pt_u;
+} sa_u;
+
+static sa_u pt_u;
 
 int    do_rtent = 0;
 struct rtentry rtentry;
@@ -505,7 +506,7 @@
        static char name[16];
        static char prettyname[9];
        struct sockaddr *sa;
-       struct sockaddr addr, mask;
+       sa_u addr, mask;
 
        /*
         * Don't print protocol-cloned routes unless -a.
@@ -513,14 +514,14 @@
        if(rt->rt_parent && !aflag)
                return;
 
-       if (!(sa = kgetsa(rt_key(rt))))
-               bzero(&addr, sizeof addr);
-       else
-               addr = *sa;
-       if (!rt_mask(rt) || !(sa = kgetsa(rt_mask(rt))))
-               bzero(&mask, sizeof mask);
-       else
-               mask = *sa;
+       bzero(&addr, sizeof addr);
+       if ((sa = kgetsa(rt_key(rt))))
+               bcopy(sa,&addr,sa->sa_len);
+
+       bzero(&mask, sizeof mask);
+       if (rt_mask(rt) && (sa = kgetsa(rt_mask(rt))))
+               bcopy(sa,&mask,sa->sa_len);
+
        p_sockaddr(&addr, &mask, rt->rt_flags, WID_DST);
        p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, WID_GW);
        p_flags(rt->rt_flags, "%-6.6s ");


----
this is still 2.2.5 base code (haven't got 2.2.6 and can't cvsup 
though our firewall...)

thanks,
-g

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804211517.KAA27333>