Mercurial > hg > dhcpcd
comparison src/if-options.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 | 2a519da0f1a2 |
comparison
equal
deleted
inserted
replaced
| 5550:dba7608e00b3 | 5551:0c4608a6cc2a |
|---|---|
| 1000 else if (strcmp(arg, "llt") == 0) | 1000 else if (strcmp(arg, "llt") == 0) |
| 1001 ctx->duid_type = DUID_LLT; | 1001 ctx->duid_type = DUID_LLT; |
| 1002 else if (strcmp(arg, "uuid") == 0) | 1002 else if (strcmp(arg, "uuid") == 0) |
| 1003 ctx->duid_type = DUID_UUID; | 1003 ctx->duid_type = DUID_UUID; |
| 1004 else { | 1004 else { |
| 1005 logwarnx("%s: invalid duid type", arg); | 1005 dl = hwaddr_aton(NULL, arg); |
| 1006 ctx->duid_type = DUID_DEFAULT; | 1006 if (dl != 0) { |
| 1007 no = realloc(ctx->duid, dl); | |
| 1008 if (no == NULL) | |
| 1009 logerrx(__func__); | |
| 1010 else { | |
| 1011 ctx->duid = no; | |
| 1012 ctx->duid_len = hwaddr_aton(no, arg); | |
| 1013 } | |
| 1014 } | |
| 1007 } | 1015 } |
| 1008 break; | 1016 break; |
| 1009 case 'E': | 1017 case 'E': |
| 1010 ifo->options |= DHCPCD_LASTLEASE; | 1018 ifo->options |= DHCPCD_LASTLEASE; |
| 1011 break; | 1019 break; |
