socsvn commit: r307556 - soc2016/yuanxunzhang/head/usr.sbin/eaps
yuanxunzhang at FreeBSD.org
yuanxunzhang at FreeBSD.org
Sun Aug 14 04:08:05 UTC 2016
Author: yuanxunzhang
Date: Sun Aug 14 04:08:04 2016
New Revision: 307556
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307556
Log:
EAPS: check eaps domian name
Modified:
soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c
Modified: soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c
==============================================================================
--- soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c Sun Aug 14 03:49:37 2016 (r307555)
+++ soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c Sun Aug 14 04:08:04 2016 (r307556)
@@ -66,7 +66,7 @@
int keyword(const char *);
static void create_domain(int, char **, int);
-static void delete_domain(int, char **);
+static void delete_domain(int, char **, int);
static void display(int, char **);
static void usage(const char *);
void load_module(const char *);
@@ -103,7 +103,7 @@
struct module_stat mstat;
int fileid, modid;
const char *cp;
-
+
mstat.version = sizeof(struct module_stat);
for (fileid = kldnext(0); fileid > 0; fileid = kldnext(fileid)) {
/* scan modules in file */
@@ -135,13 +135,17 @@
printf("Create eaps %s!\n", domain_name);
+ if (domain_name == null) {
+ err(1, "EAPS domain name is NULL!");
+ }
+
// Create EAPS interface
/* check and maybe load support for this interface */
load_module(eaps_ifname);
- struct ifreq ifr;
-
+ struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
+
(void) strlcpy(ifr.ifr_name, eaps_ifname, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCIFCREATE2, &ifr) < 0)
@@ -151,7 +155,7 @@
}
static void
-delete_domain(int argc, char **argv)
+delete_domain(int argc, char **argv, int s)
{
int error = 0;
printf("Delete eaps domain %s!\n", *(++argv));
More information about the svn-soc-all
mailing list