Thanks to Eliot Lear for the patch.
p += ifo->vendorclassid[0] + 1;
}
+ if (ifo->mudurl[0]) {
+ AREA_CHECK(ifo->mudurl[0]);
+ *p++ = DHO_MUDURL;
+ memcpy(p, ifo->mudurl, (size_t)ifo->mudurl[0] + 1);
+ p += ifo->mudurl[0] + 1;
+ }
+
if (type != DHCP_INFORM) {
if (ifo->leasetime != 0) {
AREA_CHECK(4);
DHO_VIVCO = 124, /* RFC 3925 */
DHO_VIVSO = 125, /* RFC 3925 */
DHO_FORCERENEW_NONCE = 145, /* RFC 6704 */
+ DHO_MUDURL = 161, /* draft-ietf-opsawg-mud */
DHO_SIXRD = 212, /* RFC 5969 */
DHO_MSCSR = 249, /* MS code for RFC 3442 */
DHO_END = 255
len += sizeof(o) + 1 + hl;
}
+ if (ifo->mudurl[0])
+ len += sizeof(o) + ifo->mudurl[0];
+
if ((ifo->auth.options & DHCPCD_AUTH_SENDREQUIRE) !=
DHCPCD_AUTH_SENDREQUIRE)
len += sizeof(o); /* Reconfigure Accept */
memcpy(o_lenp, &o.len, sizeof(o.len));
}
+ if (ifo->mudurl[0])
+ COPYIN(D6_OPTION_MUDURL,
+ ifo->mudurl + 1, ifo->mudurl[0]);
+
+
if ((ifo->auth.options & DHCPCD_AUTH_SENDREQUIRE) !=
DHCPCD_AUTH_SENDREQUIRE)
COPYIN1(D6_OPTION_RECONF_ACCEPT, 0);
#define D6_OPTION_PD_EXCLUDE 67
#define D6_OPTION_SOL_MAX_RT 82
#define D6_OPTION_INF_MAX_RT 83
+#define D6_OPTION_MUDURL 112
#define D6_FQDN_PTR 0x00
#define D6_FQDN_BOTH 0x01
# DHCP TFTP Server Address, RFC5859
define 150 array ipaddress tftp_servers
+# DHCP MUD URL, draft-ietf-opsawg-mud
+define 161 string mudurl
+
+# Apart from 161...
# Options 151-157 are used for Lease Query, RFC6926 and not for dhcpcd
# Options 158-174 are unused, RFC3942
+
# Options 175-177 are tentativel assigned for Etherboot
# Options 178-207 are unused, RFC3942
# DHCPv6 Address Selection Policy
# Currently not supported
+# DHCPv6 MUD URL, draft-ietf-opsawg-mud
+define6 112 string mudurl
+
# Options 86-65535 are unasssinged
##############################################################################
will supply a default metric of 200 +
.Xr if_nametoindex 3 .
An extra 100 will be added for wireless interfaces.
+.It Ic mudurl Ar url
+Specifies the URL for a manufacturer usage description (MUD).
+The description is used by upstream network devices to instantiate any
+desired access lists.
+See draft-ietf-opsawg-mud for more information.
.It Ic noalias
Any pre-existing IPv4 addresses existing address will be removed from the
interface when adding a new IPv4 address.
#define O_INFORM6 O_BASE + 45
#define O_LASTLEASE_EXTEND O_BASE + 46
#define O_INACTIVE O_BASE + 47
+#define O_MUDURL O_BASE + 48
const struct option cf_options[] = {
{"background", no_argument, NULL, 'b'},
{"noup", no_argument, NULL, O_NOUP},
{"lastleaseextend", no_argument, NULL, O_LASTLEASE_EXTEND},
{"inactive", no_argument, NULL, O_INACTIVE},
+ {"mudurl", required_argument, NULL, O_MUDURL},
{NULL, 0, NULL, '\0'}
};
case O_INACTIVE:
ifo->options |= DHCPCD_INACTIVE;
break;
+ case O_MUDURL:
+ ARG_REQUIRED;
+ s = parse_string((char *)ifo->mudurl + 1, MUDURL_MAX_LEN, arg);
+ if (s == -1) {
+ logger(ctx, LOG_ERR, "mudurl: %m");
+ return -1;
+ }
+ *ifo->mudurl = (uint8_t)s;
+ break;
default:
return 0;
}
#define CLIENTID_MAX_LEN 48
#define USERCLASS_MAX_LEN 255
#define VENDOR_MAX_LEN 255
+#define MUDURL_MAX_LEN 255
#define DHCPCD_ARP (1ULL << 0)
#define DHCPCD_RELEASE (1ULL << 1)
uint8_t clientid[CLIENTID_MAX_LEN + 2];
uint8_t userclass[USERCLASS_MAX_LEN + 2];
uint8_t vendor[VENDOR_MAX_LEN + 2];
+ uint8_t mudurl[MUDURL_MAX_LEN + 2];
size_t blacklist_len;
in_addr_t *blacklist;