PERFORCE change 167343 for review
Ana Kukec
anchie at FreeBSD.org
Fri Aug 14 21:49:25 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167343
Change 167343 by anchie at anchie_desnimis on 2009/08/14 21:48:42
Changes in user land in order to process SEND message appended to
rt_msghdr instead of rt_ifannouncemsghdr.
Affected files ...
.. //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#22 edit
Differences ...
==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#22 (text+ko) ====
@@ -69,6 +69,7 @@
{
struct sbuff *b;
+ /* 2048 + rt_msghdr */
if ((b = sbuff_alloc(SND_MAX_PKT + sizeof(struct rt_msghdr))) == NULL) {
APPLOG_NOMEM();
return (NULL);
@@ -139,27 +140,15 @@
pi = (struct snd_packet_info *)(b->head);
DBG(&dbg_snd, "Direction, in = %d", pi->in);
-#if 0
- ip6 = sbuff_data(b);
- DBG(&dbg_snd, "SRC: %s", inet_ntop(AF_INET6, &ip6->ip6_src, abuf, sizeof (abuf)));
- DBG(&dbg_snd, "DST: %s", inet_ntop(AF_INET6, &ip6->ip6_dst, abuf, sizeof (abuf)));
- struct nd_neighbor_solicit *ns;
- struct in6_addr *tgt;
- b->data += sizeof (struct ip6_hdr);
- ns = (struct nd_neighbor_solicit *)(b->data);
- tgt = &ns->nd_ns_target;
- DBG(&dbg_snd, "DST: %s", inet_ntop(AF_INET6, tgt, abuf, sizeof (abuf)));
-#endif
-
DBG(&dbg_snd, "rt_msghdr = %d, if_announcemsghdr = %d\n", sizeof (struct rt_msghdr), sizeof (struct if_announcemsghdr));
/* buffer starts with IPv6 hdr, roll back to include rtm header */
-#if 0
b->data -= sizeof (struct rt_msghdr);
b->len += sizeof (struct rt_msghdr);
-#endif
+#if 0
b->data -= sizeof (struct if_announcemsghdr);
b->len += sizeof (struct if_announcemsghdr);
+#endif
DBG(&dbg_snd, "%d bytes on %s", b->len, pi->ifinfo->name);
@@ -295,10 +284,10 @@
case RTM_SND_IN:
applog(LOG_ERR, "RTM_SND_IN");
/* n = RTM hdr + SEND message */
+ if (sbuff_pull(b, sizeof (struct rt_msghdr)) == NULL) {
#if 0
- if (sbuff_pull(b, sizeof (struct rt_msghdr)) == NULL) {
+ if (sbuff_pull(b, sizeof (struct if_announcemsghdr)) == NULL) {
#endif
- if (sbuff_pull(b, sizeof (struct if_announcemsghdr)) == NULL) {
DBG(&dbg_snd, "invalid pkt (not enough for rtm hedaer"); goto done;
}
@@ -310,10 +299,10 @@
case RTM_SND_OUT:
applog(LOG_ERR, "RTM_SND_OUT");
/* n = RTM hdr + ip6_hdr + icmp6len */
+ if (sbuff_pull(b, sizeof (struct rt_msghdr)) == NULL) {
#if 0
- if (sbuff_pull(b, sizeof (struct rt_msghdr)) == NULL) {
+ if (sbuff_pull(b, sizeof (struct if_announcemsghdr)) == NULL) {
#endif
- if (sbuff_pull(b, sizeof (struct if_announcemsghdr)) == NULL) {
DBG(&dbg_snd, "invalid pkt (not enough for rtm header");
goto done;
}
More information about the p4-projects
mailing list