Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Suspect code in libnet_build_ip.c:libnet_build_ipv4() #101

@ThomasHabets

Description

@ThomasHabets

Line 188 has this loop:

for (p_temp = l->protocol_blocks;
     p_temp->type == LIBNET_PBLOCK_IPV4_H ||
     p_temp->type == LIBNET_PBLOCK_IPO_H;
     p_temp = p_temp->next)
{
    libnet_pblock_insert_before(l, p_temp->ptag, p_data->ptag);
    break;
}

I don't know exactly what this code is trying to do, but it's not doing it.

p_temp = p_temp->next will never be executed, due to the break.

The comment a few lines up is not comforting either:

/* SR - I'm not sure how to reach this code. Maybe if the first                                                                               
 * time we added an ipv4 block, there was no payload, but when                                                                                
 * we modify the block the next time, we have payload?                                                                                        
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions