diff options
author | Dan McDonald <danmcd@omniti.com> | 2014-05-18 21:18:36 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2014-05-19 10:53:50 -0400 |
commit | 60b43c45a204a6c0651e8017e1e505015ba74094 (patch) | |
tree | c57d127904561f99dbfe124ba0007a38fe2da006 | |
parent | 4d6a58d3c7586ed5866f9309d460081a9102c5e6 (diff) | |
download | illumos-joyent-60b43c45a204a6c0651e8017e1e505015ba74094.tar.gz |
4868 ifconfig(1M)'s "addif" uses an uninitialized mask if not specified
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Stormont <AStormont@racktopsystems.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c index 4fb78375f7..299bb4740d 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c @@ -1,8 +1,7 @@ /* - * Copyright 2012, Daniil Lunev. All rights reserved. - */ -/* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, Daniil Lunev. All rights reserved. + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. */ /* * Copyright (c) 1983 Regents of the University of California. @@ -1836,6 +1835,9 @@ addif(char *str, int64_t param) setaddr = 0; (*afp->af_getaddr)(str, (struct sockaddr *)&laddr, &prefixlen); + (void) memset(&mask, 0, sizeof (mask)); + mask.ss_family = afp->af_af; + switch (prefixlen) { case NO_PREFIX: /* Nothing there - ok */ |