kroupouk has asked for the wisdom of the Perl Monks concerning the following question:

I would like change ip flags using net::rawip. Meaning either use the reserved bit or Dont fragment or More Fragments. Any clues how to do that?
  • Comment on how to change ip flags with net::rawip?

Replies are listed 'Best First'.
Re: how to change ip flags with net::rawip?
by Corion (Patriarch) on May 16, 2009 at 21:16 UTC

    Looking at Net::RawIP, I see that frag_off is one of the flags. Most likely, if you can't find it in the source code or documentation, you have to find the numeric value of the flag and set it via the ->set method. Alternatively, look in the libpcap documentation, around which Net::RawIP is a layer.

      Yes Frag_off is used by the fragment offset field. But it does not control the use of the M or DF bits or the Reserved bit.... Normally the offset is calculated on 13 bits while the other 3 bits are used for M, DF, Reserved
        Wait..... just tried 65535 in frag_off. and then it fills the 3 bits. So in fract frag_off field does more than filling the 13 bits of fragment offset. It does fill as well the 3 remaining bits for M - DF - Reserved. A pitty it's not documented...
Re: how to change ip flags with net::rawip?
by Marshall (Canon) on May 17, 2009 at 02:27 UTC
    I am curious as to why you want to do this?

    This is very application specific. So what are you doing? Normally the standard IP stuff should do what you want. What do you want that is different?

      Trying to force one of my device to crash or at least badly behave in order to open a bug for one of my cases. :-) Now that I had a deeper look Frag_off does more than filling the 13 bits of fragments offset. It fills as well the 3 more significant bits Reserved - More - DF. So basically I can achieve what I want now:-).
Re: how to change ip flags with net::rawip?
by Anonymous Monk on May 17, 2009 at 03:23 UTC