From owner-p4-projects@FreeBSD.ORG Tue Jul 14 18:30:17 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1CD5F106568F; Tue, 14 Jul 2009 18:30:17 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCDE11065689 for ; Tue, 14 Jul 2009 18:30:16 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BB0AA8FC16 for ; Tue, 14 Jul 2009 18:30:16 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6EIUGOH028209 for ; Tue, 14 Jul 2009 18:30:16 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6EIUGQm028207 for perforce@freebsd.org; Tue, 14 Jul 2009 18:30:16 GMT (envelope-from anchie@FreeBSD.org) Date: Tue, 14 Jul 2009 18:30:16 GMT Message-Id: <200907141830.n6EIUGQm028207@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to anchie@FreeBSD.org using -f From: Ana Kukec To: Perforce Change Reviews Cc: Subject: PERFORCE change 166094 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 18:30:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=166094 Change 166094 by anchie@anchie_malimis on 2009/07/14 18:30:10 In RTM_SND message, rtm->rtm_addrs is set to 0, but routing message is still checked against rti_info[RTAX_DST] == NULL. Skip this check in case of RTM_SND message. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#7 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#7 (text+ko) ==== @@ -501,11 +501,15 @@ senderr(EINVAL); } info.rti_flags = rtm->rtm_flags; - if (info.rti_info[RTAX_DST] == NULL || - info.rti_info[RTAX_DST]->sa_family >= AF_MAX || - (info.rti_info[RTAX_GATEWAY] != NULL && - info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) - senderr(EINVAL); + if (rtm->rtm_type != RTM_SND) { + if (info.rti_info[RTAX_DST] == NULL || + info.rti_info[RTAX_DST]->sa_family >= AF_MAX || + (info.rti_info[RTAX_GATEWAY] != NULL && + info.rti_info[RTAX_GATEWAY]->sa_family >= AF_MAX)) { + printf("EINVAL 3"); + senderr(EINVAL); + } + } /* * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. @@ -519,6 +523,9 @@ switch (rtm->rtm_type) { struct rtentry *saved_nrt; + case RTM_SND: + printf("RTM_SND!"); + case RTM_ADD: if (info.rti_info[RTAX_GATEWAY] == NULL) senderr(EINVAL);