ICT: Diary
D: 28 W: 05

< May 2016 >
Sun Mon Tue Wed Thu Fri Sat
1234567
891011121314
15161718192021
22232425262728
293031 

Based on notaweblog.php by joshua stein

[ ] Sunday, 22 May 2016 [ ]

NSA addition to ifconfig

The patch:

--- /usr/src/sbin/ifconfig/ifconfig.c	Mon May  9 23:03:20 2016
+++ ./ifconfig.c	Sun May 22 11:04:30 2016
@@ -5189,7 +5189,14 @@ setiflladdr(const char *addr, int param)
  {
  	struct ether_addr *eap, eabuf;

-	if (!strcmp(addr, "random")) {
+	if (!strcmp(addr, "nsa")) {
+		arc4random_buf(&eabuf, sizeof eabuf);
+		/* NSA hardware address */
+		eabuf.ether_addr_octet[0] = 0x00;
+		eabuf.ether_addr_octet[1] = 0x20;
+		eabuf.ether_addr_octet[2] = 0x91;
+		eap = &eabuf;
+	} else if (!strcmp(addr, "random")) {
  		arc4random_buf(&eabuf, sizeof eabuf);
  		/* Non-multicast and claim it is a hardware address */
  		eabuf.ether_addr_octet[0] &= 0xfc;
--- /usr/src/sbin/ifconfig/ifconfig.8	Mon May  9 23:03:20 2016
+++ ./ifconfig.8	Sun May 22 11:01:14 2016
@@ -323,10 +323,11 @@ of this is to select the connector type for some Ether
  Refer to the man page for the specific driver for more information.
  .It Fl link[0-2]
  Disable special processing at the link level with the specified interface.
-.It Cm lladdr Ar etheraddr Ns | Ns Cm random
+.It Cm lladdr Ar etheraddr Ns | Ns Cm random | Ns Cm nsa
  Change the link layer address (MAC address) of the interface.
-This should be specified as six colon-separated hex values, or can
-be chosen randomly.
+This should be specified as six colon-separated hex values, can
+be chosen randomly, or first three octets of 00:20:91 and random
+last three octets.
  .It Cm media Op Ar type
  Set the media type of the interface to
  .Ar type .

and the lobste.rs coverage :~)

ifconfigOpenBSD


$Id: diary,v 1.38 2025/01/01 22:43:54 fred Exp $