comparison src/dhcpcd.c @ 5551:0c4608a6cc2a draft

options: Allow duid to take a value If a value is given, it overrides /var/db/dhcpcd/duid.
author Roy Marples <roy@marples.name>
date Wed, 25 Nov 2020 14:19:55 +0000
parents dba7608e00b3
children 66dc60bf133d
comparison
equal deleted inserted replaced
5550:dba7608e00b3 5551:0c4608a6cc2a
839 static void 839 static void
840 dhcpcd_initduid(struct dhcpcd_ctx *ctx, struct interface *ifp) 840 dhcpcd_initduid(struct dhcpcd_ctx *ctx, struct interface *ifp)
841 { 841 {
842 char buf[DUID_LEN * 3]; 842 char buf[DUID_LEN * 3];
843 843
844 if (ctx->duid != NULL) 844 if (ctx->duid != NULL) {
845 return; 845 if (ifp == NULL)
846 goto log;
847 return;
848 }
846 849
847 duid_init(ctx, ifp); 850 duid_init(ctx, ifp);
848 if (ctx->duid == NULL) 851 if (ctx->duid == NULL)
849 return; 852 return;
850 853
854 log:
851 loginfox("DUID %s", 855 loginfox("DUID %s",
852 hwaddr_ntoa(ctx->duid, ctx->duid_len, buf, sizeof(buf))); 856 hwaddr_ntoa(ctx->duid, ctx->duid_len, buf, sizeof(buf)));
853 } 857 }
854 858
855 void 859 void