Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 wandering the Monastery: (5)
As of 2014-09-17 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls