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

Skip to content

sending ipv6 fragments #109

@iosappwithpaypal

Description

@iosappwithpaypal

Hi..we are using libnet-1.1.6. To send a large datagram, I'm using following sequence:

libnet_init(..LIBNET_RAW6..)
libnet_clear_packet

pktId = libnet_get_prand(LIBNET_PRu32);

libnet_build_udp
libnet_build_ipv6_frag(..pktId,...)
libnet_build_ipv6
libnet_write

then, clear the UDP header:

libnet_clear_packet(libnet_handle);
ip = LIBNET_PTAG_INITIALIZER;
ip6frg = LIBNET_PTAG_INITIALIZER;

till all fragments are sent:
libnet_build_ipv6_frag(..pktId,...)
libnet_build_ipv6
libnet_write

I'm stracing the sender and I see that packet ID field is not set correctly between each fragment. So linux kernel never even sends these fragments out. I don't see the packet in tcpdump.

I'm comparing the packets in tcpdump. One set with linux kernel doing the fragmentation ie., no libnet and other set with libnet.

here is the ipv6 fragment header in first fragment that goes with payload, udp header, first Fragment header, ipv6 header:

\x11\x00\x00\x01\x89\x31\x05\x88

second fragment that goes out after stripping udp header and reconstructing fragment header with fragment offset and 0 for MF flag and packet id. the last 2 bytes of packet ID are different. i can't tell why. i'm calling libnet_get_prand() once and use that value for all fragments.

\x11\x00\xb5\x00\x89\x31\xd3\x45

Can someone point me to any example code that uses libnet_build_ipv6_frag()?

Thank you
Prasad

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions