can't resize payload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I try to resize the payload of TCP packed but i can't. I don't know if
this is the right way?

This is the part of code:

   len = nfq_get_payload(nfa, &full_packet);
   struct ip *iphdr = (struct ip *) full_packet;

   int              iphlen = iphdr->ip_hl<<2;
   struct tcphdr *tcp = (struct tcphdr *)((caddr_t )iphdr + iphlen);

   unsigned char *pl_data = (void *)tcp + (tcp->doff*4)+32;
   ...
   pl_data = realloc(pl_data, (strlen((char *)pl_data) ) +
(sizeof(char) * strlen(m))+1 );
   ...

This part of code works only sometimes and some others fails with
invalid pointer
Can i use realloc to allocate more memory in this case?

How can i allocate more memory for the payload?

I don't know if is the correct mailing list for this kind of questions?
If not, there's another list available?

Salva
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux