macsec: set actual real device for xmit when !protect_frames
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 30 Jun 2016 22:00:54 +0000 (00:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2016 20:35:56 +0000 (16:35 -0400)
Avoid recursions of dev_queue_xmit() to the wrong net device when
frames are unprotected, since at that time skb->dev still points to
our own macsec dev and unlike macsec_encrypt_finish() dev pointer
doesn't get updated to real underlying device.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macsec.c

index 0e7eff7f1cd27b630c07a02f75c08a02f45ec6dd..8bcd78f9496638e30c313abb74d004729d0dae16 100644 (file)
@@ -2640,6 +2640,7 @@ static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,
                u64_stats_update_begin(&secy_stats->syncp);
                secy_stats->stats.OutPktsUntagged++;
                u64_stats_update_end(&secy_stats->syncp);
+               skb->dev = macsec->real_dev;
                len = skb->len;
                ret = dev_queue_xmit(skb);
                count_tx(dev, ret, len);