On 10/26/2010 04:04 PM, Alexander Stein wrote:
> On Tuesday 26 October 2010, 15:44:26 Marc Kleine-Budde wrote:
>> On 10/26/2010 03:16 PM, Alexander Stein wrote:
>>> I'm just wondering what's the correct way to change the bitrate. I
>>> already noticed I need to shutdown the can interface previously. So I
>>> use system() with "ip link..." to shutdown, set the new bitrate and
>>> restart the interface. I kept my sockets during bitrate change and the
>>> first read() or write() call return ENETDOWN once. Afterwards those
>>> sockets work normally.
>>> So, how can I get rid of this ENETDOWN? Close the sockets on this
>>> interface previously?
>>
>> Yes. Shuttig down the interface causes all sockets bind()ed to that
>> interface to get an -ENETDOWN. Either don't bind() to a specific can
>> interface or close the sockets prior to shutdown and reopen them after.
> 
> Unbound sockets receive frames from all interfaces, right? Well, this is 
> unusable in a test software on a multi channel hardware.

ACK :)

Marc

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

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to