[Xenomai-git] Gilles Chanteperdrix : drivers/rtnet: refuse to uselessly queue packets
Module: xenomai-3 Branch: stable-3.0.x Commit: 0eeba1c172efabbc1d2194f7893cd40ad3ee1162 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0eeba1c172efabbc1d2194f7893cd40ad3ee1162 Author: Gilles Chanteperdrix Date: Sat Oct 31 21:33:18 2015 +0100 drivers/rtnet: refuse to uselessly queue packets If network interface is not running. --- kernel/drivers/net/stack/rtdev.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/drivers/net/stack/rtdev.c b/kernel/drivers/net/stack/rtdev.c index 29d79c6..f7e1f41 100644 --- a/kernel/drivers/net/stack/rtdev.c +++ b/kernel/drivers/net/stack/rtdev.c @@ -33,6 +33,7 @@ #include #include #include +#include static unsigned int device_rtskbs = DEFAULT_DEVICE_RTSKBS; @@ -705,6 +706,12 @@ int rtdev_xmit(struct rtskb *rtskb) rtdev = rtskb->rtdev; +if (!rtnetif_carrier_ok(rtdev)) { + err = -EAGAIN; + kfree_rtskb(rtskb); + return err; +} + if (rtskb_acquire(rtskb, &rtdev->dev_pool) != 0) { err = -ENOBUFS; kfree_rtskb(rtskb); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : drivers/rtnet: refuse to uselessly queue packets
Module: xenomai-3 Branch: next Commit: aab83672cd4f9e4549af407fd49bc8db1540d4e4 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=aab83672cd4f9e4549af407fd49bc8db1540d4e4 Author: Gilles Chanteperdrix Date: Sat Oct 31 21:33:18 2015 +0100 drivers/rtnet: refuse to uselessly queue packets If network interface is not running. --- kernel/drivers/net/stack/rtdev.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/drivers/net/stack/rtdev.c b/kernel/drivers/net/stack/rtdev.c index 29d79c6..f7e1f41 100644 --- a/kernel/drivers/net/stack/rtdev.c +++ b/kernel/drivers/net/stack/rtdev.c @@ -33,6 +33,7 @@ #include #include #include +#include static unsigned int device_rtskbs = DEFAULT_DEVICE_RTSKBS; @@ -705,6 +706,12 @@ int rtdev_xmit(struct rtskb *rtskb) rtdev = rtskb->rtdev; +if (!rtnetif_carrier_ok(rtdev)) { + err = -EAGAIN; + kfree_rtskb(rtskb); + return err; +} + if (rtskb_acquire(rtskb, &rtdev->dev_pool) != 0) { err = -ENOBUFS; kfree_rtskb(rtskb); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git