aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/af_inet6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/af_inet6.c')
-rw-r--r--sbin/ifconfig/af_inet6.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index a0138e9b3de6..9386f5eaf513 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -29,11 +29,6 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
-
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -433,6 +428,11 @@ in6_getaddr(const char *addr_str, int which)
{
struct in6_px *px = sin6tab_nl[which];
+ if (which == MASK)
+ errx(1, "netmask: invalid option for inet6");
+ if (which == BRDADDR)
+ errx(1, "broadcast: invalid option for inet6");
+
px->set = true;
px->plen = 128;
if (which == ADDR) {
@@ -493,7 +493,7 @@ in6_exec_nl(if_ctx *ctx, unsigned long action, void *data)
snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid);
snl_end_attr_nested(&nw, off);
- if (!snl_finalize_msg(&nw) || !snl_send_message(ctx->io_ss, hdr))
+ if (! (hdr = snl_finalize_msg(&nw)) || !snl_send_message(ctx->io_ss, hdr))
return (0);
struct snl_errmsg_data e = {};
@@ -726,6 +726,8 @@ static struct cmd inet6_cmds[] = {
DEF_CMD_ARG("pltime", setip6pltime),
DEF_CMD_ARG("vltime", setip6vltime),
DEF_CMD("eui64", 0, setip6eui64),
+ DEF_CMD("stableaddr", ND6_IFF_STABLEADDR, setnd6flags),
+ DEF_CMD("-stableaddr", -ND6_IFF_STABLEADDR, setnd6flags),
#ifdef EXPERIMENTAL
DEF_CMD("ipv6_only", ND6_IFF_IPV6_ONLY_MANUAL,setnd6flags),
DEF_CMD("-ipv6_only", -ND6_IFF_IPV6_ONLY_MANUAL,setnd6flags),
@@ -753,13 +755,13 @@ static struct afswtch af_inet6 = {
#ifdef WITHOUT_NETLINK
.af_difaddr = SIOCDIFADDR_IN6,
.af_aifaddr = SIOCAIFADDR_IN6,
- .af_ridreq = &in6_addreq,
+ .af_ridreq = &in6_ridreq,
.af_addreq = &in6_addreq,
.af_exec = af_exec_ioctl,
#else
.af_difaddr = NL_RTM_DELADDR,
.af_aifaddr = NL_RTM_NEWADDR,
- .af_ridreq = &in6_add,
+ .af_ridreq = &in6_del,
.af_addreq = &in6_add,
.af_exec = in6_exec_nl,
#endif