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

EtherateMT starts when interface is down #40

Open
jwbensley opened this issue Nov 18, 2019 · 1 comment
Open

EtherateMT starts when interface is down #40

jwbensley opened this issue Nov 18, 2019 · 1 comment

Comments

@jwbensley
Copy link
Owner

EtherateMT doesn't check if the interface is physically up and will send traffic out of an interface which is down;

This is an interace that is disabled with sudo ip link set down dev eth2:

bensley@htpc-ubuntu:~/c/EtherateMT$ sudo ./etherate_mt -i eth2
Using inteface eth2 (4).
Setting interface promiscuous mode
Frame size set to 1514 bytes.
Using raw packet socket with send()/read().
Running in Tx mode.
17927:Socket Tx error (Network is down)
Removing interface promiscuous mode

This is an interface which is up (sudo ip link set up dev eth2) but the cable is disconnected:

bensley@htpc-ubuntu:~/c/EtherateMT$ sudo ./etherate_mt -i eth2
Using inteface eth2 (4).
Setting interface promiscuous mode
Frame size set to 1514 bytes.
Using raw packet socket with send()/read().
Running in Tx mode.
0.	Rx: 0.00 Gbps (0 fps)	Tx: 22.66 Gbps (1871223 fps)
1.	Rx: 0.00 Gbps (0 fps)	Tx: 22.90 Gbps (1890306 fps)
2.	Rx: 0.00 Gbps (0 fps)	Tx: 22.89 Gbps (1889481 fps)
^CQuitting...
Removing interface promiscuous mode
@jwbensley jwbensley added this to the v1.0 milestone Nov 18, 2019
@jwbensley
Copy link
Owner Author

From: https://github.com/jwbensley/Etherate/blob/master/functions.c#L1349

                    // Is this interface even up?
                    if (ioctl(intf->sock_fd, SIOCGIFFLAGS, &ifreq) == -1) break;
                    if (!(ifreq.ifr_flags & IFF_UP && ifreq.ifr_flags & IFF_RUNNING)) break;

@jwbensley jwbensley removed this from the v1.0 milestone Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant