Re: in_cksum() for ip packets with multiple mbufs

From: Simon 'corecode' Schubert (corecode_at_fs.ei.tum.de)
Date: 10/24/05

  • Next message: FreeBSD bugmaster: "Current problem reports assigned to you"
    Date: Mon, 24 Oct 2005 11:51:01 +0200
    To: kamal kc <kamal_ckk@yahoo.com>
    
    

    kamal kc wrote:
    > - final thing does this makes any difference
    > (calling the htons() twice):
    >
    > ip->ip_id=htons(ip->ip_id);
    > ip->ip_id=htons(ip->ip_id);

    on little endian machines: yes. on big endian machines: no. So don't
    do it. :)

    freebsd has several fields of the ip headerin host byte order to speed
    up access. they get converted to network byte order at a very late
    stage of the ip output path.

    cheers
       simon

    -- 
    Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
    Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
    Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
    Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: FreeBSD bugmaster: "Current problem reports assigned to you"

    Relevant Pages

    • Re: in_cksum() for ip packets with multiple mbufs
      ... > (calling the htons() twice): ... on little endian machines: yes. ...
      (freebsd-hackers)
    • Re: serialization class and endian
      ... Well, again htonland htons() are completely redundant, since the ... By "decomposition" I'm assuming you mean: ... you try to transmit the bytes between a big endian machine and a little ... // works on both big and little endian machines: ...
      (comp.programming)
    • Re: serialization class and endian
      ... Well, again htonland htons() are completely redundant, since the ... a big endian machines results in the byte stream: ... encoding byte by byte is: ... this only works if the type of invalue is actually ...
      (comp.programming)
    • Re: serialization class and endian
      ... Well, again htonland htons() are completely redundant, since the ... a big endian machines results in the byte stream: ... std::string str; ... encoding byte by byte is: ...
      (comp.programming)
    • Re: serialization class and endian
      ... Well, again htonland htons() are completely redundant, since the ... a big endian machines results in the byte stream: ... std::string str; ... encoding byte by byte is: ...
      (comp.programming)