PERFORCE change 166103 for review
Ana Kukec
anchie at FreeBSD.org
Tue Jul 14 20:06:05 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166103
Change 166103 by anchie at anchie_malimis on 2009/07/14 20:05:33
Write to routing socket, to send a message processed by SEND
application back to kernel.
Affected files ...
.. //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#18 edit
Differences ...
==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#18 (text+ko) ====
@@ -39,6 +39,7 @@
#include <netinet/in.h>
#include <net/route.h>
#include <net/if.h>
+#include <netinet/in.h>
#include <netinet6/send.h>
#include "config.h"
@@ -143,8 +144,19 @@
DBG(&dbg_snd, "%d bytes on %s", b->len, pi->ifinfo->name);
rtm = sbuff_data(b);
- rtm->rtm_msglen = sizeof(struct rt_msghdr) + b->len;
- DBG(&dbg_snd, "RTM_VERSION = %d", rtm->rtm_version);
+
+ /* RTM header already has rtm version, type, etc. set up */
+ rtm->rtm_msglen = b->len;
+ rtm->rtm_addrs = 0;
+
+ if (send(sndsock, rtm, rtm->rtm_msglen, 0) < 0) {
+ DBG(&dbg_snd, "Failed to send routing message back to kernel.");
+ perror("Failed");
+ snd_put_buf(b);
+ return;
+ }
+
+ snd_put_buf(b);
}
void
@@ -243,6 +255,9 @@
goto done;
}
+ DBG(&dbg_snd, "rtm->rtm_addrs = %x", rtm->rtm_addrs);
+ DBG(&dbg_snd, "rtm->rtm_msglen = %d", rtm->rtm_msglen);
+
switch (rtm->rtm_type) {
case RTM_IFANNOUNCE:
/* XXX: Do we need this? */
More information about the p4-projects
mailing list