Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2016 09:02:53 GMT
From:      yuanxunzhang@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r308005 - soc2016/yuanxunzhang/head/usr.sbin/eaps
Message-ID:  <201608190902.u7J92rVO055911@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuanxunzhang
Date: Fri Aug 19 09:02:53 2016
New Revision: 308005
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=308005

Log:
  EAPS: modify eaps socket interface

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	Fri Aug 19 08:44:37 2016	(r308004)
+++ soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c	Fri Aug 19 09:02:53 2016	(r308005)
@@ -208,6 +208,13 @@
 		err(1, "EAPS domain name is NULL!");
 	} 
 
+	struct ifreq ifr;
+	memset(&ifr, 0, sizeof(ifr));
+	strlcpy(ifr.ifr_name, domain_name, sizeof(ifr.ifr_name));
+	s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0);
+	if (s < 0)
+		err(1, "socket(family %u,SOCK_DGRAM)", ifr.ifr_addr.sa_family);
+
 	strlcpy(es.ifname, domain_name, sizeof(es.ifname));
 	if (ioctl(s, SIOCSEAPSDOMAIN, &es) == 0) {
 		printf("%s: ", domain_name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608190902.u7J92rVO055911>