Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Compensate for bad inet checksum routine

by jwkrahn (Monsignor)
on Mar 29, 2013 at 17:35 UTC ( #1026178=note: print w/ replies, xml ) Need Help??


in reply to Compensate for bad inet checksum routine

sub prepchksum { my ( $payload ) = @_; ###DEBUG: printf "BEFORE = %s\n", unpack 'H*', $payload; if ( length( $payload ) % 2 == 1 ) { if ( substr( $payload, -1 ) ge "\x80" ) { substr $payload, -1, 1, chr ord( substr $payload, -1 ) - 1 +; substr $payload, -1, 0, "\xff"; } else { substr $payload, -1, 0, "\0"; } } ###DEBUG: printf "AFTER = %s\n", unpack 'H*', $payload; }
Comment on Re: Compensate for bad inet checksum routine
Download Code
Replies are listed 'Best First'.
Re^2: Compensate for bad inet checksum routine
by VinsWorldcom (Vicar) on Mar 29, 2013 at 18:12 UTC

    Beautiful! ++

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026178]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-04-29 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (438 votes). Check out past polls.