Russell,

struct pppoe_packet *p;

/* PPPoE packet; includes Ethernet headers and such */

struct pppoe_packet{
        struct sockaddr_ll addr;
        struct pppoe_tag *tags[MAX_TAGS];
        struct pppoe_hdr *hdr;
        char buf[MAX_PAYLOAD];          /* buffer in which tags are held */
};

struct pppoe_tag{
        _u16 tag_type;
        _u16 tag_len;
        char tag_data[0];
}__attribute ((packed));



And hu_val is,

struct session *hu_val;

struct session {

        /* Administrative */
        int type;
        int opt_debug;
        int detached;
        int np;
        int log_to_fd;
        int ifindex;                    /* index of device */
        char name[IFNAMSIZ];            /*dev name */
        struct pppoe_packet curr_pkt;

        packet_cb_t init_disc;
        packet_cb_t rcv_pado;
        packet_cb_t rcv_padi;
        packet_cb_t rcv_pads;
        packet_cb_t rcv_padr;
        packet_cb_t rcv_padt;
        packet_cb_t timeout;


        /* Generic */
        struct filter *filt;
        struct sockaddr_ll local;
        struct sockaddr_ll remote;
        struct sockaddr_pppox sp;
        int fd;                         /* fd of PPPoE socket */


        /* For client */
        int retransmits;                /* Number of retransmission performed
                                           if < 0 , retransmissions disabled */
        int retries;
        int state;
        int opt_daemonize;

        /* For server */
        int fork;

        /* For forwarding */
        int fwd_sock;
        char fwd_name[IFNAMSIZ];        /* Name of device to forward to */
} __attribute__ ((packed));

David
-----Original Message-----
From: Russell King - ARM Linux [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 3:43 PM
To: David Milburn
Cc: Doug Dunlop; [EMAIL PROTECTED]
Subject: Re: pppoe using 2.4 kernel


On Tue, Apr 03, 2001 at 10:38:24AM -0500, David Milburn wrote:
>
> The problem that you are seeing is in libpppoe.c,
>
> #define TAG_DATA(type, tag_ptr) ((type *) tag_ptr+1)
>
> This is causing the failure in verify_packet where hu_val is set, if you
> printf the value of 'ses' you will probably see that the f1a0 is correct,
it
> is the 0400 causing the miscompare.
>
> hu_val = *TAG_DATA(struct session*, p->tags[TAG_HOST_UNIQ]);
>
> Maybe someone more familiar with the arm compiler can shed some light?

Out of interest, what type is hu_val and p->tags ?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [EMAIL PROTECTED]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |


_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to