Date: Tue, 7 Jul 2009 20:24:52 GMT From: Ana Kukec <anchie@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 165786 for review Message-ID: <200907072024.n67KOqN6003819@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907072024.n67KOqN6003819>