Acredito ter solucionado um buzinho...

6 views
Skip to first unread message

Frederico Pissarra

unread,
Feb 6, 2015, 2:17:52 PM2/6/15
to t50...@googlegroups.com
O valor em co->ip.daddr estava sendo setado errado em t50.c. Onde se lia:

  /* Execute if flood or while threshold greater than 0. */
  while (co->flood || (co->threshold-- > 0))
  {
    /* Holds the actual packet size after module function call. */
    size_t size;

    /* Set the destination IP address to RANDOM IP address. */
    if (cidr_ptr->hostid)
      co->ip.daddr = htonl(cidr_ptr->__1st_addr + 

        (random() % cidr_ptr->hostid));

Agora é:

  /* Execute if flood or while threshold greater than 0. */
  while (co->flood || (co->threshold-- > 0))
  {
    /* Holds the actual packet size after module function call. */
    size_t size;

    /* Set the destination IP address to RANDOM IP address. */
    /* NOTE: The previous code did not account for 'hostid == 0'! */
    co->ip.daddr = cidr_ptr->__1st_addr;
    if (cidr_ptr->hostid)
       co->ip.daddr += RANDOM() % cidr_ptr->hostid;
    co->ip.daddr = htonl(co->ip.daddr);

Ainda, a atribuição de co->ip.daddr antes do loop foi retirada...

Tá lá no github.

[]s
Fred
Reply all
Reply to author
Forward
0 new messages