Subject: Re: Re: [patch 2/7] CAN: Add PF_CAN core module

From: Oliver Hartkopp <[email-masked]>
Date: Wed, 16 May 2007 20:26:34 +0200

Arnaldo Carvalho de Melo wrote:
>
> <SNIP>
>
> > +
> > +/**
> > + * struct sockaddr_can - the sockaddr structure for CAN sockets
> > + * @can_family:  address family number AF_CAN.
> > + * @can_ifindex: CAN network interface index.
> > + * @can_addr:    transport protocol specific address, mostly CAN IDs.
> > + */
> > +struct sockaddr_can {
> > +       sa_family_t can_family;
> > +       int         can_ifindex;
> > +       union {
> > +               struct { canid_t rx_id, tx_id; } tp16;
> > +               struct { canid_t rx_id, tx_id; } tp20;
> > +               struct { canid_t rx_id, tx_id; } mcnet;
> > +               struct { canid_t rx_id, tx_id; } isotp;
> > +               struct { int     lcu,   type;  } bap;
> > +       } can_addr;
> > +};
>
> Can can_ifindex be turned into a unsigned short?
>

Hm - did you ever search for ifindex in the kernel?
E.g. in struct net_device in include/linux/netdevice.h , or functions 
like dev_get_by_index() ?

The interface index (ifindex) is always(!) defined as an integer.
I think, we would get rightly knocked defining ifindex as a short value ;-)

Regards,
Oliver