Skip to content

RPI 3B+ state of /sys/class/net/eth0/carrier stuck at 1 #1100

Closed
@brubbel

Description

@brubbel

TLDR; The eth0 carrier state flag gets stuck at '1' if /sys/class/net/eth0/carrier is polled within <1 second after unplugging the network cable. Systems that depend on it then fail (e.g. route).

Hardware (3 devices were tested, on 2 different networks):

  1. RPI3B+ (rev. a020d3), new raspbian (kernel 4.14.79-v7+).
  2. Raspberry pi official power supply (5.1V, 2.5A)
  3. peripherals: ethernet cable, usb keyboard (dell), hdmi screen (dell).

Setup

  1. OS (2018-11-13-raspbian-stretch-lite.img) is written to SD-card, ssh is not enabled.
  2. ethernet cable is plugged in before boot.
  3. local login.
  4. cat /sys/class/net/eth0/carrier (do enter yet!)
  5. unplug ethernet cable
  6. enter within 1 second after unplug.
  7. (To retry a reboot is needed.)

Result
The /sys/class/net/eth0/carrier flag gets stuck at '1'.
Also, the 'route' command hangs as the os probably doesn't know the interface is down (route -n works).

Expected result
The /sys/class/net/eth0/carrier flag becomes '0'

Situation where this issue is relevant
A script may be checking the carrier flag to failover to WiFi, for example every 10 seconds. However, every once in a while a race condition can occur where this bug is triggered on disconnecting the cable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions