Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bridge and interface details from /sys/class/net/ is objectionable for embedded platform #20

Open
geek0007 opened this issue Sep 9, 2016 · 7 comments

Comments

@geek0007
Copy link

geek0007 commented Sep 9, 2016

current MSTP source use interface duplex, speed, state etc from /sys/class/net/
but this should be moved to driver_deps.c as many embedded platform do not have fully grown switch driver and sysfs do not show real status of interface.

driver_deps.c with #define SYSFS_EN 1 should help user select if platform do not support sysfs for switch and he can write to get this details from switch instead in mstp source.

@commodo
Copy link
Member

commodo commented Sep 9, 2016

that is an open discussion about how low (embedded) we should go
as a general item, we do need to add an abstraction layer for bridges ; a libbridge or something like that abstracts calls to various switch types/chips

@geek0007
Copy link
Author

geek0007 commented Sep 9, 2016

sometime user want to mix of sysfs and other API to get interfaces or port details.

if this moved to driver_deps.c user can easily tweak the code to get port details on embedded platform.

@vivien
Copy link
Member

vivien commented Sep 9, 2016

What information do we have in sysfs that we don't via netlink?

@geek0007
Copy link
Author

Embedded platform like OpenWRT use libnl-tiny ( This package contains a stripped down version of libnl ) which is one more issue other than sysfs that MSTP code has to take care of.
I could not find which netlink functions are stripped down but I find mstp simply could not control ports or get real details about switch ports.

@vivien
Copy link
Member

vivien commented Sep 14, 2016

Netlink should be more than enough to implement mstpd. If it is missing some attributes, this should be fixed upstream. ioctl's are deprecated and sysfs is made for user confort, not for robust userspace daemon. So I guess we should track and convert any non-netlink calls to nl-based API (libnl-tiny might work just fine).

@geek0007
Copy link
Author

Below mentioned issue I have separately raised which is because of libnl-tiny:

mstp could not listen 802.2 STP traffic-

in packet.c --

s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_802_2));

this line of code need to be updated to

s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));

which is highly dangerous and I found crashes of mstpd when there is some huge traffic.

Need to explore more about netlink and its variants.

@vivien
Copy link
Member

vivien commented Sep 14, 2016

Please don't double post issues, you already posted this here (you can still reference them though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants