Ipv4_packet record construction silently failing

Having skimmed the documentation I can’t see anything which would cause this to fail, but it seems to be throwing an exception/waiting infinitely (this is nested deeply in lwt stuff, so an exception or infinitely waiting may be semantically similar).

        let ip_hd = Ipv4_packet.
            { options= Cstruct.create 0
            ; src
            ; dst
            ; ttl= 38
            ; proto= Marshal.protocol_to_int `UDP
            ; id= Random.int Int.max_int
            ; off= 0 }

Any ideas as to why this is silently failing? (this btw should be all mirage libraries)

The argument to “Random.int” must be “>= 0” and “< 2^30” so I am afraid that “max_int” is far too large.

Ah, I didn’t spot that. Thanks!!