Add support dhcpcd NOCARRIER_ROAMING
authorRoy Marples <roy@marples.name>
Mon, 28 Dec 2020 14:23:24 +0000 (14:23 +0000)
committerRoy Marples <roy@marples.name>
Mon, 28 Dec 2020 14:23:24 +0000 (14:23 +0000)
src/libdhcpcd/dhcpcd.c
src/libdhcpcd/dhcpcd.h

index 0168763600e31ec934fc098c8f6512051b55a135..a38914965b115d6dbbc6c52f6b54bae8dad0e5da 100644 (file)
@@ -85,29 +85,30 @@ struct dhcpcd_vs {
 };
 
 static const struct dhcpcd_vs dhcpcd_states[] = {
-    { DHS_DUMP,                "DUMP" },
-    { DHS_TEST,                "TEST" },
-    { DHS_STOPPED,     "STOPPED" },
-    { DHS_FAIL,                "FAIL" },
-    { DHS_STOP,                "STOP" },
-    { DHS_PREINIT,     "PREINIT" },
-    { DHS_DEPARTED,    "DEPARTED" },
-    { DHS_NOCARRIER,   "NOCARRIER" },
-    { DHS_NAK,         "NAK" },
-    { DHS_EXPIRE,      "EXPIRE" },
-    { DHS_RECONFIGURE, "RECONFIGURE" },
-    { DHS_CARRIER,     "CARRIER" },
-    { DHS_STATIC,      "STATIC" },
-    { DHS_3RDPARTY,    "3RDPARTY" },
-    { DHS_IPV4LL,      "IPV4LL" },
-    { DHS_INFORM,      "INFORM" },
-    { DHS_BOUND,       "BOUND" },
-    { DHS_RENEW,       "RENEW" },
-    { DHS_REBIND,      "REBIND" },
-    { DHS_REBOOT,      "REBOOT" },
-    { DHS_ROUTERADVERT,        "ROUTERADVERT" },
-    { DHS_BOUND,       "DELEGATED" },
-    { DHS_UNKNOWN,     NULL    }
+    { DHS_DUMP,                        "DUMP" },
+    { DHS_TEST,                        "TEST" },
+    { DHS_STOPPED,             "STOPPED" },
+    { DHS_FAIL,                        "FAIL" },
+    { DHS_STOP,                        "STOP" },
+    { DHS_PREINIT,             "PREINIT" },
+    { DHS_DEPARTED,            "DEPARTED" },
+    { DHS_NOCARRIER,           "NOCARRIER" },
+    { DHS_NOCARRIER_ROAMING,   "NOCARRIER_ROAMING " },
+    { DHS_NAK,                 "NAK" },
+    { DHS_EXPIRE,              "EXPIRE" },
+    { DHS_RECONFIGURE,         "RECONFIGURE" },
+    { DHS_CARRIER,             "CARRIER" },
+    { DHS_STATIC,              "STATIC" },
+    { DHS_3RDPARTY,            "3RDPARTY" },
+    { DHS_IPV4LL,              "IPV4LL" },
+    { DHS_INFORM,              "INFORM" },
+    { DHS_BOUND,               "BOUND" },
+    { DHS_RENEW,               "RENEW" },
+    { DHS_REBIND,              "REBIND" },
+    { DHS_REBOOT,              "REBOOT" },
+    { DHS_ROUTERADVERT,                "ROUTERADVERT" },
+    { DHS_BOUND,               "DELEGATED" },
+    { DHS_UNKNOWN,             NULL    }
 };
 
 static ssize_t
@@ -692,6 +693,7 @@ dhcpcd_reason_to_statetype(const char *reason,
        case DHS_PREINIT:
        case DHS_CARRIER:
        case DHS_NOCARRIER:
+       case DHS_NOCARRIER_ROAMING:
        case DHS_DEPARTED:
        case DHS_STOPPED:
                *type = DHT_LINK;
@@ -1286,6 +1288,9 @@ dhcpcd_if_message(DHCPCD_IF *i, bool *new_msg)
                } else
                        reason = _("Link is down");
                break;
+       case DHS_NOCARRIER_ROAMING:
+               reason = _("Link is down, roaming");
+               break;
        case DHS_DEPARTED:
                reason = _("Departed");
                break;
index 7f4709662961a85857784f82103589f0329d6c7a..3c9fd880f9375ec517c7bfb4dc74659ef27878a3 100644 (file)
@@ -120,7 +120,8 @@ extern const char * const dhcpcd_cstates[];
 #define        DHS_REBOOT              20
 #define DHS_ROUTERADVERT       21
 #define DHS_DELEGATED          22
-#define DHR_MAX                        23
+#define DHS_NOCARRIER_ROAMING  23
+#define DHR_MAX                        24
 
 typedef struct dhcpcd_wi_avs {
        int value;