Update of /cvsroot/linux-decnet/dnprogs/multinet
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29776
Modified Files:
multinet.c
Log Message:
Fix multicasts
Index: multinet.c
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/multinet/multinet.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** multinet.c 28 Mar 2006 12:58:17 -0000 1.2
--- multinet.c 29 Mar 2006 09:01:15 -0000 1.3
***************
*** 94,97 ****
--- 94,98 ----
unsigned char header[38];
struct iovec iov[2];
+ int header_len;
if (!got_remote_addr)
***************
*** 108,112 ****
header[5] = local_addr[1];
! if (mcast) /* Routing muticast - type may need to be in callers params */
{
header[6] = 0x09;
--- 109,113 ----
header[5] = local_addr[1];
! if (mcast) /* Routing multicast - type may need to be in callers params */
{
header[6] = 0x09;
***************
*** 116,119 ****
--- 117,121 ----
header[10] = 0x09;
header[11] = 0x23;
+ header_len = 14;
}
else
***************
*** 125,128 ****
--- 127,131 ----
header[10] = remote_decnet_addr[0];
header[11] = remote_decnet_addr[1];
+ header_len = sizeof(header);
}
header[12] = 0x60; /* DECnet packet type */
***************
*** 153,161 ****
iov[0].iov_base = header;
! iov[0].iov_len = sizeof(header);
iov[1].iov_base = buf;
iov[1].iov_len = len;
! dump_data("to TUN0:", header, sizeof(header));
dump_data("to TUN1:", buf+6, len-6);
--- 156,164 ----
iov[0].iov_base = header;
! iov[0].iov_len = header_len;
iov[1].iov_base = buf;
iov[1].iov_len = len;
! dump_data("to TUN0:", header, header_len);
dump_data("to TUN1:", buf+6, len-6);
***************
*** 254,268 ****
dump_data("from IP:", buf, len);
-
- /* TODO Will need to resend this if other packets timeout */
if (buf[4] == 0x05)
{
got_verification = 1;
alarm(0);
-
- // TODO for '0x05' send hello packet
}
! /* Trap INIT & VERF messages */
if (buf[4] == 0x01 || buf[4] == 0x05)
{
--- 257,275 ----
dump_data("from IP:", buf, len);
if (buf[4] == 0x05)
{
+ // TODO what's this second MAC address????? 3.35 (in this packet)
+ unsigned char hello[] = {/* Router 2 hello message */
+ 0x22, 0x00, 0x0b, 0x02, 0x00, 0x00, 0xaa, 0x00, 0x04, 0x00, buf[5], buf[6], 0x02, 0xda, 0x05, 0x40,
+ 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xaa, 0x00, 0x04,
+ 0x00, 0x02, 0x2c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ send_tun(1, hello, sizeof(hello)); // Should go to multicst ab-00-00-04-00-00,
+
got_verification = 1;
alarm(0);
}
! /* Trap INIT & VERF messages, they're for us */
if (buf[4] == 0x01 || buf[4] == 0x05)
{
***************
*** 279,284 ****
return;
}
! if (buf[4] == 0x03)
return;
if (buf[4] == 0x07) /* Routing info */
{
--- 286,294 ----
return;
}
! if (buf[4] == 0x03) // TODO check this
! return;
! if (buf[4] == 0x02) // TODO check this
return;
+
if (buf[4] == 0x07) /* Routing info */
{
|