[9fans] OUdphdr - Plan9

This is a discussion on [9fans] OUdphdr - Plan9 ; the comment in this diff confuses me. is OUdphdr now used for ip6 as opposed to Udphdr? i guess i don't quite understand the emphasis on v6 since plan 9 represents all ip addresses as v6. also, why are there ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [9fans] OUdphdr

  1. [9fans] OUdphdr

    the comment in this diff confuses me. is OUdphdr now used
    for ip6 as opposed to Udphdr? i guess i don't quite understand
    the emphasis on v6 since plan 9 represents all ip addresses as v6.

    also, why are there two udp packet formats defined?

    - erik

    enum
    /n/sources/plan9//sys/include/ip.h:74,87 - ip.h:74,87
    typedef struct OUdphdr OUdphdr;
    struct OUdphdr
    {
    - uchar raddr[IPaddrlen]; /* V6 remote address */
    - uchar laddr[IPaddrlen]; /* V6 local address */
    - uchar rport[2]; /* remote port */
    - uchar lport[2]; /* local port */
    + uchar raddr[IPaddrlen]; /* remote address and port */
    + uchar laddr[IPaddrlen]; /* local address and port */
    + uchar rport[2];
    + uchar lport[2];
    };


  2. Re: [9fans] OUdphdr

    > the comment in this diff confuses me. is OUdphdr now used
    > for ip6 as opposed to Udphdr? i guess i don't quite understand
    > the emphasis on v6 since plan 9 represents all ip addresses as v6.
    >
    > also, why are there two udp packet formats defined?
    >
    > - erik
    >
    > enum
    > /n/sources/plan9//sys/include/ip.h:74,87 - ip.h:74,87
    > typedef struct OUdphdr OUdphdr;
    > struct OUdphdr
    > {
    > - uchar raddr[IPaddrlen]; /* V6 remote address */
    > - uchar laddr[IPaddrlen]; /* V6 local address */
    > - uchar rport[2]; /* remote port */
    > - uchar lport[2]; /* local port */
    > + uchar raddr[IPaddrlen]; /* remote address and port */
    > + uchar laddr[IPaddrlen]; /* local address and port */
    > + uchar rport[2];
    > + uchar lport[2];
    > };


    Don't worry about the comment.
    It's just a clarification (since obviously
    raddr doesn't have a port in it).
    Nothing has actually changed in the format.

    As the name suggests, OUdphdr is old and
    obsolete. The new Udphdr added the interface
    where the packet came in, which is needed for
    things like dhcpd.

    There are two formats because the user space
    programs and kernels couldn't be updated all
    in one go. Now that the kernels with the new
    headers have propagated, the programs
    that still use the old header format should really be
    changed to use the new format. Those programs
    appear to be just ip/dhcpclient, ip/ipconfig,
    ip/rip, and ip/udpecho. But like a lot of Plan 9
    maintenance, it just never happened.

    Russ



+ Reply to Thread