Date: Sat, 15 Aug 2009 19:08:45 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 167377 for review Message-ID: <200908151908.n7FJ8jfd012101@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167377 Change 167377 by bz@bz_zoo on 2009/08/15 19:08:34 - Instead of expecting an if_announcemsghdr expect the rt_msghdr. Instead of transporting the direction in ifan_what use rtm_seq now. - Remove some dead code. - Make debugging printfs for 'after n->m_len' work on 64bit machines as well using the correct length modifier with printf. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#15 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#15 (text+ko) ==== @@ -524,17 +524,12 @@ case RTM_SND: printf("RTM_SND!\n"); - struct if_announcemsghdr *ifan; - ifan = mtod(m, struct if_announcemsghdr *); - switch (ifan->ifan_what) { + switch (rtm->rtm_seq) { case RTM_SND_IN: ifp = ifnet_byindex(rtm->rtm_index); if (ifp) { - m_adj(m, sizeof (struct if_announcemsghdr)); -#if 0 - m->m_data += sizeof (struct if_announcemsghdr); -#endif + m_adj(m, sizeof (struct rt_msghdr)); printf("rtm->rtm_index = %d\n", rtm->rtm_index); send_output_hook(m, ifp, SND_IN); } else { @@ -545,11 +540,8 @@ case RTM_SND_OUT: ifp = ifnet_byindex(rtm->rtm_index); if (ifp) { - m_adj(m, sizeof (struct if_announcemsghdr)); + m_adj(m, sizeof (struct rt_msghdr)); printf("if_index = %u\n", ifp->if_index); -#if 0 - m->m_data += sizeof (struct if_announcemsghdr); -#endif send_output_hook(m, ifp, SND_OUT); } else printf("route_output: ifp == NULL"); @@ -1280,12 +1272,12 @@ bcopy(data, mtod(n, void *), data_len); printf("rtsock.c: rt_msg3(), nakon bcopy!\n"); n->m_len = data_len; - printf("Nakon n->m_len = data_len = %d;\n", data_len); + printf("Nakon n->m_len = data_len = %zu;\n", data_len); m->m_next = n; printf("Nakon m->m_next = n;\n"); } else if (data_len > 0) { printf("rtsock.c: rt_msg3(), prije bcopy 2!\n"); - printf("data_len = %d\n", data_len); + printf("data_len = %zu\n", data_len); bcopy(data, mtod(m, u_int8_t *) + m->m_len, data_len); printf("rtsock.c: rt_msg3(), nakon bcopy 2!\n"); m->m_len += data_len;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908151908.n7FJ8jfd012101>