From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radu Rendec Subject: [PATCH 0/1] macsec: reflect the master interface state Date: Tue, 18 Sep 2018 20:16:11 -0400 Message-ID: <20180919001612.2636-1-radu.rendec@gmail.com> Cc: David Miller , Sabrina Dubroca , Radu Rendec To: netdev@vger.kernel.org Return-path: Received: from mail-io1-f68.google.com ([209.85.166.68]:39899 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbeISFvo (ORCPT ); Wed, 19 Sep 2018 01:51:44 -0400 Received: by mail-io1-f68.google.com with SMTP id l7-v6so3065740iok.6 for ; Tue, 18 Sep 2018 17:16:39 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: Hi everyone, I came across an issue with macsec interfaces where they don't reflect the master interface state. On one hand you cannot set the macsec interface link state to up unless the master interface is already up, but on the other hand, if the master interface goes down while the macsec interface is already up, the macsec interface stays up. This may also be problematic if macsec interfaces are used as bridge ports (probably not very usual, but that is my use case anyway). In that case the bridge has no idea of the link state of the real device, since it only sees the macsec interface, which is always up. I'm proposing the attached patch, which is heavily inspired from the vlan (802.1q) driver. However, in the case of macsec, there is no concept of "loose binding" and the state is always reflected. I tested the patch on x86_64, but I guess it's pretty much architecture independent. Any comments or suggestions are welcome. Thanks! Radu Rendec (1): macsec: reflect the master interface state drivers/net/macsec.c | 57 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 11 deletions(-) -- 2.17.1