Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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
Re^2: Compensate for bad inet checksum routine
by VinsWorldcom (Priest) 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 cooling their heels in the Monastery: (8)
As of 2014-07-28 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (186 votes), past polls