issue with route

Li, Qing qing.li at bluecoat.com
Thu Jun 2 11:04:22 PDT 2005


> 
> Please post unified diffs, they are far easier to read for humans.
> 

    Sorry, here is the patch again.

	-- Qing


Index: route.c
===================================================================
RCS file: /home/ncvs/src/sys/net/route.c,v
retrieving revision 1.108
diff -u -r1.108 route.c
--- route.c     7 Jan 2005 01:45:35 -0000       1.108
+++ route.c     2 Jun 2005 17:49:28 -0000
@@ -743,8 +743,12 @@
                goto makeroute;

        case RTM_ADD:
-               if ((flags & RTF_GATEWAY) && !gateway)
-                       panic("rtrequest: GATEWAY but no gateway");
+                if (flags & RTF_GATEWAY) {
+                    if (!gateway)
+                        panic("rtrequest: GATEWAY but no gateway");
+                if (dst && (dst->sa_family != gateway->sa_family))
+                    senderr(EINVAL);
+                }

                if (info->rti_ifa == NULL && (error = rt_getifa(info)))
                        senderr(error);



More information about the freebsd-net mailing list