summaryrefslogtreecommitdiff
path: root/sys/net/if_spppsubr.c
diff options
context:
space:
mode:
authorBjorn Ketelaars <bket@cvs.openbsd.org>2021-11-17 18:00:25 +0000
committerBjorn Ketelaars <bket@cvs.openbsd.org>2021-11-17 18:00:25 +0000
commit5a08e63c481796d71cd9db77f29c4619baae2c11 (patch)
tree02ab26ea0f161a1f20b8bacc8448b70e7b57004b /sys/net/if_spppsubr.c
parent575e625eaf18fc2ccb81b4a2f7645fd757e7298c (diff)
Display DNS information from sppp(4) in ifconfig(8)
Behaviour is similar to that of umb(4). OK kn@
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r--sys/net/if_spppsubr.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 759370e7be7..3982c29bbdc 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.189 2021/11/10 20:24:22 bket Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.190 2021/11/17 18:00:24 bket Exp $ */
/*
* Synchronous PPP link level subroutines.
*
@@ -4561,6 +4561,23 @@ sppp_get_params(struct sppp *sp, struct ifreq *ifr)
free(spa, M_DEVBUF, sizeof(*spa));
break;
}
+ case SPPPIOGDNS:
+ {
+ struct sdnsreq *spd;
+
+ spd = malloc(sizeof(*spd), M_DEVBUF, M_WAITOK);
+
+ spd->cmd = cmd;
+ memcpy(spd->dns, sp->ipcp.dns, sizeof(spd->dns));
+
+ if (copyout(spd, (caddr_t)ifr->ifr_data, sizeof(*spd)) != 0) {
+ free(spd, M_DEVBUF, 0);
+ return EFAULT;
+ }
+
+ free(spd, M_DEVBUF, sizeof(*spd));
+ break;
+ }
default:
return EINVAL;
}