Re: get entire CAN_RAW_FILTER value without knowing its size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/17/20 5:33 PM, Phillip Schichtel wrote:
> I also adjusted my java binding to handle the ERANGE error and
> everything works as expected with your patch applied. I'm using a
> buffer of 10 * sizeof(struct can_filter) now and realloc in case of
> ERANGE using the optlen. So with an unpatched kernel the API is
> currently restricted to the first 10 filters, but that's probably fine.

BTW: The current kernel has an arbitrary limit of 512 filters per socket:

#define CAN_RAW_FILTER_MAX 512
/* maximum number of can_filter set via setsockopt() */

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux