From owner-p4-projects@FreeBSD.ORG Tue Jul 7 20:24:54 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5393C1065675; Tue, 7 Jul 2009 20:24:53 +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 0E14C1065672 for ; Tue, 7 Jul 2009 20:24:53 +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 EE2B68FC21 for ; Tue, 7 Jul 2009 20:24:52 +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 n67KOqmh003821 for ; Tue, 7 Jul 2009 20:24:52 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n67KOqN6003819 for perforce@freebsd.org; Tue, 7 Jul 2009 20:24:52 GMT (envelope-from anchie@FreeBSD.org) Date: Tue, 7 Jul 2009 20:24:52 GMT Message-Id: <200907072024.n67KOqN6003819@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 165786 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, 07 Jul 2009 20:24:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=165786 Change 165786 by anchie@anchie_malimis on 2009/07/07 20:23:54 Process the information about the interface on which SeND message was received. Affected files ... .. //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#15 edit .. //depot/projects/soc2009/anchie_send/send_0.2/sendd/proto.c#7 edit .. //depot/projects/soc2009/anchie_send/send_0.2/sendd/sendd.c#10 edit .. //depot/projects/soc2009/anchie_send/send_0.2/sendd/sendd_local.h#4 edit Differences ... ==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#15 (text+ko) ==== @@ -89,6 +89,18 @@ int direction; }; +void +snd_dispatch_fds(fd_set *fds) +{ + struct snd_ifinfo *p; + + list_for_each_entry(p, &ifaces, list) { + if (FD_ISSET(sndsock, fds)) { + snd_sock_read(p); + } + } +} + int snd_handle_iface(const char *ifname, int ifidx) { @@ -177,13 +189,13 @@ } void -snd_sock_read() +snd_sock_read(struct snd_ifinfo *p) { struct rt_msghdr *rtm; struct if_announcemsghdr *ifan; struct sbuff *b, *b1; struct snd_packet_info *pi; - int n, ifidx = -1; + int n; if ((b = snd_get_buf()) == NULL) { return; @@ -219,7 +231,7 @@ /* n = RTM hdr + m as passed to nd6_ns_input() */ b = (struct rt_msghdr *) &ifan[1]; /* ToDo: Extract ifidx. */ - snd_recv_pkt(b, ifidx, SND_IN); + snd_recv_pkt(b, p->ifidx, SND_IN); break; case RTM_SND_OUT: applog(LOG_ERR, "RTM_SND_OUT"); @@ -229,8 +241,7 @@ goto done; } - /* ToDo: Extract ifidx. */ - snd_recv_pkt(b, ifidx, SND_OUT); + snd_recv_pkt(b, p->ifidx, SND_OUT); break; } break; ==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/proto.c#7 (text+ko) ==== @@ -667,11 +667,10 @@ void *start; struct ip6_hdr *iph; -#if 0 - if (!snd_iface_ok_(ifidx)) { + if (!snd_iface_ok(ifidx)) { return; } -#endif + #if 0 if (!in) if (sbuff_pull(b, sizeof (struct ether_header)) == NULL) { ==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/sendd.c#10 (text+ko) ==== @@ -95,7 +95,6 @@ FD_SET(icmps, fds); FD_SET(ctlfd, fds); /* Routing socket instead of using netgraph for ND/SeND */ - /* FD_SET(snds, fds); */ /* os_specific_add_fds(fds, &maxfd); */ snd_add_fds(fds, &maxfd, snds); DBG(&snd_dbg, "after snd_add_fds"); @@ -125,10 +124,10 @@ if (FD_ISSET(ctlfd, fds)) { snd_ctl_read(ctlfd); } - if (FD_ISSET(snds, fds)) { - snd_sock_read(); - } - /* os_specific_dispatch_fds(fds); */ +#if 0 + os_specific_dispatch_fds(fds); +#endif + snd_dispatch_fds(fds); snd_replace_non_cga_linklocals(); } } ==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/sendd_local.h#4 (text+ko) ==== @@ -130,7 +130,6 @@ /* net.c */ extern void snd_icmp_sock_read(void); -extern void snd_sock_read(void); extern int snd_net_init(int *, int *); extern struct sbuff *snd_get_buf(void); extern void snd_put_buf(struct sbuff *);