OSPF checksum!!

"Mustafa Abu Sedera" <[email protected]> Tue, 06 Jul 2004 23:42:47 +0000
Newsgroups gmane.comp.security.libnet
Message-ID <[email protected]>
Hi all,
I neede to write a small program which uses the libnet_build_ospf_xx() 
functions...

I noiced that when I set the checksum field in the ospf_build_lsa() to zero 
i get an error that libnet_do_checksum does not support this protocol.

When i digged into the code i found the following:

in libnet_build_ospf.c file  function libnet_build_ospfv2_lsa
-----------------------------------------
p = libnet_pblock_probe(l, ptag, n, LIBNET_PBLOCK_OSPF_LSA_H); //pblock type 
of header
--------------------------------------------


libnet_pblock.c file  function libnet_pblock_p2p() is called to calculate 
the checksum...
------------------------------------------
case LIBNET_PBLOCK_LS_RTR_H:  //shouldnt this be LIBNET_PBLOCK_OSPF_LSA_H???
            return (IPPROTO_OSPF_LSA);  //rtr_lsa_hdrdoes not even have a 
checksum field
------------------------------------------

in the libnet_checksum.c file  function libnet_do_checksum():
.............................................
case IPPROTO_OSPF_LSA:  //so it should be supported
.............................................

I checked the samples and found that the checksum field of 
libnet_build_ospfv2_lsa() is just filled with 0xffff....and not 0 to test 
the checksum function.

So am I right or did I catch something totally wrong??? Please correct me if 
I am false.

Regards, Mustaffa Abu Sedira

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail