svn commit: r311762 - head/usr.bin/netstat
Author: delphij Date: Mon Jan 9 07:36:31 2017 New Revision: 311762 URL: https://svnweb.freebsd.org/changeset/base/311762 Log: Fix typo. MFC after:3 days Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c == --- head/usr.bin/netstat/route.cMon Jan 9 06:36:17 2017 (r311761) +++ head/usr.bin/netstat/route.cMon Jan 9 07:36:31 2017 (r311762) @@ -496,7 +496,7 @@ fmt_sockaddr(struct sockaddr *sa, struct cq = buf; slim = sa->sa_len + (u_char *) sa; cqlim = cq + sizeof(buf) - sizeof(" "); - snprintf(cq, sizeof(cq), "(%d)", sa->sa_family); + snprintf(cq, sizeof(buf), "(%d)", sa->sa_family); cq += strlen(cq); while (s < slim && cq < cqlim) { snprintf(cq, sizeof(" ff"), " %02x", *s++); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311761 - head/usr.sbin/bsnmpd/modules/snmp_netgraph
Author: ngie Date: Mon Jan 9 06:36:17 2017 New Revision: 311761 URL: https://svnweb.freebsd.org/changeset/base/311761 Log: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) MFC after:1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt == --- head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 9 06:27:30 2017(r311760) +++ head/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 9 06:36:17 2017(r311761) @@ -59,6 +59,19 @@ begemotNg MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The MIB for the NetGraph access module for SNMP." +REVISION "20031114Z" +DESCRIPTION + "The maximum width of the following OCTET STRINGs was increased + from 15 to 31: + + - NgTypeName + - NgNodeName + - NgNodeNameOrEmpty + - NgHookName + " +REVISION "20020131Z" +DESCRIPTION + "Initial revision." ::= { begemot 2 } begemotNgObjects OBJECT IDENTIFIER ::= { begemotNg 1 } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311760 - head/contrib/bsnmp/snmpd
Author: ngie Date: Mon Jan 9 06:27:30 2017 New Revision: 311760 URL: https://svnweb.freebsd.org/changeset/base/311760 Log: Add a REVISION section to track changes for the BEGEMOT-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after:1 week Modified: head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Modified: head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt == --- head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txtMon Jan 9 06:24:28 2017 (r311759) +++ head/contrib/bsnmp/snmpd/BEGEMOT-MIB.txtMon Jan 9 06:27:30 2017 (r311760) @@ -54,6 +54,9 @@ begemot MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The root of the Begemot subtree of the fokus tree." +REVISION "20020130Z" +DESCRIPTION + "Initial revision." ::= { fokus 1 } END ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311759 - head/contrib/bsnmp/snmpd
Author: ngie Date: Mon Jan 9 06:24:28 2017 New Revision: 311759 URL: https://svnweb.freebsd.org/changeset/base/311759 Log: Add a REVISION section to track changes for the FOKUS-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after:1 week Modified: head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Modified: head/contrib/bsnmp/snmpd/FOKUS-MIB.txt == --- head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 9 06:19:20 2017 (r311758) +++ head/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 9 06:24:28 2017 (r311759) @@ -52,6 +52,9 @@ fokus MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The root of the Fokus enterprises tree." +REVISION "20020205Z" +DESCRIPTION + "Initial revision." ::= { enterprises 12325 } END ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311758 - head/usr.sbin/bsnmpd/modules/snmp_atm
Author: ngie Date: Mon Jan 9 06:19:20 2017 New Revision: 311758 URL: https://svnweb.freebsd.org/changeset/base/311758 Log: Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after:1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt == --- head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 9 06:13:27 2017(r311757) +++ head/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 9 06:19:20 2017(r311758) @@ -56,7 +56,9 @@ begemotAtmFreeBSDGroup MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The FreeBSD specific Begemot MIB for ATM interfaces." - +REVISION "20040806Z" +DESCRIPTION + "Initial revision." ::= { begemotAtmSysGroup 1 } -- Netgraph ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311757 - head/contrib/bsnmp/gensnmpdef
Author: ngie Date: Mon Jan 9 06:13:27 2017 New Revision: 311757 URL: https://svnweb.freebsd.org/changeset/base/311757 Log: Similar to r311750, check for the result from smiGetModule to avoid a segfault when dereferencing a NULL pointer later on. Choose to just check for the NULL pointer in the next for-loop for now to fix the issue with a minimal amount of code churn sys/queue.h use here would make more sense than using a static table MFC after:5 days Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c == --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:07:44 2017 (r311756) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:13:27 2017 (r311757) @@ -560,6 +560,8 @@ main(int argc, char *argv[]) level = 0; last = NULL; for (opt = 0; opt < argc; opt++) { + if (mods[opt] == NULL) /* smiGetModule failed above */ + continue; n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); if (n == NULL) continue; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311756 - stable/10/usr.sbin/jail
Author: delphij Date: Mon Jan 9 06:07:44 2017 New Revision: 311756 URL: https://svnweb.freebsd.org/changeset/base/311756 Log: MFC r310614: Don't assign rtjp twice. Modified: stable/10/usr.sbin/jail/jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/jail/jail.c == --- stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:05:57 2017 (r311755) +++ stable/10/usr.sbin/jail/jail.c Mon Jan 9 06:07:44 2017 (r311756) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; -jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311755 - stable/11/usr.sbin/jail
Author: delphij Date: Mon Jan 9 06:05:57 2017 New Revision: 311755 URL: https://svnweb.freebsd.org/changeset/base/311755 Log: MFC r310614: Don't assign rtjp twice. Modified: stable/11/usr.sbin/jail/jail.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/jail/jail.c == --- stable/11/usr.sbin/jail/jail.c Mon Jan 9 06:03:49 2017 (r311754) +++ stable/11/usr.sbin/jail/jail.c Mon Jan 9 06:05:57 2017 (r311755) @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofai if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; -jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311754 - head/contrib/bsnmp/gensnmpdef
Author: ngie Date: Mon Jan 9 06:03:49 2017 New Revision: 311754 URL: https://svnweb.freebsd.org/changeset/base/311754 Log: Use calloc instead of malloc + memset(.., 0, ..) MFC after:5 days Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c == --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:58:48 2017 (r311753) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 06:03:49 2017 (r311754) @@ -399,12 +399,11 @@ static void save_typdef(char *name) { struct tdef *t; - t = malloc(sizeof(struct tdef)); + t = calloc(1, sizeof(struct tdef)); if (t == NULL) err(1, NULL); - memset(t, 0 , sizeof(struct tdef)); t->name = name; SLIST_INSERT_HEAD(, t, link); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311753 - stable/10/usr.sbin/pstat
Author: delphij Date: Mon Jan 9 05:58:48 2017 New Revision: 311753 URL: https://svnweb.freebsd.org/changeset/base/311753 Log: MFC r310611: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. Modified: stable/10/usr.sbin/pstat/pstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pstat/pstat.c == --- stable/10/usr.sbin/pstat/pstat.cMon Jan 9 05:57:31 2017 (r311752) +++ stable/10/usr.sbin/pstat/pstat.cMon Jan 9 05:58:48 2017 (r311753) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311752 - stable/11/usr.sbin/pstat
Author: delphij Date: Mon Jan 9 05:57:31 2017 New Revision: 311752 URL: https://svnweb.freebsd.org/changeset/base/311752 Log: MFC r310611: - pstat(8) does not accept any arguments other than getopt() args, so don't bother to adjust argc/argv after getopt() loop. - Make a string pointer constant. Modified: stable/11/usr.sbin/pstat/pstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pstat/pstat.c == --- stable/11/usr.sbin/pstat/pstat.cMon Jan 9 05:52:30 2017 (r311751) +++ stable/11/usr.sbin/pstat/pstat.cMon Jan 9 05:57:31 2017 (r311752) @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311751 - stable/10/libexec/talkd
Author: delphij Date: Mon Jan 9 05:52:30 2017 New Revision: 311751 URL: https://svnweb.freebsd.org/changeset/base/311751 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c == --- stable/10/libexec/talkd/table.c Mon Jan 9 05:51:38 2017 (r311750) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:52:30 2017 (r311751) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311750 - head/contrib/bsnmp/gensnmpdef
Author: ngie Date: Mon Jan 9 05:51:38 2017 New Revision: 311750 URL: https://svnweb.freebsd.org/changeset/base/311750 Log: Check result from smiGetFirstNode and smiGetNodeByOID This avoids a segfault with malformed or unanticipated files, like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS). MFC after:5 days Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Modified: head/contrib/bsnmp/gensnmpdef/gensnmpdef.c == --- head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:50:52 2017 (r311749) +++ head/contrib/bsnmp/gensnmpdef/gensnmpdef.c Mon Jan 9 05:51:38 2017 (r311750) @@ -126,9 +126,11 @@ open_node(const SmiNode *n, u_int level, while (level < n->oidlen - 1) { if (level >= cut) { + n1 = smiGetNodeByOID(level + 1, n->oid); + if (n1 == NULL) + continue; pindent(level); printf("(%u", n->oid[level]); - n1 = smiGetNodeByOID(level + 1, n->oid); printf(" "); print_name(n1); printf("\n"); @@ -560,6 +562,8 @@ main(int argc, char *argv[]) last = NULL; for (opt = 0; opt < argc; opt++) { n = smiGetFirstNode(mods[opt], SMI_NODEKIND_ANY); + if (n == NULL) + continue; for (;;) { if (do_typedef == 0) { level = open_node(n, level, ); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311749 - stable/11/libexec/talkd
Author: delphij Date: Mon Jan 9 05:50:52 2017 New Revision: 311749 URL: https://svnweb.freebsd.org/changeset/base/311749 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/11/libexec/talkd/table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/talkd/table.c == --- stable/11/libexec/talkd/table.c Mon Jan 9 05:46:41 2017 (r311748) +++ stable/11/libexec/talkd/table.c Mon Jan 9 05:50:52 2017 (r311749) @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPO TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, ); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311748 - head/tools/tools/gensnmpdef
Author: ngie Date: Mon Jan 9 05:46:41 2017 New Revision: 311748 URL: https://svnweb.freebsd.org/changeset/base/311748 Log: Bump WARNS up from 0 to 6 MFC after:5 days Modified: head/tools/tools/gensnmpdef/Makefile Modified: head/tools/tools/gensnmpdef/Makefile == --- head/tools/tools/gensnmpdef/MakefileMon Jan 9 05:44:19 2017 (r311747) +++ head/tools/tools/gensnmpdef/MakefileMon Jan 9 05:46:41 2017 (r311748) @@ -19,4 +19,6 @@ LDFLAGS+= -L${LOCALBASE}/lib LDADD+=-lsmi +WARNS?=6 + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311747 - stable/10/libexec/talkd
Author: delphij Date: Mon Jan 9 05:44:19 2017 New Revision: 311747 URL: https://svnweb.freebsd.org/changeset/base/311747 Log: MFC r310608: Avoid use after free. Modified: stable/10/libexec/talkd/table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/talkd/table.c == --- stable/10/libexec/talkd/table.c Mon Jan 9 05:41:47 2017 (r311746) +++ stable/10/libexec/talkd/table.c Mon Jan 9 05:44:19 2017 (r311747) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311746 - stable/11/libexec/talkd
Author: delphij Date: Mon Jan 9 05:41:47 2017 New Revision: 311746 URL: https://svnweb.freebsd.org/changeset/base/311746 Log: MFC r310608: Avoid use after free. Modified: stable/11/libexec/talkd/table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/talkd/table.c == --- stable/11/libexec/talkd/table.c Mon Jan 9 05:26:00 2017 (r311745) +++ stable/11/libexec/talkd/table.c Mon Jan 9 05:41:47 2017 (r311746) @@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL; CTL_MSG * find_match(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(, NULL); current_time = tp.tv_sec; if (debug) print_request("find_match", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) @@ -115,7 +116,7 @@ find_match(CTL_MSG *request) CTL_MSG * find_request(CTL_MSG *request) { - TABLE_ENTRY *ptr; + TABLE_ENTRY *ptr, *next; time_t current_time; gettimeofday(, NULL); @@ -126,7 +127,8 @@ find_request(CTL_MSG *request) */ if (debug) print_request("find_request", request); - for (ptr = table; ptr != NIL; ptr = ptr->next) { + for (ptr = table; ptr != NIL; ptr = next) { + next = ptr->next; if ((ptr->time - current_time) > MAX_LIFE) { /* the entry is too old */ if (debug) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311744 - head/share/mk
Author: ngie Date: Mon Jan 9 04:35:55 2017 New Revision: 311744 URL: https://svnweb.freebsd.org/changeset/base/311744 Log: Document bsd.snmpmod.mk from a high-level MFC after:2 weeks Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README == --- head/share/mk/bsd.READMEMon Jan 9 03:38:41 2017(r311743) +++ head/share/mk/bsd.READMEMon Jan 9 04:35:55 2017(r311744) @@ -410,6 +410,63 @@ If foo has multiple source files, add th =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +The include file, , handles building MIB modules for bsnmpd +from one or more source files, along with their manual pages. It has a +limited number of suffixes, consistent with the current needs of the BSD +tree. + +bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and +bsd.files.mk for installing MIB description and definition files. + +It has no additional targets. + +It sets/uses the following variables: + +BMIBS The MIB definitions to install. + +BMIBSDIR The directory where the MIB definitions are installed. + This defaults to `${SHAREDIR}/snmp/mibs`. + +DEFS The MIB description files to install. + +DEFSDIRThe directory where MIB description files are installed. + This defaults to `${SHAREDIR}/snmp/defs`. + +EXTRAMIBDEFS Extra MIB description files to use as input when + generating ${MOD}_oid.h and ${MOD}_tree.[ch]. + +EXTRAMIBSYMS Extra MIB definition files used only for extracting + symbols. + + EXTRAMIBSYMS are useful when resolving inter-module + dependencies and are useful with files containing only + enum-definitions. + + See ${MOD}_oid.h for more details. + +MODThe bsnmpd module name. + +XSYM MIB names to extract symbols for. See ${MOD}_oid.h for + more details. + +It generates the following files: + +${MOD}_tree.c A source file and header which programmatically describes +${MOD}_tree.h the MIB (type, OID name, ACCESS attributes, etc). + + The files are generated via "gensnmptree -p". + + See gensnmptree(1) for more details. + +${MOD}_oid.h A header which programmatically describes the MIB root and + MIB tables. + + The files are generated via "gensnmptree -e". + + See gensnmptree(1) for more details. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + The include file contains the default targets for building subdirectories. It has the same seven targets as : all, clean, cleandir, depend, install, lint, and tags. For all of the directories ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311743 - in head/sys/dev/hyperv: include utilities vmbus vmbus/amd64
Author: sephe Date: Mon Jan 9 03:38:41 2017 New Revision: 311743 URL: https://svnweb.freebsd.org/changeset/base/311743 Log: hyperv: Add method to read 64bit Hyper-V specific time value. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D9057 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/utilities/vmbus_timesync.c head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c head/sys/dev/hyperv/vmbus/hyperv.c head/sys/dev/hyperv/vmbus/vmbus_et.c Modified: head/sys/dev/hyperv/include/hyperv.h == --- head/sys/dev/hyperv/include/hyperv.hMon Jan 9 03:21:21 2017 (r311742) +++ head/sys/dev/hyperv/include/hyperv.hMon Jan 9 03:38:41 2017 (r311743) @@ -79,9 +79,17 @@ struct hyperv_guid { #define HYPERV_GUID_STRLEN 40 -inthyperv_guid2str(const struct hyperv_guid *, char *, size_t); +typedef uint64_t (*hyperv_tc64_t)(void); -extern u_int hyperv_features;/* CPUID_HV_MSR_ */ +inthyperv_guid2str(const struct hyperv_guid *, char *, + size_t); + +/* + * hyperv_tc64 could be NULL, if there were no suitable Hyper-V + * specific timecounter. + */ +extern hyperv_tc64_t hyperv_tc64; +extern u_int hyperv_features;/* CPUID_HV_MSR_ */ #endif /* _KERNEL */ Modified: head/sys/dev/hyperv/utilities/vmbus_timesync.c == --- head/sys/dev/hyperv/utilities/vmbus_timesync.c Mon Jan 9 03:21:21 2017(r311742) +++ head/sys/dev/hyperv/utilities/vmbus_timesync.c Mon Jan 9 03:38:41 2017(r311743) @@ -52,8 +52,7 @@ __FBSDID("$FreeBSD$"); VMBUS_ICVER_LE(VMBUS_IC_VERSION(4, 0), (sc)->ic_msgver) #define VMBUS_TIMESYNC_DORTT(sc) \ - (VMBUS_TIMESYNC_MSGVER4((sc)) &&\ -(hyperv_features & CPUID_HV_MSR_TIME_REFCNT)) + (VMBUS_TIMESYNC_MSGVER4((sc)) && hyperv_tc64 != NULL) static int vmbus_timesync_probe(device_t); static int vmbus_timesync_attach(device_t); @@ -117,7 +116,7 @@ vmbus_timesync(struct vmbus_ic_softc *sc uint64_t hv_ns, vm_ns, rtt = 0; if (VMBUS_TIMESYNC_DORTT(sc)) - rtt = rdmsr(MSR_HV_TIME_REF_COUNT) - sent_tc; + rtt = hyperv_tc64() - sent_tc; hv_ns = (hvtime - VMBUS_ICMSG_TS_BASE + rtt) * HYPERV_TIMER_NS_FACTOR; nanotime(_ts); Modified: head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c == --- head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.cMon Jan 9 03:21:21 2017(r311742) +++ head/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.cMon Jan 9 03:38:41 2017(r311743) @@ -133,8 +133,8 @@ hyperv_tsc_vdso_timehands(struct vdso_ti } #define HYPERV_TSC_TIMECOUNT(fence)\ -static u_int \ -hyperv_tsc_timecount_##fence(struct timecounter *tc) \ +static uint64_t \ +hyperv_tc64_tsc_##fence(void) \ { \ struct hyperv_reftsc *tsc_ref = hyperv_ref_tsc.tsc_ref; \ uint32_t seq; \ @@ -162,6 +162,13 @@ hyperv_tsc_timecount_##fence(struct time /* Fallback to the generic timecounter, i.e. rdmsr. */ \ return (rdmsr(MSR_HV_TIME_REF_COUNT)); \ } \ + \ +static u_int \ +hyperv_tsc_timecount_##fence(struct timecounter *tc __unused) \ +{ \ + \ + return (hyperv_tc64_tsc_##fence()); \ +} \ struct __hack HYPERV_TSC_TIMECOUNT(lfence); @@ -170,6 +177,7 @@ HYPERV_TSC_TIMECOUNT(mfence); static void hyperv_tsc_tcinit(void *dummy __unused) { + hyperv_tc64_t tc64 = NULL; uint64_t val, orig; if ((hyperv_features & @@ -182,11 +190,13 @@ hyperv_tsc_tcinit(void *dummy __unused) case CPU_VENDOR_AMD: hyperv_tsc_timecounter.tc_get_timecount = hyperv_tsc_timecount_mfence; + tc64 = hyperv_tc64_tsc_mfence; break; case CPU_VENDOR_INTEL:
svn commit: r311742 - head/contrib/bsnmp/snmp_mibII
Author: ngie Date: Mon Jan 9 03:21:21 2017 New Revision: 311742 URL: https://svnweb.freebsd.org/changeset/base/311742 Log: Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after:1 week Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt == --- head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txtMon Jan 9 03:18:19 2017(r311741) +++ head/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txtMon Jan 9 03:21:21 2017(r311742) @@ -54,6 +54,9 @@ begemotIp MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The MIB for IP stuff that is not in the official IP MIBs." +REVISION "20060213Z" +DESCRIPTION + "Initial revision." ::= { begemot 3 } begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311741 - head/usr.sbin/bsnmpd/modules/snmp_hostres
Author: ngie Date: Mon Jan 9 03:18:19 2017 New Revision: 311741 URL: https://svnweb.freebsd.org/changeset/base/311741 Log: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at MFC after:1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt == --- head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 9 03:14:04 2017(r311740) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 9 03:18:19 2017(r311741) @@ -54,6 +54,9 @@ begemotHostres MODULE-IDENTITY E-mail:ha...@freebsd.org" DESCRIPTION "The MIB for additional HOST-RESOURCES data." +REVISION "20060103Z" +DESCRIPTION + "Initial revision." ::= { begemot 202 } begemotHostresObjects OBJECT IDENTIFIER ::= { begemotHostres 1 } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311740 - in head/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII
Author: ngie Date: Mon Jan 9 03:14:04 2017 New Revision: 311740 URL: https://svnweb.freebsd.org/changeset/base/311740 Log: Improve the smilint target in the hostres and mibII modules - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them MFC after:1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:08:21 2017(r311739) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:14:04 2017(r311740) @@ -76,6 +76,7 @@ LIBADD= kvm devinfo m geom memstat printcap.pico: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_mibII/MakefileMon Jan 9 03:08:21 2017(r311739) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/MakefileMon Jan 9 03:14:04 2017(r311740) @@ -22,6 +22,7 @@ BMIBS=BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-M .include -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${BMIBS:C/^/${CONTRIB}\/snmp_mibII\//} + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311739 - in head/usr.sbin/bsnmpd/modules: snmp_atm snmp_hast snmp_hostres snmp_mibII snmp_target snmp_usm snmp_vacm
Author: ngie Date: Mon Jan 9 03:08:21 2017 New Revision: 311739 URL: https://svnweb.freebsd.org/changeset/base/311739 Log: Use SRCTOP instead of spelling out the full path with .CURDIR This helps condense the output for CFLAGS and .PATH MFC after:3 days Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile head/usr.sbin/bsnmpd/modules/snmp_target/Makefile head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_atm/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ # # Author: Harti Brandt-CONTRIB= ${.CURDIR}/../../../../contrib/ngatm +CONTRIB= ${SRCTOP}/contrib/ngatm .PATH: ${CONTRIB}/snmp_atm MOD= atm Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../../sbin/hastd +.PATH: ${SRCTOP}/sbin/hastd MOD= hast SRCS= ebuf.c @@ -18,7 +18,7 @@ MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= NO_WMISSING_VARIABLE_DECLARATIONS= -CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-I${SRCTOP}/sbin/hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -28,7 +28,7 @@ # $FreeBSD$ # -LPRSRC=${.CURDIR}/../../../lpr/common_source +LPRSRC=${SRCTOP}/usr.sbin/lpr/common_source .PATH: ${LPRSRC} MOD= hostres Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_mibII/MakefileMon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/MakefileMon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_mibII MOD= mibII Modified: head/usr.sbin/bsnmpd/modules/snmp_target/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_target/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_target/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_target MOD= target Modified: head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_usm/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_usm MOD= usm Modified: head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile == --- head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Mon Jan 9 02:48:08 2017(r311738) +++ head/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile Mon Jan 9 03:08:21 2017(r311739) @@ -2,7 +2,7 @@ # # Author: Shteryana Shopova -CONTRIB= ${.CURDIR}/../../../../contrib/bsnmp +CONTRIB= ${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmp_vacm MOD= vacm ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include
> On Jan 8, 2017, at 18:24, Jan Beichwrote: > > "Conrad E. Meyer" writes: > >> +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan 8 >> 06:26:33 2017(r311667) >> @@ -314,11 +314,12 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) >> >> /*** >> * >> - * FUNCTION:AcpiGetTable >> + * FUNCTION:AcpiGetTableWithSize >> * >> * PARAMETERS: Signature - ACPI signature of needed table >> * Instance- Which instance (for SSDTs) >> * OutTable- Where the pointer to the table is >> returned >> + * TblSize - Size of the table >> * >> * RETURN: Status and pointer to the requested table >> * >> @@ -333,10 +334,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) >> >> **/ >> >> ACPI_STATUS >> -AcpiGetTable ( >> +AcpiGetTableWithSize ( > > Can you adjust ACPI_EXPORT_SYMBOL() as well? It doesn't make sense to > export AcpiGetTable() twice but compiler won't complain if you do. Depends on the compiler and the version. IIRC clang won’t, but gcc will (depending on the version). Cheers, -Ngie signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include
"Conrad E. Meyer"writes: > +++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Sun Jan 8 > 06:26:33 2017(r311667) > @@ -314,11 +314,12 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) > > > /*** > * > - * FUNCTION:AcpiGetTable > + * FUNCTION:AcpiGetTableWithSize > * > * PARAMETERS: Signature - ACPI signature of needed table > * Instance- Which instance (for SSDTs) > * OutTable- Where the pointer to the table is > returned > + * TblSize - Size of the table > * > * RETURN: Status and pointer to the requested table > * > @@ -333,10 +334,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) > > **/ > > ACPI_STATUS > -AcpiGetTable ( > +AcpiGetTableWithSize ( Can you adjust ACPI_EXPORT_SYMBOL() as well? It doesn't make sense to export AcpiGetTable() twice but compiler won't complain if you do. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311736 - head/sys/dev/sdhci
Author: ian Date: Mon Jan 9 02:04:54 2017 New Revision: 311736 URL: https://svnweb.freebsd.org/changeset/base/311736 Log: Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect. Modified: head/sys/dev/sdhci/fsl_sdhci.c Modified: head/sys/dev/sdhci/fsl_sdhci.c == --- head/sys/dev/sdhci/fsl_sdhci.c Mon Jan 9 01:57:51 2017 (r311735) +++ head/sys/dev/sdhci/fsl_sdhci.c Mon Jan 9 02:04:54 2017 (r311736) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" struct fsl_sdhci_softc { @@ -77,10 +79,10 @@ struct fsl_sdhci_softc { struct sdhci_slot slot; struct callout r1bfix_callout; sbintime_t r1bfix_timeout_at; + struct sdhci_fdt_gpio * gpio; uint32_tbaseclk_hz; uint32_tcmd_and_mode; uint32_tr1bfix_intmask; - boolean_t force_card_present; uint16_tsdclockreg_freq_bits; uint8_t r1bfix_type; uint8_t hwtype; @@ -345,8 +347,6 @@ fsl_sdhci_read_4(device_t dev, struct sd val32 &= 0x000F0F07; val32 |= (wrk32 >> 4) & SDHCI_STATE_DAT_MASK; val32 |= (wrk32 >> 9) & SDHCI_RETUNE_REQUEST; - if (sc->force_card_present) - val32 |= SDHCI_CARD_PRESENT; return (val32); } @@ -752,9 +752,15 @@ fsl_sdhci_get_ro(device_t bus, device_t { struct fsl_sdhci_softc *sc = device_get_softc(bus); - if (RD4(sc, SDHCI_PRESENT_STATE) & SDHC_PRES_WPSPL) - return (false); - return (true); + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} + +static bool +fsl_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct fsl_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } #ifdef __powerpc__ @@ -802,6 +808,7 @@ static int fsl_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ return (EBUSY); } @@ -810,8 +817,8 @@ fsl_sdhci_attach(device_t dev) { struct fsl_sdhci_softc *sc = device_get_softc(dev); int rid, err; - phandle_t node; #ifdef __powerpc__ + phandle_t node; uint32_t protctl; #endif @@ -887,24 +894,13 @@ fsl_sdhci_attach(device_t dev) sc->slot.max_clk = sc->baseclk_hz; /* -* If the slot is flagged with the non-removable property, set our flag -* to always force the SDHCI_CARD_PRESENT bit on. -* -* XXX Workaround for gpio-based card detect... -* -* We don't have gpio support yet. If there's a cd-gpios property just -* force the SDHCI_CARD_PRESENT bit on for now. If there isn't really a -* card there it will fail to probe at the mmc layer and nothing bad -* happens except instantiating an mmcN device for an empty slot. +* Set up any gpio pin handling described in the FDT data. This cannot +* fail; see comments in sdhci_fdt_gpio.h for details. */ - node = ofw_bus_get_node(dev); - if (OF_hasprop(node, "non-removable")) - sc->force_card_present = true; - else if (OF_hasprop(node, "cd-gpios")) { - /* XXX put real gpio hookup here. */ - sc->force_card_present = true; - } + sc->gpio = sdhci_fdt_gpio_setup(dev, >slot); + #ifdef __powerpc__ + node = ofw_bus_get_node(dev); /* Default to big-endian on powerpc */ protctl = RD4(sc, SDHC_PROT_CTRL); protctl &= ~SDHC_PROT_EMODE_MASK; @@ -974,7 +970,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), - /* SDHCI registers accessors */ + /* SDHCI accessors */ DEVMETHOD(sdhci_read_1, fsl_sdhci_read_1), DEVMETHOD(sdhci_read_2, fsl_sdhci_read_2), DEVMETHOD(sdhci_read_4, fsl_sdhci_read_4), @@ -983,6 +979,7 @@ static device_method_t fsl_sdhci_methods DEVMETHOD(sdhci_write_2,fsl_sdhci_write_2), DEVMETHOD(sdhci_write_4,fsl_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, fsl_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present,fsl_sdhci_get_card_present), { 0, 0 } }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311735 - head/sys/arm/ti
Author: ian Date: Mon Jan 9 01:57:51 2017 New Revision: 311735 URL: https://svnweb.freebsd.org/changeset/base/311735 Log: Use the new sdhci_fdt_gpio helper functions to add full support for FDT gpio pins for detecting card insert/remove and write protect. Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c == --- head/sys/arm/ti/ti_sdhci.c Mon Jan 9 01:54:36 2017(r311734) +++ head/sys/arm/ti/ti_sdhci.c Mon Jan 9 01:57:51 2017(r311735) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "sdhci_if.h" #include @@ -61,7 +62,7 @@ __FBSDID("$FreeBSD$"); struct ti_sdhci_softc { device_tdev; - device_tgpio_dev; + struct sdhci_fdt_gpio * gpio; struct resource * mem_res; struct resource * irq_res; void * intr_cookie; @@ -362,20 +363,24 @@ static int ti_sdhci_get_ro(device_t brdev, device_t reqdev) { struct ti_sdhci_softc *sc = device_get_softc(brdev); - unsigned int readonly = 0; - /* If a gpio pin is configured, read it. */ - if (sc->gpio_dev != NULL) { - GPIO_PIN_GET(sc->gpio_dev, sc->wp_gpio_pin, ); - } + return (sdhci_fdt_gpio_get_readonly(sc->gpio)); +} - return (readonly); +static bool +ti_sdhci_get_card_present(device_t dev, struct sdhci_slot *slot) +{ + struct ti_sdhci_softc *sc = device_get_softc(dev); + + return (sdhci_fdt_gpio_get_present(sc->gpio)); } static int ti_sdhci_detach(device_t dev) { + /* sdhci_fdt_gpio_teardown(sc->gpio); */ + return (EBUSY); } @@ -502,25 +507,6 @@ ti_sdhci_attach(device_t dev) } /* -* See if we've got a GPIO-based write detect pin. This is not the -* standard documented property for this, we added it in freebsd. -*/ - if ((OF_getencprop(node, "mmchs-wp-gpio-pin", , sizeof(prop))) <= 0) - sc->wp_gpio_pin = 0x; - else - sc->wp_gpio_pin = prop; - - if (sc->wp_gpio_pin != 0x) { - sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); - if (sc->gpio_dev == NULL) - device_printf(dev, "Error: No GPIO device, " - "Write Protect pin will not function\n"); - else - GPIO_PIN_SETFLAGS(sc->gpio_dev, sc->wp_gpio_pin, - GPIO_PIN_INPUT); - } - - /* * Set the offset from the device's memory start to the MMCHS registers. * Also for OMAP4 disable high speed mode due to erratum ID i626. */ @@ -572,6 +558,8 @@ ti_sdhci_attach(device_t dev) goto fail; } + sc->gpio = sdhci_fdt_gpio_setup(sc->dev, >slot); + /* Initialise the MMCHS hardware. */ ti_sdhci_hw_init(dev); @@ -706,6 +694,7 @@ static device_method_t ti_sdhci_methods[ DEVMETHOD(sdhci_write_2,ti_sdhci_write_2), DEVMETHOD(sdhci_write_4,ti_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, ti_sdhci_write_multi_4), + DEVMETHOD(sdhci_get_card_present, ti_sdhci_get_card_present), DEVMETHOD_END }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311734 - in head/sys: conf dev/sdhci
Author: ian Date: Mon Jan 9 01:54:36 2017 New Revision: 311734 URL: https://svnweb.freebsd.org/changeset/base/311734 Log: Add new helper routines for sdhci bridge drivers that use gpio pins for card presence and write protect switch detection. A bridge driver just needs to call the setup routine in its attach(), the teardown in its detach(), and write a couple tiny glue functions to connect the sdhci interface functions to the new helper functions. This is not extensively documented, but multiple examples will exist real soon. Added: head/sys/dev/sdhci/sdhci_fdt_gpio.c (contents, props changed) head/sys/dev/sdhci/sdhci_fdt_gpio.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Mon Jan 9 01:47:00 2017(r311733) +++ head/sys/conf/files Mon Jan 9 01:54:36 2017(r311734) @@ -2824,6 +2824,7 @@ dev/scc/scc_dev_quicc.c optional scc qu dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.coptional scc dev/sdhci/sdhci.c optional sdhci +dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci Added: head/sys/dev/sdhci/sdhci_fdt_gpio.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_fdt_gpio.c Mon Jan 9 01:54:36 2017 (r311734) @@ -0,0 +1,256 @@ +/*- + * Copyright (c) 2017 Ian Lepore+ * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Support routines usable by any SoC sdhci bridge driver that uses gpio pins + * for card detect and write protect, and uses FDT data to describe those pins. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +struct sdhci_fdt_gpio { + device_tdev; + struct sdhci_slot * slot; + gpio_pin_t wp_pin; + gpio_pin_t cd_pin; + void * cd_ihandler; + struct resource * cd_ires; + int cd_irid; + boolwp_disabled; + boolwp_inverted; + boolcd_disabled; + boolcd_inverted; +}; + +/* + * Card detect interrupt handler. + */ +static void +cd_intr(void *arg) +{ + struct sdhci_fdt_gpio *gpio = arg; + + sdhci_handle_card_present(gpio->slot, sdhci_fdt_gpio_get_present(gpio)); +} + +/* + * Card detect setup. + */ +static void +cd_setup(struct sdhci_fdt_gpio *gpio, phandle_t node) +{ + int pincaps; + device_t dev; + const char *cd_mode_str; + + dev = gpio->dev; + + /* +* If the device is flagged as non-removable, set that slot option, and +* set a flag to make sdhci_fdt_gpio_get_present() always return true. +*/ + if (OF_hasprop(node, "non-removable")) { + gpio->slot->opt |= SDHCI_NON_REMOVABLE; + gpio->cd_disabled = true; + if (bootverbose) + device_printf(dev, "Non-removable media"); + return; + } + + /* +* If there is no cd-gpios property, then presumably the hardware +* PRESENT_STATE register and interrupts will reflect card state +* properly, and there's nothing more for us to do. Our get_present() +*
svn commit: r311733 - head/contrib/bsnmp/snmp_mibII
Author: ngie Date: Mon Jan 9 01:47:00 2017 New Revision: 311733 URL: https://svnweb.freebsd.org/changeset/base/311733 Log: Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3) MFC after:3 days Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c == --- head/contrib/bsnmp/snmp_mibII/mibII.c Mon Jan 9 01:35:33 2017 (r311732) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Mon Jan 9 01:47:00 2017 (r311733) @@ -319,7 +319,7 @@ fetch_generic_mib(struct mibif *ifp, con name[5] = IFDATA_GENERAL; len = sizeof(ifp->mib); - if (sysctl(name, 6, >mib, , NULL, 0) == -1) { + if (sysctl(name, nitems(name), >mib, , NULL, 0) == -1) { if (errno != ENOENT) syslog(LOG_WARNING, "sysctl(ifmib, %s) failed %m", ifp->name); @@ -480,7 +480,7 @@ mib_fetch_ifmib(struct mibif *ifp) name[3] = IFMIB_IFDATA; name[4] = ifp->sysindex; name[5] = IFDATA_LINKSPECIFIC; - if (sysctl(name, 6, NULL, , NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, , NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m", ifp->name); if (ifp->specmib != NULL) { @@ -506,7 +506,7 @@ mib_fetch_ifmib(struct mibif *ifp) ifp->specmib = newmib; ifp->specmiblen = len; } - if (sysctl(name, 6, ifp->specmib, , NULL, 0) == -1) { + if (sysctl(name, nitems(name), ifp->specmib, , NULL, 0) == -1) { syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name); if (ifp->specmib != NULL) { ifp->specmib = NULL; @@ -902,7 +902,7 @@ mib_refresh_iflist(void) for (idx = 1; idx <= count; idx++) { name[4] = idx; len = sizeof(mib); - if (sysctl(name, 6, , , NULL, 0) == -1) { + if (sysctl(name, nitems(name), , , NULL, 0) == -1) { if (errno == ENOENT) continue; syslog(LOG_ERR, "ifmib(%u): %m", idx); @@ -1213,7 +1213,7 @@ mib_fetch_rtab(int af, int info, int arg *lenp = 0; /* initial estimate */ - if (sysctl(name, 6, NULL, lenp, NULL, 0) == -1) { + if (sysctl(name, nitems(name), NULL, lenp, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl estimate (%d,%d,%d,%d,%d,%d): %m", name[0], name[1], name[2], name[3], name[4], name[5]); return (NULL); @@ -1230,7 +1230,7 @@ mib_fetch_rtab(int af, int info, int arg } buf = newbuf; - if (sysctl(name, 6, buf, lenp, NULL, 0) == 0) + if (sysctl(name, nitems(name), buf, lenp, NULL, 0) == 0) break; if (errno != ENOMEM) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311731 - stable/11/kerberos5/libexec
Author: ngie Date: Mon Jan 9 01:31:16 2017 New Revision: 311731 URL: https://svnweb.freebsd.org/changeset/base/311731 Log: MFC r34: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi Modified: stable/11/kerberos5/libexec/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/kerberos5/libexec/Makefile == --- stable/11/kerberos5/libexec/MakefileMon Jan 9 01:31:12 2017 (r311730) +++ stable/11/kerberos5/libexec/MakefileMon Jan 9 01:31:16 2017 (r311731) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311730 - stable/10/kerberos5/libexec
Author: ngie Date: Mon Jan 9 01:31:12 2017 New Revision: 311730 URL: https://svnweb.freebsd.org/changeset/base/311730 Log: MFC r34: Build libexec/kadmind when MK_GSSAPI != no because it requires gssapi Modified: stable/10/kerberos5/libexec/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/libexec/Makefile == --- stable/10/kerberos5/libexec/MakefileMon Jan 9 01:29:20 2017 (r311729) +++ stable/10/kerberos5/libexec/MakefileMon Jan 9 01:31:12 2017 (r311730) @@ -1,7 +1,13 @@ # $FreeBSD$ -SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kadmind kdc \ +.include + +SUBDIR=digest-service ipropd-master ipropd-slave hprop hpropd kdc \ kdigest kfd kimpersonate kpasswdd kcm SUBDIR_PARALLEL= +.if ${MK_GSSAPI} != "no" +SUBDIR+= kadmind +.endif + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311729 - in stable/10/kerberos5: . lib
Author: ngie Date: Mon Jan 9 01:29:20 2017 New Revision: 311729 URL: https://svnweb.freebsd.org/changeset/base/311729 Log: MFC r32,r35: r32: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob r35: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" Modified: stable/10/kerberos5/Makefile.inc stable/10/kerberos5/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/Makefile.inc == --- stable/10/kerberos5/Makefile.incMon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/Makefile.incMon Jan 9 01:29:20 2017 (r311729) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + NO_LINT= KRB5DIR= ${.CURDIR}/../../../crypto/heimdal @@ -27,11 +29,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" Modified: stable/10/kerberos5/lib/Makefile == --- stable/10/kerberos5/lib/MakefileMon Jan 9 01:22:46 2017 (r311728) +++ stable/10/kerberos5/lib/MakefileMon Jan 9 01:29:20 2017 (r311729) @@ -1,10 +1,17 @@ - # $FreeBSD$ -SUBDIR=libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR=libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkafs5 libkrb5 \ libroken libsl libvers libkdc libwind libheimsqlite libheimbase libheimipcc libheimipcs SUBDIR_DEPEND_libkafs5=libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311728 - in stable/11/kerberos5: . lib
Author: ngie Date: Mon Jan 9 01:22:46 2017 New Revision: 311728 URL: https://svnweb.freebsd.org/changeset/base/311728 Log: MFC r32,r35: r32: libgssapi_{krb5,ntlm,spnego} requires MK_GSSAPI != no; conditionalize their building on the knob r35: Conditionalize adding ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et to ETSRCS if MK_GSSAPI != "no" Modified: stable/11/kerberos5/Makefile.inc stable/11/kerberos5/lib/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/kerberos5/Makefile.inc == --- stable/11/kerberos5/Makefile.incMon Jan 9 01:15:18 2017 (r311727) +++ stable/11/kerberos5/Makefile.incMon Jan 9 01:22:46 2017 (r311728) @@ -26,11 +26,14 @@ ETSRCS= \ ${KRB5DIR}/lib/krb5/k524_err.et \ ${KRB5DIR}/lib/krb5/krb5_err.et \ ${KRB5DIR}/lib/krb5/krb_err.et \ - ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et \ ${KRB5DIR}/lib/hx509/hx509_err.et \ ${KRB5DIR}/lib/wind/wind_err.et \ ${KRB5DIR}/lib/ntlm/ntlm_err.et +.if ${MK_GSSAPI} != "no" +ETSRCS+= ${KRB5DIR}/lib/gssapi/krb5/gkrb5_err.et +.endif + .for ET in ${ETSRCS} .for _ET in ${ET:T:R} .if ${SRCS:M${_ET}.[ch]} != "" Modified: stable/11/kerberos5/lib/Makefile == --- stable/11/kerberos5/lib/MakefileMon Jan 9 01:15:18 2017 (r311727) +++ stable/11/kerberos5/lib/MakefileMon Jan 9 01:22:46 2017 (r311728) @@ -1,11 +1,18 @@ - # $FreeBSD$ -SUBDIR=libasn1 libgssapi_krb5 libgssapi_ntlm libgssapi_spnego libhdb \ +.include + +SUBDIR=libasn1 libhdb \ libheimntlm libhx509 libkadm5clnt libkadm5srv libkrb5 \ libroken libsl libvers libkdc libwind libheimbase libheimipcc libheimipcs SUBDIR+= libkafs5 # requires krb_err.h from libkrb5 SUBDIR_DEPEND_libkafs5=libkrb5 +.if ${MK_GSSAPI} != "no" +SUBDIR+= libgssapi_krb5 +SUBDIR+= libgssapi_ntlm +SUBDIR+= libgssapi_spnego +.endif + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311727 - head/sys/dev/sdhci
Author: ian Date: Mon Jan 9 01:15:18 2017 New Revision: 311727 URL: https://svnweb.freebsd.org/changeset/base/311727 Log: Add support for non-removable media, and a quirk to use polling to detect card insert/remove events on controllers that don't implement the insert and remove interrupts. Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate non-removable media (such as eMMC). The sdhci driver will not enable insert/remove interrupts, and sdhci_generic_get_card_present() will always return true. Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the sdhci driver will not enable insert/remove interrupts, and instead will use a callout to poll the card-present status at 5 Hz. For bridge drivers that get notified of card insert/remove via gpio interrupts, there is a new sdhci_handle_card_present() function they can call from the gpio interrupt handler to inform the sdhci code of the event. In addition to adding these new features, the existing code to debounce card insertions was updated to use taskqueue_enqueue_timeout() instead of scheduling a callout to do the taskqueue_enqueue(). There is also now a comment explaining that insertion-debounce is what's going on -- it took me a long time to realize that's what the old sdhci_card_delay() routine was really doing. There is no functional difference between the old and new debounce code (I hope!). Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c == --- head/sys/dev/sdhci/sdhci.c Mon Jan 9 01:12:34 2017(r311726) +++ head/sys/dev/sdhci/sdhci.c Mon Jan 9 01:15:18 2017(r311727) @@ -73,6 +73,7 @@ static void sdhci_set_clock(struct sdhci static void sdhci_start(struct sdhci_slot *slot); static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ @@ -89,6 +90,9 @@ static void sdhci_card_task(void *, int) #defineSDHCI_200_MAX_DIVIDER 256 #defineSDHCI_300_MAX_DIVIDER 2046 +#defineSDHCI_CARD_PRESENT_TICKS(hz / 5) +#defineSDHCI_INSERT_DELAY_TICKS(hz / 2) + /* * Broadcom BCM577xx Controller Constants */ @@ -229,10 +233,15 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | SDHCI_INT_ACMD12ERR; + + if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; + } + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -474,14 +483,6 @@ sdhci_transfer_pio(struct sdhci_slot *sl } } -static void -sdhci_card_delay(void *arg) -{ - struct sdhci_slot *slot = arg; - - taskqueue_enqueue(taskqueue_swi_giant, >card_task); -} - static void sdhci_card_task(void *arg, int pending) { @@ -491,6 +492,8 @@ sdhci_card_task(void *arg, int pending) if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card inserted\n"); slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); @@ -500,6 +503,8 @@ sdhci_card_task(void *arg, int pending) } else { if (slot->dev != NULL) { /* If no card present - detach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); @@ -509,6 +514,44 @@ sdhci_card_task(void *arg, int pending) } } +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + bool was_present; + + /* +* If there was no card and now there is one, schedule the task to +* create the child device after a short delay. The delay is to +* debounce the card insert (sometimes the card detect pin stabilizes +* before the other pins have made good contact). +* +* If there
svn commit: r311726 - stable/11/contrib/bsnmp/snmp_mibII
Author: ngie Date: Mon Jan 9 01:12:34 2017 New Revision: 311726 URL: https://svnweb.freebsd.org/changeset/base/311726 Log: MFC r311505: Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c == --- stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:32 2017(r311725) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:34 2017(r311726) @@ -37,7 +37,7 @@ * Scalars */ int -op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value, +op_begemot_mibII(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { switch (op) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311725 - stable/10/contrib/bsnmp/snmp_mibII
Author: ngie Date: Mon Jan 9 01:12:32 2017 New Revision: 311725 URL: https://svnweb.freebsd.org/changeset/base/311725 Log: MFC r311505: Remove unnecessary __unused attribute attached to `ctx` in op_begemot_mibII(..) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c == --- stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:11:42 2017(r311724) +++ stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c Mon Jan 9 01:12:32 2017(r311725) @@ -37,7 +37,7 @@ * Scalars */ int -op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value, +op_begemot_mibII(struct snmp_context *ctx, struct snmp_value *value, u_int sub, u_int idx __unused, enum snmp_op op) { switch (op) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311724 - stable/11/contrib/bsnmp/snmp_usm
Author: ngie Date: Mon Jan 9 01:11:42 2017 New Revision: 311724 URL: https://svnweb.freebsd.org/changeset/base/311724 Log: MFC r311384: op_usm_users: fix indentation in SNMP_OP_SET block Modified: stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c == --- stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:38 2017 (r311723) +++ stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:42 2017 (r311724) @@ -167,7 +167,7 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(>var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); if (community != COMM_INITIALIZE && uuser->type == StorageType_readOnly) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311723 - stable/10/contrib/bsnmp/snmp_usm
Author: ngie Date: Mon Jan 9 01:11:38 2017 New Revision: 311723 URL: https://svnweb.freebsd.org/changeset/base/311723 Log: MFC r311384: op_usm_users: fix indentation in SNMP_OP_SET block Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c == --- stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:09:00 2017 (r311722) +++ stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c Mon Jan 9 01:11:38 2017 (r311723) @@ -167,7 +167,7 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(>var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); if (community != COMM_INITIALIZE && uuser->type == StorageType_readOnly) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311722 - stable/11/contrib/bsnmp/snmpd
Author: ngie Date: Mon Jan 9 01:09:00 2017 New Revision: 311722 URL: https://svnweb.freebsd.org/changeset/base/311722 Log: MFC r311382: Use calloc instead of malloc + memset(.., 0, ..) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c == --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:08:43 2017 (r311721) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:09:00 2017 (r311722) @@ -143,16 +143,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -258,12 +256,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311721 - stable/10/contrib/bsnmp/snmpd
Author: ngie Date: Mon Jan 9 01:08:43 2017 New Revision: 311721 URL: https://svnweb.freebsd.org/changeset/base/311721 Log: MFC r311382: Use calloc instead of malloc + memset(.., 0, ..) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c == --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:07:16 2017 (r311720) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 9 01:08:43 2017 (r311721) @@ -143,16 +143,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -258,12 +256,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311720 - stable/10/usr.sbin/bsnmpd/modules/snmp_hostres
Author: ngie Date: Mon Jan 9 01:07:16 2017 New Revision: 311720 URL: https://svnweb.freebsd.org/changeset/base/311720 Log: MFC r311393: OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2 Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c == --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cMon Jan 9 01:05:44 2017(r311719) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cMon Jan 9 01:07:16 2017(r311720) @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include +#include #include #include @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, _boot_timestamp, + if (sysctl(mib, nitems(mib), _boot_timestamp, , NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311719 - stable/11/usr.sbin/bsnmpd/modules/snmp_hostres
Author: ngie Date: Mon Jan 9 01:05:44 2017 New Revision: 311719 URL: https://svnweb.freebsd.org/changeset/base/311719 Log: MFC r311393: OS_getSystemUptime: use nitems for calculating the number of elements in a sysctl mib instead of hardcoding the number 2 Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c == --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cMon Jan 9 01:05:02 2017(r311718) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cMon Jan 9 01:05:44 2017(r311719) @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include +#include #include #include @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, _boot_timestamp, + if (sysctl(mib, nitems(mib), _boot_timestamp, , NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311718 - stable/10/lib/libc/net
Author: ngie Date: Mon Jan 9 01:05:02 2017 New Revision: 311718 URL: https://svnweb.freebsd.org/changeset/base/311718 Log: MFC r310984,r311102: r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984. Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c == --- stable/10/lib/libc/net/getaddrinfo.cMon Jan 9 01:02:16 2017 (r311717) +++ stable/10/lib/libc/net/getaddrinfo.cMon Jan 9 01:05:02 2017 (r311718) @@ -673,9 +673,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(); @@ -1454,9 +1453,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1876,8 +1874,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, _ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1890,8 +1887,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311717 - stable/11/lib/libc/net
Author: ngie Date: Mon Jan 9 01:02:16 2017 New Revision: 311717 URL: https://svnweb.freebsd.org/changeset/base/311717 Log: MFC r310984,r311102: r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984. Modified: stable/11/lib/libc/net/getaddrinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/getaddrinfo.c == --- stable/11/lib/libc/net/getaddrinfo.cMon Jan 9 01:00:20 2017 (r311716) +++ stable/11/lib/libc/net/getaddrinfo.cMon Jan 9 01:02:16 2017 (r311717) @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel) return(n); /* allocate a temporary array for sort and initialization of it. */ - if ((aio = malloc(sizeof(*aio) * n)) == NULL) + if ((aio = calloc(n, sizeof(*aio))) == NULL) return(n); /* give up reordering */ - memset(aio, 0, sizeof(*aio) * n); /* retrieve address selection policy from the kernel */ TAILQ_INIT(); @@ -1449,9 +1448,8 @@ copy_ai(const struct addrinfo *pai) size_t l; l = sizeof(*ai) + pai->ai_addrlen; - if ((ai = (struct addrinfo *)malloc(l)) == NULL) + if ((ai = calloc(1, l)) == NULL) return NULL; - memset(ai, 0, l); memcpy(ai, pai, sizeof(*ai)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); @@ -1874,8 +1872,7 @@ addrinfo_unmarshal_func(char *buffer, si size = new_ai.ai_addrlen + sizeof(struct addrinfo) + _ALIGNBYTES; - sentinel = (struct addrinfo *)malloc(size); - memset(sentinel, 0, size); + sentinel = calloc(1, size); memcpy(sentinel, _ai, sizeof(struct addrinfo)); sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel + @@ -1888,8 +1885,7 @@ addrinfo_unmarshal_func(char *buffer, si memcpy(, p, sizeof(size_t)); p += sizeof(size_t); - sentinel->ai_canonname = (char *)malloc(size + 1); - memset(sentinel->ai_canonname, 0, size + 1); + sentinel->ai_canonname = calloc(1, size + 1); memcpy(sentinel->ai_canonname, p, size); p += size; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r311715 - head/lib/libprocstat
> On Jan 8, 2017, at 16:54, Ngie Cooperwrote: > > Author: ngie > Date: Mon Jan 9 00:54:18 2017 > New Revision: 311715 > URL: https://svnweb.freebsd.org/changeset/base/311715 > > Log: > Use nitems({mib,name}) instead of hardcoding their value *value -> length signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r311715 - head/lib/libprocstat
Author: ngie Date: Mon Jan 9 00:54:18 2017 New Revision: 311715 URL: https://svnweb.freebsd.org/changeset/base/311715 Log: Use nitems({mib,name}) instead of hardcoding their value MFC after:3 days Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c == --- head/lib/libprocstat/libprocstat.c Mon Jan 9 00:47:23 2017 (r311714) +++ head/lib/libprocstat/libprocstat.c Mon Jan 9 00:54:18 2017 (r311715) @@ -282,7 +282,7 @@ procstat_getprocs(struct procstat *procs name[1] = KERN_PROC; name[2] = what; name[3] = arg; - error = sysctl(name, 4, NULL, , NULL, 0); + error = sysctl(name, nitems(name), NULL, , NULL, 0); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); goto fail; @@ -299,7 +299,7 @@ procstat_getprocs(struct procstat *procs goto fail; } olen = len; - error = sysctl(name, 4, p, , NULL, 0); + error = sysctl(name, nitems(name), p, , NULL, 0); } while (error < 0 && errno == ENOMEM && olen == len); if (error < 0 && errno != EPERM) { warn("sysctl(kern.proc)"); @@ -1760,7 +1760,7 @@ getargv(struct procstat *procstat, struc name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; name[3] = kp->ki_pid; len = nchr; - error = sysctl(name, 4, av->buf, , NULL, 0); + error = sysctl(name, nitems(name), av->buf, , NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl(kern.proc.%s)", env ? "env" : "args"); if (error != 0 || len == 0) @@ -1983,7 +1983,7 @@ procstat_getgroups_sysctl(pid_t pid, uns warn("malloc(%zu)", len); return (NULL); } - if (sysctl(mib, 4, groups, , NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), groups, , NULL, 0) == -1) { warn("sysctl: kern.proc.groups: %d", pid); free(groups); return (NULL); @@ -2059,7 +2059,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[2] = KERN_PROC_UMASK; mib[3] = pid; len = sizeof(*maskp); - error = sysctl(mib, 4, maskp, , NULL, 0); + error = sysctl(mib, nitems(mib), maskp, , NULL, 0); if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); @@ -2139,7 +2139,7 @@ procstat_getrlimit_sysctl(pid_t pid, int name[3] = pid; name[4] = which; len = sizeof(struct rlimit); - error = sysctl(name, 5, rlimit, , NULL, 0); + error = sysctl(name, nitems(name), rlimit, , NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", pid); return (-1); @@ -2201,7 +2201,7 @@ procstat_getpathname_sysctl(pid_t pid, c name[2] = KERN_PROC_PATHNAME; name[3] = pid; len = maxlen; - error = sysctl(name, 4, pathname, , NULL, 0); + error = sysctl(name, nitems(name), pathname, , NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.pathname: %d", pid); if (len == 0) @@ -2281,7 +2281,7 @@ procstat_getosrel_sysctl(pid_t pid, int name[2] = KERN_PROC_OSREL; name[3] = pid; len = sizeof(*osrelp); - error = sysctl(name, 4, osrelp, , NULL, 0); + error = sysctl(name, nitems(name), osrelp, , NULL, 0); if (error != 0 && errno != ESRCH) warn("sysctl: kern.proc.osrel: %d", pid); return (error); @@ -2341,7 +2341,7 @@ is_elf32_sysctl(pid_t pid) name[2] = KERN_PROC_SV_NAME; name[3] = pid; len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, , NULL, 0); + error = sysctl(name, nitems(name), sv_name, , NULL, 0); if (error != 0 || len == 0) return (0); for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { @@ -2372,7 +2372,7 @@ procstat_getauxv32_sysctl(pid_t pid, uns warn("malloc(%zu)", len); goto out; } - if (sysctl(name, 4, auxv32, , NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv32, , NULL, 0) == -1) { if (errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); goto out; @@ -2421,7 +2421,7 @@ procstat_getauxv_sysctl(pid_t pid, unsig warn("malloc(%zu)", len); return (NULL); } - if (sysctl(name, 4, auxv, , NULL, 0) == -1) { + if (sysctl(name, nitems(name), auxv, ,
svn commit: r311714 - head/lib/libutil
Author: ngie Date: Mon Jan 9 00:47:23 2017 New Revision: 311714 URL: https://svnweb.freebsd.org/changeset/base/311714 Log: lib/libutil/kinfo_*: style cleanup - Use nitems(mib) instead of hardcoding mib's length - Sort sys/ #includes MFC after:3 days Modified: head/lib/libutil/kinfo_getallproc.c head/lib/libutil/kinfo_getfile.c head/lib/libutil/kinfo_getproc.c head/lib/libutil/kinfo_getvmmap.c Modified: head/lib/libutil/kinfo_getallproc.c == --- head/lib/libutil/kinfo_getallproc.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getallproc.c Mon Jan 9 00:47:23 2017 (r311714) @@ -31,8 +31,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -75,14 +75,14 @@ kinfo_getallproc(int *cntp) mib[2] = KERN_PROC_PROC; len = 0; - if (sysctl(mib, 3, NULL, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 3, kipp, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, , NULL, 0) < 0) goto bad; if (len % sizeof(*kipp) != 0) goto bad; Modified: head/lib/libutil/kinfo_getfile.c == --- head/lib/libutil/kinfo_getfile.cMon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getfile.cMon Jan 9 00:47:23 2017 (r311714) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getfile(pid_t pid, int *cntp) mib[2] = KERN_PROC_FILEDESC; mib[3] = pid; - error = sysctl(mib, 4, NULL, , NULL, 0); + error = sysctl(mib, nitems(mib), NULL, , NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, , NULL, 0); + error = sysctl(mib, nitems(mib), buf, , NULL, 0); if (error) { free(buf); return (NULL); Modified: head/lib/libutil/kinfo_getproc.c == --- head/lib/libutil/kinfo_getproc.cMon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getproc.cMon Jan 9 00:47:23 2017 (r311714) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -49,14 +49,14 @@ kinfo_getproc(pid_t pid) mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; - if (sysctl(mib, 4, NULL, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) return (NULL); kipp = malloc(len); if (kipp == NULL) return (NULL); - if (sysctl(mib, 4, kipp, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), kipp, , NULL, 0) < 0) goto bad; if (len != sizeof(*kipp)) goto bad; Modified: head/lib/libutil/kinfo_getvmmap.c == --- head/lib/libutil/kinfo_getvmmap.c Mon Jan 9 00:38:19 2017 (r311713) +++ head/lib/libutil/kinfo_getvmmap.c Mon Jan 9 00:47:23 2017 (r311714) @@ -2,8 +2,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include @@ -26,14 +26,14 @@ kinfo_getvmmap(pid_t pid, int *cntp) mib[2] = KERN_PROC_VMMAP; mib[3] = pid; - error = sysctl(mib, 4, NULL, , NULL, 0); + error = sysctl(mib, nitems(mib), NULL, , NULL, 0); if (error) return (NULL); len = len * 4 / 3; buf = malloc(len); if (buf == NULL) return (NULL); - error = sysctl(mib, 4, buf, , NULL, 0); + error = sysctl(mib, nitems(mib), buf, , NULL, 0); if (error) { free(buf); return (NULL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311713 - head/usr.sbin/route6d
Author: ngie Date: Mon Jan 9 00:38:19 2017 New Revision: 311713 URL: https://svnweb.freebsd.org/changeset/base/311713 Log: Use nitems(mib) instead of hardcoding mib's length MFC after:3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c == --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:37:09 2017 (r311712) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:38:19 2017 (r311713) @@ -2418,7 +2418,7 @@ getifmtu(int ifindex) mib[3] = AF_INET6; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; - if (sysctl(mib, 6, NULL, , NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) { fatal("sysctl estimate NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2426,7 +2426,7 @@ getifmtu(int ifindex) fatal("malloc"); /*NOTREACHED*/ } - if (sysctl(mib, 6, buf, , NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, , NULL, 0) < 0) { fatal("sysctl NET_RT_IFLIST"); /*NOTREACHED*/ } @@ -2598,7 +2598,7 @@ krtread(int again) free(buf); buf = NULL; } - if (sysctl(mib, 6, NULL, , NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) { errmsg = "sysctl estimate"; continue; } @@ -2606,7 +2606,7 @@ krtread(int again) errmsg = "malloc"; continue; } - if (sysctl(mib, 6, buf, , NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, , NULL, 0) < 0) { errmsg = "sysctl NET_RT_DUMP"; continue; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311712 - head/usr.sbin/route6d
Author: ngie Date: Mon Jan 9 00:37:09 2017 New Revision: 311712 URL: https://svnweb.freebsd.org/changeset/base/311712 Log: Sort #includes MFC after:3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c == --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:33:27 2017 (r311711) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:37:09 2017 (r311712) @@ -34,44 +34,40 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itojun Exp $"; #endif -#include - -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#ifdef HAVE_POLL_H -#include -#endif - -#include #include #include -#include #include +#include #include #include +#include #include #include #include #include #include #include -#include +#include +#include +#include #include - -#include +#include +#ifdef HAVE_POLL_H +#include +#endif +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include #include "route6d.h" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311711 - head/usr.sbin/route6d
Author: ngie Date: Mon Jan 9 00:33:27 2017 New Revision: 311711 URL: https://svnweb.freebsd.org/changeset/base/311711 Log: Clean up trailing whitespace MFC after:3 days Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c == --- head/usr.sbin/route6d/route6d.c Mon Jan 9 00:29:23 2017 (r311710) +++ head/usr.sbin/route6d/route6d.c Mon Jan 9 00:33:27 2017 (r311711) @@ -4,7 +4,7 @@ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 3. Neither the name of the project nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -106,7 +106,7 @@ struct ifc {/* Configuration of an in }; TAILQ_HEAD(, ifc) ifc_head = TAILQ_HEAD_INITIALIZER(ifc_head); -struct ifac { /* Adddress associated to an interface */ +struct ifac { /* Adddress associated to an interface */ TAILQ_ENTRY(ifac) ifac_next; struct ifc *ifac_ifc; /* back pointer */ @@ -673,7 +673,7 @@ init(void) fatal("rip IPV6_PKTINFO"); /*NOTREACHED*/ } -#endif +#endif #ifdef IPV6_RECVPKTINFO if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, @@ -819,8 +819,8 @@ ripsend(struct ifc *ifcp, struct sockadd * Request from non-link local address is not * a regular route6d update. */ - maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (IFMINMTU - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); nh = NULL; @@ -868,8 +868,8 @@ ripsend(struct ifc *ifcp, struct sockadd return; } - maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - - sizeof(struct udphdr) - + maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) - + sizeof(struct udphdr) - sizeof(struct rip6) + sizeof(struct netinfo6)) / sizeof(struct netinfo6); @@ -953,13 +953,13 @@ out_filter(struct riprt *rrt, struct ifc /* * -A: filter out less specific routes, if we have aggregated * route configured. -*/ +*/ TAILQ_FOREACH(iffp, >ifc_iff_head, iff_next) { if (iffp->iff_type != 'A') continue; if (rrt->rrt_info.rip6_plen <= iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(, >iff_addr)) return 0; @@ -995,7 +995,7 @@ out_filter(struct riprt *rrt, struct ifc continue; if (rrt->rrt_info.rip6_plen < iffp->iff_plen) continue; - ia = rrt->rrt_info.rip6_dest; + ia = rrt->rrt_info.rip6_dest; applyplen(, iffp->iff_plen); if (IN6_ARE_ADDR_EQUAL(, >iff_addr)) { ok = 1; @@ -1195,8 +1195,8 @@ riprecv(void) } else { riprequest(NULL, np, nn, ); } - return; - } + return; + } if (!IN6_IS_ADDR_LINKLOCAL(_addr)) { trace(1, "Response from non-ll addr: %s\n", @@ -1223,7 +1223,7 @@ riprecv(void) * source address to be forwarded to a different link. * So we also check whether the destination address is a link-local * address or the hop limit is 255. Note that RFC2080 does not require -* the specific hop limit for a unicast response, so we cannot assume +* the specific hop limit for a unicast response, so we cannot assume * the limitation. */ if (!IN6_IS_ADDR_LINKLOCAL(>ipi6_addr) && *hlimp != 255) { @@ -1245,7 +1245,7 @@ riprecv(void) return; /* The packet is from me; ignore */ if (rp->rip6_cmd !=
svn commit: r311710 - head/usr.bin/top
Author: ngie Date: Mon Jan 9 00:29:23 2017 New Revision: 311710 URL: https://svnweb.freebsd.org/changeset/base/311710 Log: Style fixes - Delete trailing whitespace - Use nitems(mib) instead of hardcoding the mib length MFC after:3 days Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c == --- head/usr.bin/top/machine.c Mon Jan 9 00:25:33 2017(r311709) +++ head/usr.bin/top/machine.c Mon Jan 9 00:29:23 2017(r311710) @@ -413,7 +413,7 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; - + if (ps.jail) jidlength = TOP_JID_LEN + 1;/* +1 for extra left space. */ else @@ -559,7 +559,7 @@ get_system_info(struct system_info *si) arc_stats[5] = arc_stat >> 10; si->arc = arc_stats; } - + /* set arrays and strings */ if (pcpu_stats) { si->cpustates = pcpu_cpu_states; @@ -585,7 +585,7 @@ get_system_info(struct system_info *si) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); - if (sysctl(mib, 2, , , NULL, 0) != -1 && + if (sysctl(mib, nitems(mib), , , NULL, 0) != -1 && boottime.tv_sec != 0) { si->boottime = boottime; } else { @@ -1072,7 +1072,7 @@ format_next_process(caddr_t handle, char } } - if (ps.jail == 0) + if (ps.jail == 0) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311709 - head/usr.sbin/rwhod
Author: ngie Date: Mon Jan 9 00:25:33 2017 New Revision: 311709 URL: https://svnweb.freebsd.org/changeset/base/311709 Log: Style(9) fixes - Sort sys/ #includes - Use nitems instead of hardcoding the length of `mib` MFC after:3 days Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c == --- head/usr.sbin/rwhod/rwhod.c Mon Jan 9 00:09:19 2017(r311708) +++ head/usr.sbin/rwhod/rwhod.c Mon Jan 9 00:25:33 2017(r311709) @@ -43,14 +43,14 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include #include +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -548,7 +548,7 @@ getboottime(int signo __unused) mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(tm); - if (sysctl(mib, 2, , , NULL, 0) == -1) { + if (sysctl(mib, nitems(mib), , , NULL, 0) == -1) { syslog(LOG_ERR, "cannot get boottime: %m"); exit(1); } @@ -629,11 +629,11 @@ configure(int so) mib[3] = AF_INET; mib[4] = NET_RT_IFLIST; mib[5] = 0; - if (sysctl(mib, 6, NULL, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), NULL, , NULL, 0) < 0) quit("route-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) quit("malloc"); - if (sysctl(mib, 6, buf, , NULL, 0) < 0) + if (sysctl(mib, nitems(mib), buf, , NULL, 0) < 0) quit("actual retrieval of interface table"); lim = buf + needed; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump
Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/sys/errno.h == --- stable/11/sys/sys/errno.h Sun Jan 8 23:41:17 2017(r311707) +++ stable/11/sys/sys/errno.h Mon Jan 9 00:09:19 2017(r311708) @@ -184,7 +184,7 @@ __END_DECLS #defineELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #defineERESTART(-1)/* restart syscall */ #defineEJUSTRETURN (-2)/* don't modify regs, just return */ Modified: stable/11/usr.bin/kdump/kdump.c == --- stable/11/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/11/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump
Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/sys/errno.h == --- stable/10/sys/sys/errno.h Sun Jan 8 23:41:17 2017(r311707) +++ stable/10/sys/sys/errno.h Mon Jan 9 00:09:19 2017(r311708) @@ -184,7 +184,7 @@ __END_DECLS #defineELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #defineERESTART(-1)/* restart syscall */ #defineEJUSTRETURN (-2)/* don't modify regs, just return */ Modified: stable/10/usr.bin/kdump/kdump.c == --- stable/10/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/10/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311707 - in head/sys/dev/rtwn: . usb
Author: avos Date: Sun Jan 8 23:41:17 2017 New Revision: 311707 URL: https://svnweb.freebsd.org/changeset/base/311707 Log: rtwn_usb(4): fix Rx buffer size calculation. Use device-specific Rx buffer size to ensure that data will not be truncated + add a warning if truncation was detected (the driver cannot handle this case correctly yet). Tested with: - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes. Modified: head/sys/dev/rtwn/if_rtwnvar.h head/sys/dev/rtwn/usb/rtwn_usb_attach.c head/sys/dev/rtwn/usb/rtwn_usb_ep.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c Modified: head/sys/dev/rtwn/if_rtwnvar.h == --- head/sys/dev/rtwn/if_rtwnvar.h Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/if_rtwnvar.h Sun Jan 8 23:41:17 2017 (r311707) @@ -25,7 +25,6 @@ #define RTWN_TX_DESC_SIZE 64 -#define RTWN_RXBUFSZ (8 * 1024) #define RTWN_TXBUFSZ (16 * 1024) #define RTWN_BCN_MAX_SIZE 512 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.c == --- head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jan 8 23:41:17 2017 (r311707) @@ -133,8 +133,9 @@ rtwn_usb_alloc_rx_list(struct rtwn_softc struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); int error, i; + /* XXX recheck */ error = rtwn_usb_alloc_list(sc, uc->uc_rx, RTWN_USB_RX_LIST_COUNT, - RTWN_RXBUFSZ); + sc->rx_dma_size + 1024); if (error != 0) return (error); Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c == --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan 8 23:41:17 2017 (r311707) @@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = RTWN_RXBUFSZ, .flags = { .pipe_bof = 1, .short_xfer_ok = 1 @@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb break; } + rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024; error = usbd_transfer_setup(uc->uc_udev, _index, uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, >sc_mtx); if (error) { Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c == --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jan 8 23:25:46 2017 (r311706) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jan 8 23:41:17 2017 (r311707) @@ -158,8 +158,12 @@ rtwn_rxeof(struct rtwn_softc *sc, uint8_ /* Make sure everything fits in xfer. */ totlen = sizeof(*stat) + infosz + pktlen; - if (totlen > len) + if (totlen > len) { + device_printf(sc->sc_dev, + "%s: totlen (%d) > len (%d)!\n", + __func__, totlen, len); break; + } if (m0 == NULL) m0 = m = rtwn_rx_copy_to_mbuf(sc, stat, totlen); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311706 - head/share/misc
Author: bapt Date: Sun Jan 8 23:25:46 2017 New Revision: 311706 URL: https://svnweb.freebsd.org/changeset/base/311706 Log: Update pciids to 2017.01.08 MFC after:1 day Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors == --- head/share/misc/pci_vendors Sun Jan 8 21:42:19 2017(r311705) +++ head/share/misc/pci_vendors Sun Jan 8 23:25:46 2017(r311706) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2016.11.21 -# Date:2016-11-21 03:15:01 +# Version: 2017.01.08 +# Date:2017-01-08 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -249,6 +249,7 @@ 0014 MegaRAID Tri-Mode SAS3516 1028 1fd4 PERC H745P MX 1d49 0602 ThinkSystem RAID 930-16i 4GB Flash PCIe 12Gb Adapter + 0015 MegaRAID Tri-Mode SAS3416 0016 MegaRAID Tri-Mode SAS3508 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter @@ -548,6 +549,7 @@ 1028 1f53 HBA330 Mini 1028 1fd2 HBA330 MX 1028 1fd3 HBA330 MMZ + 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 00ab SAS3516 Fusion-MPT Tri-Mode RAID On Chip (ROC) 00ac SAS3416 Fusion-MPT Tri-Mode I/O Controller Chip (IOC) 1d49 0201 ThinkSystem 430-16i SAS/SATA 12Gb HBA @@ -2201,6 +2203,11 @@ 67b9 Vesuvius [Radeon R9 295X2] 67be Hawaii LE 67c0 Ellesmere [Polaris10] + 67c4 Ellesmere [Radeon Pro WX 7100] + 67c7 Ellesmere [Radeon Pro WX 5100] + 67ca Ellesmere [Polaris10] + 67cc Ellesmere [Polaris10] + 67cf Ellesmere [Polaris10] 67df Ellesmere [Radeon RX 470/480] 1002 0b37 Radeon RX 480 1043 04a8 Radeon RX 480 @@ -2218,6 +2225,7 @@ 1787 a480 Radeon RX 480 67e0 Baffin [Polaris11] 67e1 Baffin [Polaris11] + 67e3 Baffin [Radeon Pro WX 4100] 67e8 Baffin [Polaris11] 67e9 Baffin [Polaris11] 67eb Baffin [Polaris11] @@ -2924,6 +2932,12 @@ 148c 9380 Radeon R9 380 # Make naming scheme consistent 174b e308 Radeon R9 380 Nitro 4G D5 + 6980 Polaris12 + 6981 Polaris12 + 6985 Polaris12 + 6986 Polaris12 + 6987 Polaris12 + 699f Polaris12 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -5095,6 +5109,7 @@ 0675 1704 ISDN Adapter (PCI Bus, D, C) 0675 1707 ISDN Adapter (PCI Bus, DV, W) 10cf 105e ISDN Adapter (PCI Bus, DV, W) + 13a0 Transformer Book T101HA-GR030R # Should be 1022:9602 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1043 83a2 M4A785TD Motherboard @@ -10077,6 +10092,7 @@ 10c3 GT218 [GeForce 8400 GS Rev. 3] 10c5 GT218 [GeForce 405] 10d8 GT218 [NVS 300] + 10ef GP102 HDMI Audio Controller 10f0 GP104 High Definition Audio Controller 1140 GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] 1019 0799 GeForce 820M @@ -10620,7 +10636,7 @@ 13f1 GM204GL [Quadro M4000] 13f2 GM204GL [Tesla M60] 13f3 GM204GL [Tesla M6] - 13f8 GM204GLM [Quadro M5000M] + 13f8 GM204GLM [Quadro M5000M / M5000 SE] 13f9 GM204GLM [Quadro M4000M] 13fa GM204GLM [Quadro M3000M] 10de 11c9 Quadro M3000 SE @@ -10634,8 +10650,9 @@ 1431 GM206GL [Tesla M4] 15f0 GP100GL 15f1 GP100GL - 15f8 GP100GL - 15f9 GP100GL + 15f7 GP100GL [Tesla P100 PCIe 12GB] + 15f8 GP100GL [Tesla P100 PCIe 16GB] + 15f9 GP100GL [Tesla P100 SMX2 16GB] 1617 GM204M [GeForce GTX 980M] 1618 GM204M [GeForce GTX 970M] 1619 GM204M [GeForce GTX 965M] @@ -10659,10 +10676,12 @@ 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 1b83 GP104 + 1b84 GP104 [GeForce GTX 1060 3GB] 1ba0 GP104M [GeForce GTX 1080] 1ba1 GP104M [GeForce GTX 1070] 1bb0 GP104GL [Quadro P5000] 1bb1 GP104GL + 1bb3 GP104GL [Tesla P4] 1bb4 GP104GL 1be0 GP104M [GeForce GTX 1080] 1be1 GP104M [GeForce GTX 1070] @@ -10678,6 +10697,9 @@ 1c80 GP107 1c81 GP107 [GeForce GTX 1050] 1c82 GP107 [GeForce GTX 1050 Ti] + 1c8c GP107M [GeForce GTX 1050 Ti] + 1c8d GP107M [GeForce GTX 1050] + 1c8e GP107M 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -12103,7 +12125,11 @@ 111f Precision Digital Images 4a47 Precision MX Video engine interface 5243 Frame capture bus interface -1120 EMC Corporation +#
Re: svn commit: r311659 - head/lib/libstand
Thanks. 2017-01-08 0:42 GMT+01:00 Baptiste Daroussin: > Author: bapt > Date: Sat Jan 7 23:42:17 2017 > New Revision: 311659 > URL: https://svnweb.freebsd.org/changeset/base/311659 > > Log: > remove network mask calculation for Classful network > > Nowadays it's not necessary to compute network mask from the IP address > and > compare to given by DHCP. > > Submitted by: kczekirda > Reviewed by: glebius, bapt > MFC after:3 weeks > Sponsored by: Oktawave > Differential Revision:https://reviews.freebsd.org/D8740 > > Modified: > head/lib/libstand/bootp.c > > Modified: head/lib/libstand/bootp.c > > == > --- head/lib/libstand/bootp.c Sat Jan 7 22:55:23 2017(r311658) > +++ head/lib/libstand/bootp.c Sat Jan 7 23:42:17 2017(r311659) > @@ -62,8 +62,6 @@ __FBSDID("$FreeBSD$"); > > struct in_addr servip; > > -static n_long nmask, smask; > - > static time_t bot; > > static char vm_rfc1048[4] = VM_RFC1048; > @@ -223,30 +221,19 @@ bootp(sock, flag) > bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile)); > bootfile[sizeof(bootfile) - 1] = '\0'; > > - if (IN_CLASSA(ntohl(myip.s_addr))) > - nmask = htonl(IN_CLASSA_NET); > - else if (IN_CLASSB(ntohl(myip.s_addr))) > - nmask = htonl(IN_CLASSB_NET); > - else > - nmask = htonl(IN_CLASSC_NET); > -#ifdef BOOTP_DEBUG > - if (debug) > - printf("'native netmask' is %s\n", intoa(nmask)); > -#endif > - > - /* Check subnet mask against net mask; toss if bogus */ > - if ((nmask & smask) != nmask) { > + if (!netmask) { > + if (IN_CLASSA(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSA_NET); > + else if (IN_CLASSB(ntohl(myip.s_addr))) > + netmask = htonl(IN_CLASSB_NET); > + else > + netmask = htonl(IN_CLASSC_NET); > #ifdef BOOTP_DEBUG > if (debug) > - printf("subnet mask (%s) bad\n", intoa(smask)); > + printf("'native netmask' is %s\n", intoa(netmask)); > #endif > - smask = 0; > } > > - /* Get subnet (or natural net) mask */ > - netmask = nmask; > - if (smask) > - netmask = smask; > #ifdef BOOTP_DEBUG > if (debug) > printf("mask: %s\n", intoa(netmask)); > @@ -385,7 +372,7 @@ vend_rfc1048(cp, len) > break; > > if (tag == TAG_SUBNET_MASK) { > - bcopy(cp, , sizeof(smask)); > + bcopy(cp, , sizeof(netmask)); > } > if (tag == TAG_GATEWAY) { > bcopy(cp, _addr, sizeof(gateip.s_addr)); > @@ -445,7 +432,7 @@ vend_cmu(cp) > vp = (struct cmu_vend *)cp; > > if (vp->v_smask.s_addr != 0) { > - smask = vp->v_smask.s_addr; > + netmask = vp->v_smask.s_addr; > } > if (vp->v_dgate.s_addr != 0) { > gateip = vp->v_dgate; > ___ > svn-src-h...@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org" > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311703 - head/sys/powerpc/include
Author: jhibbits Date: Sun Jan 8 21:12:46 2017 New Revision: 311703 URL: https://svnweb.freebsd.org/changeset/base/311703 Log: Knock a page off VM_MAX_KERNEL_ADDRESS There are places where checks are made against VM_MAX_KERNEL_ADDRESS, or virtual_end (set to VM_MAX_KERNEL_ADDRESS). With 32-bit checks, an address will always be less than or equal to 0x. Drop a page, so those checks can terminate loops safely. Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h == --- head/sys/powerpc/include/vmparam.h Sun Jan 8 20:58:58 2017 (r311702) +++ head/sys/powerpc/include/vmparam.h Sun Jan 8 21:12:46 2017 (r311703) @@ -111,7 +111,7 @@ #defineKERNBASE0xc000 /* start of kernel virtual */ #defineVM_MIN_KERNEL_ADDRESS KERNBASE -#defineVM_MAX_KERNEL_ADDRESS 0x +#defineVM_MAX_KERNEL_ADDRESS 0xefff #defineVM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif /* AIM/E500 */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311702 - head/usr.sbin/bhyve
Author: grehan Date: Sun Jan 8 20:58:58 2017 New Revision: 311702 URL: https://svnweb.freebsd.org/changeset/base/311702 Log: Use correct PCI device id for virtio-rng. This prevented the device from attaching with a Windows guest (most other guests use the device type for matching) PR: 212711 Submitted by: jbeich MFC after:3 days Modified: head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/virtio.h == --- head/usr.sbin/bhyve/virtio.hSun Jan 8 20:41:32 2017 (r311701) +++ head/usr.sbin/bhyve/virtio.hSun Jan 8 20:58:58 2017 (r311702) @@ -209,8 +209,8 @@ struct vring_used { #defineVIRTIO_VENDOR 0x1AF4 #defineVIRTIO_DEV_NET 0x1000 #defineVIRTIO_DEV_BLOCK0x1001 -#defineVIRTIO_DEV_RANDOM 0x1002 #defineVIRTIO_DEV_CONSOLE 0x1003 +#defineVIRTIO_DEV_RANDOM 0x1005 /* * PCI config space constants. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r311225 - head/sys/netinet
On Sat, Jan 07, 2017 at 02:31:28PM -0500, George Neville-Neil wrote: > > > On 7 Jan 2017, at 14:23, George Neville-Neil wrote: > > > On 4 Jan 2017, at 13:26, Mark Johnston wrote: > > > >> On Wed, Jan 04, 2017 at 02:19:13AM +, George V. Neville-Neil > >> wrote: > >>> Author: gnn > >>> Date: Wed Jan 4 02:19:13 2017 > >>> New Revision: 311225 > >>> URL: https://svnweb.freebsd.org/changeset/base/311225 > >>> > >>> Log: > >>> Fix DTrace TCP tracepoints to not use mtod() as it is both > >>> unnecessary and > >>> dangerous. Those wanting data from an mbuf should use DTrace > >>> itself to get > >>> the data. > >> > >> I think you also need to update the types in in_kdtrace.c, and add a > >> translator for struct mbuf * to ipinfo_t. > > > > Fair points. > > > > Actually, following up to myself, this does not need to be done just > yet. The pkt_info stuff is currently always NULL. I'm working on a > copyoutmbuf() subroutine that will make all of this much cleaner. The pkt_info stuff is unrelated to this - ipinfo_t is the third argument to the tcp probes. The translator which expects a pointer to the IP header is now getting a pointer to an mbuf, so this change effectively breaks scripts that use args[2] in a tcp:::send or tcp:::receive probe (among others). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311701 - head/sys/dev/gpio
Author: loos Date: Sun Jan 8 20:41:32 2017 New Revision: 311701 URL: https://svnweb.freebsd.org/changeset/base/311701 Log: Convert gpioc to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. This is inspired on r311700. MFC after:3 days Modified: head/sys/dev/gpio/gpioc.c Modified: head/sys/dev/gpio/gpioc.c == --- head/sys/dev/gpio/gpioc.c Sun Jan 8 20:37:41 2017(r311700) +++ head/sys/dev/gpio/gpioc.c Sun Jan 8 20:41:32 2017(r311701) @@ -78,18 +78,25 @@ gpioc_probe(device_t dev) static int gpioc_attach(device_t dev) { - struct gpioc_softc *sc = device_get_softc(dev); + int err; + struct gpioc_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_pdev = device_get_parent(dev); sc->sc_unit = device_get_unit(dev); - sc->sc_ctl_dev = make_dev(_cdevsw, sc->sc_unit, - UID_ROOT, GID_WHEEL, 0600, "gpioc%d", sc->sc_unit); - if (!sc->sc_ctl_dev) { + make_dev_args_init(); + devargs.mda_devsw = _cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(, >sc_ctl_dev, "gpioc%d", sc->sc_unit); + if (err != 0) { printf("Failed to create gpioc%d", sc->sc_unit); return (ENXIO); } - sc->sc_ctl_dev->si_drv1 = sc; return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311700 - head/sys/dev/etherswitch
Author: loos Date: Sun Jan 8 20:37:41 2017 New Revision: 311700 URL: https://svnweb.freebsd.org/changeset/base/311700 Log: Convert etherswitch to use the make_dev_s(9) KPI. This fix a possible race where si_drv1 can be accessed before it gets set. MFC after:3 days Suggested by: kib Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/etherswitch.c Modified: head/sys/dev/etherswitch/etherswitch.c == --- head/sys/dev/etherswitch/etherswitch.c Sun Jan 8 20:29:35 2017 (r311699) +++ head/sys/dev/etherswitch/etherswitch.c Sun Jan 8 20:37:41 2017 (r311700) @@ -99,17 +99,24 @@ etherswitch_probe(device_t dev) static int etherswitch_attach(device_t dev) { - struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); + int err; + struct etherswitch_softc *sc; + struct make_dev_args devargs; + sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_devnode = make_dev(_cdevsw, device_get_unit(dev), - UID_ROOT, GID_WHEEL, - 0600, "etherswitch%d", device_get_unit(dev)); - if (sc->sc_devnode == NULL) { + make_dev_args_init(); + devargs.mda_devsw = _cdevsw; + devargs.mda_uid = UID_ROOT; + devargs.mda_gid = GID_WHEEL; + devargs.mda_mode = 0600; + devargs.mda_si_drv1 = sc; + err = make_dev_s(, >sc_devnode, "etherswitch%d", + device_get_unit(dev)); + if (err != 0) { device_printf(dev, "failed to create character device\n"); return (ENXIO); } - sc->sc_devnode->si_drv1 = sc; return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311699 - head/usr.sbin/bhyve
Author: grehan Date: Sun Jan 8 20:29:35 2017 New Revision: 311699 URL: https://svnweb.freebsd.org/changeset/base/311699 Log: Make sure the 'Always-one' bit is always set to one, in the first byte of the 3-byte mouse data report. Plan9/9front requires this. Switch over to using #defines for the data report bits. Verified no regression on Win10/Fedora-live. Reported and tested by: Trent Thompson (trentnthompson at gmail com) MFC after:1 week Modified: head/usr.sbin/bhyve/ps2mouse.c Modified: head/usr.sbin/bhyve/ps2mouse.c == --- head/usr.sbin/bhyve/ps2mouse.c Sun Jan 8 19:48:13 2017 (r311698) +++ head/usr.sbin/bhyve/ps2mouse.c Sun Jan 8 20:29:35 2017 (r311699) @@ -62,6 +62,16 @@ __FBSDID("$FreeBSD$"); /* mouse device id */ #definePS2MOUSE_DEV_ID 0x0 +/* mouse data bits */ +#definePS2M_DATA_Y_OFLOW 0x80 +#definePS2M_DATA_X_OFLOW 0x40 +#definePS2M_DATA_Y_SIGN0x20 +#definePS2M_DATA_X_SIGN0x10 +#definePS2M_DATA_AONE 0x08 +#definePS2M_DATA_MID_BUTTON0x04 +#definePS2M_DATA_RIGHT_BUTTON 0x02 +#definePS2M_DATA_LEFT_BUTTON 0x01 + /* mouse status bits */ #definePS2M_STS_REMOTE_MODE0x40 #definePS2M_STS_ENABLE_DEV 0x20 @@ -169,19 +179,20 @@ movement_get(struct ps2mouse_softc *sc) assert(pthread_mutex_isowned_np(>mtx)); - val0 = sc->status & (PS2M_STS_LEFT_BUTTON | - PS2M_STS_RIGHT_BUTTON | PS2M_STS_MID_BUTTON); + val0 = PS2M_DATA_AONE; + val0 |= sc->status & (PS2M_DATA_LEFT_BUTTON | + PS2M_DATA_RIGHT_BUTTON | PS2M_DATA_MID_BUTTON); if (sc->delta_x >= 0) { if (sc->delta_x > 255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; } else { - val0 |= (1 << 4); + val0 |= PS2M_DATA_X_SIGN; if (sc->delta_x < -255) { - val0 |= (1 << 6); + val0 |= PS2M_DATA_X_OFLOW; val1 = 255; } else val1 = sc->delta_x; @@ -190,14 +201,14 @@ movement_get(struct ps2mouse_softc *sc) if (sc->delta_y >= 0) { if (sc->delta_y > 255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; } else { - val0 |= (1 << 5); + val0 |= PS2M_DATA_Y_SIGN; if (sc->delta_y < -255) { - val0 |= (1 << 7); + val0 |= PS2M_DATA_Y_OFLOW; val2 = 255; } else val2 = sc->delta_y; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311695 - head/sys/netinet6
Author: markj Date: Sun Jan 8 18:46:00 2017 New Revision: 311695 URL: https://svnweb.freebsd.org/changeset/base/311695 Log: Release the ND6 list lock before making a prefix off-link in nd6_timer(). Reported by: JimX-MFC With: r306829 Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Sun Jan 8 18:33:13 2017(r311694) +++ head/sys/netinet6/nd6.c Sun Jan 8 18:46:00 2017(r311695) @@ -910,7 +910,7 @@ nd6_timer(void *arg) struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; - bool onlink_locked; + uint64_t genid; TAILQ_INIT(); LIST_INIT(); @@ -1022,7 +1022,6 @@ nd6_timer(void *arg) } ND6_WLOCK(); - onlink_locked = false; restart: LIST_FOREACH_SAFE(pr, _nd_prefix, ndpr_entry, npr) { /* @@ -1045,22 +1044,19 @@ restart: continue; } if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { - if (!onlink_locked) { - onlink_locked = ND6_ONLINK_TRYLOCK(); - if (!onlink_locked) { - ND6_WUNLOCK(); - ND6_ONLINK_LOCK(); - onlink_locked = true; - ND6_WLOCK(); - goto restart; - } - } + genid = V_nd6_list_genid; + nd6_prefix_ref(pr); + ND6_WUNLOCK(); + ND6_ONLINK_LOCK(); (void)nd6_prefix_offlink(pr); + ND6_ONLINK_UNLOCK(); + ND6_WLOCK(); + nd6_prefix_rele(pr); + if (genid != V_nd6_list_genid) + goto restart; } } ND6_WUNLOCK(); - if (onlink_locked) - ND6_ONLINK_UNLOCK(); while ((pr = LIST_FIRST()) != NULL) { LIST_REMOVE(pr, ndpr_entry); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311694 - stable/11/sys/dev/usb/wlan
Author: avos Date: Sun Jan 8 18:33:13 2017 New Revision: 311694 URL: https://svnweb.freebsd.org/changeset/base/311694 Log: MFC r311105: rsu: restore 40Mhz channel support. Modified: stable/11/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/wlan/if_rsu.c == --- stable/11/sys/dev/usb/wlan/if_rsu.c Sun Jan 8 18:28:06 2017 (r311693) +++ stable/11/sys/dev/usb/wlan/if_rsu.c Sun Jan 8 18:33:13 2017 (r311694) @@ -712,7 +712,8 @@ rsu_getradiocaps(struct ieee80211com *ic if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, 0); + rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, + (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); } static void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311693 - head/sys/dev/sdhci
Author: ian Date: Sun Jan 8 18:28:06 2017 New Revision: 311693 URL: https://svnweb.freebsd.org/changeset/base/311693 Log: Now that the PRESENT_STATE register is only used for the inhibit bits loop in this function, eliminate the state variable and restructure the loop to read the register just once at the top of the loop. Suggested by: skra Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c == --- head/sys/dev/sdhci/sdhci.c Sun Jan 8 18:17:35 2017(r311692) +++ head/sys/dev/sdhci/sdhci.c Sun Jan 8 18:28:06 2017(r311693) @@ -821,7 +821,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -836,8 +836,6 @@ sdhci_start_command(struct sdhci_slot *s return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || @@ -866,7 +864,7 @@ sdhci_start_command(struct sdhci_slot *s * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -877,7 +875,6 @@ sdhci_start_command(struct sdhci_slot *s } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311690 - stable/11/usr.sbin/bsdinstall/scripts
Author: dteske Date: Sun Jan 8 18:14:22 2017 New Revision: 311690 URL: https://svnweb.freebsd.org/changeset/base/311690 Log: MFC improvements to bsdinstall's wlanconfig module MFC [85] revisions 309719-309720, 309901-309902, 309904-309911, 309913-309920, 309922-309924, 309926, 309928, 309930, 309932, 309934, 309937-309942, 309944-309952, 309958-309998, and 310038 (described below) r309719: Remove unnecessary trailing backslashes r309720: Functions in their own section r309901: Comments r309902: Use $( ... ) instead of `...` r309904: Change "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]" r309905: Remove unnecessary local initializers r309906: Consolidate locals r309907: Replace funny block with something easy to digest r309908: Collapse tiny if statements r309909: Change "[ ! ... ] && ..." to "[ ... ] || ..." r309910: Remove unnecessary quotes around number in test r309911: Group fallbacks together r309913: Allow $BSDINSTALL_TMPETC to contain whitespace or special chars r309914: Add missing `-e' parameter to sed invocations r309915: "echo | sed | sed | awk" is silly (changed to "echo | awk") r309916: Be internally consistent (": > ..." is used elsewhere in this file) r309917: awk(1) match() takes a regex, use /.../ to remind ourselves of this r309918: Remove unnecessary `-n' parameter to head/tail r309919: Whitespace r309920: Use provided API instead of hard-coded status integers r309922: Centralize backtitle string r309923: There is zero harm in always passing --default-item to dialog r309924: Always pass --default-item parameter to dialog r309926: Change the name of a variable from $def_item_... to $default_... r309928: Use ~ instead of match() r309930: Use ternary operator r309932: Remove an unnecessary "return $?" at end of function r309934: Consolidate redirects into here documents r309937: Whitespace (dialog options separated to minimize diffs) r309938: Use provided API (change "dialog" to "$DIALOG") r309939: Fix incorrect use of provided API r309940: Reorder dialog parameters based on commonality for readability r309941: Use provided API to centralize dialog title strings r309942: Allow the script path to contain whitespace and special characters r309944: Fix invalid parameter expansion (change $@ to "$@") r309945: 1 is the default descriptor for redirects without an fd prefix r309946: Use more succinct awk syntax r309947: Remove unnecessary semi-colons r309948: Remove incomplete and unnecessary creation of fd3 r309949: Utilize provided i18n strings r309950: Whitespace r309951: Remove an unnecessary call to f_dialog_title_restore() r309952: Move the secondary condition into the action clause r309958: Quote WLAN_IFACE (pedantic) r309959: Use oft-neglected syntax "startcondition, stopcondition { ... }" r309960: Add missing backslash r309961: Stop repeating strings (centralize prompt string) r309962: More efficiently make use of the exit status r309963: Avoid non-standard options r309964: Sort the domains r309965: Whitespace alignment r309966: Sanitize dialog output for portability/compatibility requirements r309967: Use more generic f_yesno() from provided API r309968: Properly quote variable r309969: Send stderr to the same place as stdout r309970: Remove completely unnecesary parentheses r309971: Start deconstructing a conveluted hunk of code r309972: If the first ping succeeded, why on Earth should we ping it again? r309973: Why use $? when you can use the command itself r309974: These two error messages have always been backwards since inception r309975: Continued resolution of conveluted statement r309976: You don't need parentheses for awk's printf r309977: Whitespace and alignment r309978: Neither printf nor print need parens in awk r309979: This statement has too many backslashes r309980: Just use print r309981: Add missing quotes r309982: Remove unnecessary quotes r309983: Use the provided API for calculating the appropriate size of menus r309984: Whitespace alignment r309985: Comment r309986: There's an API function for displaying errors r309987: There's an API function for displaying yes/no dialogs r309988: There's an API function for displaying pauses r309989: There's an API function for catching errors r309990: Calculate proper size of menu list dialog r309991: Simplify bringup of interface after changes and catch errors r309992: Restore previous comment r309993: Why test $? when you can test the command r309994: Wordsmithing r309995: Simplify loop by moving predicate to clause r309996: Simplify single-line if statements r309997: The flags of a WLAN need to be quoted r309998: It's completely pointless to replace newlines with space r310038: Revert r309918 -- modern POSIX has deprecated -<#>/+<#> syntax PR: bin/214933 Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig
svn commit: r311689 - stable/11/sbin/sysctl
Author: avos Date: Sun Jan 8 18:03:52 2017 New Revision: 311689 URL: https://svnweb.freebsd.org/changeset/base/311689 Log: MFC r310961: sysctl(8): fix typename for uint32_t Modified: stable/11/sbin/sysctl/sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/sysctl/sysctl.c == --- stable/11/sbin/sysctl/sysctl.c Sun Jan 8 17:56:54 2017 (r311688) +++ stable/11/sbin/sysctl/sysctl.c Sun Jan 8 18:03:52 2017 (r311689) @@ -114,7 +114,7 @@ static const char *ctl_typename[CTLTYPE+ [CTLTYPE_ULONG] = "unsigned long", [CTLTYPE_U8] = "uint8_t", [CTLTYPE_U16] = "uint16_t", - [CTLTYPE_U32] = "uint16_t", + [CTLTYPE_U32] = "uint32_t", [CTLTYPE_U64] = "uint64_t", [CTLTYPE_S8] = "int8_t", [CTLTYPE_S16] = "int16_t", ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311688 - head/sys/geom/vinum
Author: dim Date: Sun Jan 8 17:56:54 2017 New Revision: 311688 URL: https://svnweb.freebsd.org/changeset/base/311688 Log: Fix logic error in gvinum's gv_set_sd_state() With clang 4.0.0, I'm getting the following warnings: sys/geom/vinum/geom_vinum_state.c:186:7: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] if (!flags & GV_SETSTATE_FORCE) ^ ~ The logical not operator should obiously be called after masking. Reviewed by: mav, pfg MFC after:3 days Differential Revision:https://reviews.freebsd.org/D9093 Modified: head/sys/geom/vinum/geom_vinum_state.c Modified: head/sys/geom/vinum/geom_vinum_state.c == --- head/sys/geom/vinum/geom_vinum_state.c Sun Jan 8 16:59:07 2017 (r311687) +++ head/sys/geom/vinum/geom_vinum_state.c Sun Jan 8 17:56:54 2017 (r311688) @@ -183,7 +183,7 @@ gv_set_sd_state(struct gv_sd *s, int new * Only do this if we're forced, since it usually is done * internally, and then we do use the force flag. */ - if (!flags & GV_SETSTATE_FORCE) + if (!(flags & GV_SETSTATE_FORCE)) return (GV_ERR_SETSTATE); break; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311687 - stable/10/sys/vm
Author: kib Date: Sun Jan 8 16:59:07 2017 New Revision: 311687 URL: https://svnweb.freebsd.org/changeset/base/311687 Log: MFC r267546 (by alc): Tidy up the early parts of vm_map_insert(). MFC r267645 (by alc): When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the corresponding flag(s) in the new map entry. Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when extending the stack in the downward direction. MFC r267850 (by alc): Place the check that blocks map entry coalescing on stack entries in vm_map_simplify_entry(). MFC r267917 (by alc): Delay the call to crhold() in vm_map_insert() until we know that we won't have to undo it by calling crfree(). Eliminate an unnecessary variable from vm_map_insert(). MFC r311014: Style fixes for vm_map_insert(). Tested by:pho Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c == --- stable/10/sys/vm/vm_map.c Sun Jan 8 16:55:59 2017(r311686) +++ stable/10/sys/vm/vm_map.c Sun Jan 8 16:59:07 2017(r311687) @@ -1130,24 +1130,24 @@ vm_map_lookup_entry( */ int vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, - vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, - int cow) +vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry; - vm_map_entry_t prev_entry; - vm_map_entry_t temp_entry; - vm_eflags_t protoeflags; + vm_map_entry_t new_entry, prev_entry, temp_entry; struct ucred *cred; + vm_eflags_t protoeflags; vm_inherit_t inheritance; - boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); + KASSERT((object != kmem_object && object != kernel_object) || + (cow & MAP_COPY_ON_WRITE) == 0, + ("vm_map_insert: kmem or kernel object and COW")); + KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, + ("vm_map_insert: paradoxical MAP_NOFAULT request")); /* * Check that the start and end points are not bogus. */ - if ((start < map->min_offset) || (end > map->max_offset) || - (start >= end)) + if (start < map->min_offset || end > map->max_offset || start >= end) return (KERN_INVALID_ADDRESS); /* @@ -1162,26 +1162,22 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Assert that the next entry doesn't overlap the end point. */ - if ((prev_entry->next != >header) && - (prev_entry->next->start < end)) + if (prev_entry->next != >header && prev_entry->next->start < end) return (KERN_NO_SPACE); protoeflags = 0; - charge_prev_obj = FALSE; - if (cow & MAP_COPY_ON_WRITE) - protoeflags |= MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY; - - if (cow & MAP_NOFAULT) { + protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; + if (cow & MAP_NOFAULT) protoeflags |= MAP_ENTRY_NOFAULT; - - KASSERT(object == NULL, - ("vm_map_insert: paradoxical MAP_NOFAULT request")); - } if (cow & MAP_DISABLE_SYNCER) protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_STACK_GROWS_DOWN) + protoeflags |= MAP_ENTRY_GROWS_DOWN; + if (cow & MAP_STACK_GROWS_UP) + protoeflags |= MAP_ENTRY_GROWS_UP; if (cow & MAP_VN_WRITECOUNT) protoeflags |= MAP_ENTRY_VN_WRITECNT; if (cow & MAP_INHERIT_SHARE) @@ -1190,23 +1186,17 @@ vm_map_insert(vm_map_t map, vm_object_t inheritance = VM_INHERIT_DEFAULT; cred = NULL; - KASSERT((object != kmem_object && object != kernel_object) || - ((object == kmem_object || object == kernel_object) && - !(protoeflags & MAP_ENTRY_NEEDS_COPY)), - ("kmem or kernel object and cow")); if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT)) goto charged; if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) && ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); - KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || + KASSERT(object == NULL || + (protoeflags & MAP_ENTRY_NEEDS_COPY) != 0 || object->cred == NULL, - ("OVERCOMMIT: vm_map_insert o %p", object)); + ("overcommit: vm_map_insert o %p", object)); cred = curthread->td_ucred; -
svn commit: r311686 - stable/11/usr.sbin/bsdinstall/scripts
Author: dteske Date: Sun Jan 8 16:55:59 2017 New Revision: 311686 URL: https://svnweb.freebsd.org/changeset/base/311686 Log: MFC r309716: Add support for "hidden" Wi-Fi networks PR: bin/214933 Submitted by: Maxim FilimonovReviewed by: dteske, allanjude, adrian Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig == --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfigSun Jan 8 14:49:50 2017(r311685) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfigSun Jan 8 16:55:59 2017(r311686) @@ -207,6 +207,7 @@ fi while : do + SCANSSID=0 output=$( wpa_cli scan 2>&1 ) f_dprintf "%s" "$output" dialog --backtitle "FreeBSD Installer" --title "Scanning" \ @@ -236,7 +237,19 @@ do break ;; 1) # Cancel - exit 1 + # here we ask if the user wants to select the network manually + f_dialog_title "Network Selection" + f_dialog_yesno "Do you want to select the network manually?" || exit 1 + # and take the manual input + # first, take the ssid + f_dialog_input NETWORK "Enter SSID" || exit 1 + # then, the encryption + ENCRYPTION=$( dialog --backtitle "$DIALOG_BACKTITLE" --title \ + "$DIALOG_TITLE" --menu "Select encryption type" 0 0 0 \ + "1 WPA/WPA2 PSK" "" "2 WPA/WPA2 EAP" "" "3 WEP" "" "0 None" "" 2>&1 1>&3 ) || exit 1 + SCANSSID=1 + f_dialog_title_restore + break ;; 3) # Rescan ;; @@ -244,7 +257,7 @@ do exec 3>&- done -ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ +[ -z "$ENCRYPTION" ] && ENCRYPTION=`echo "$NETWORKS" | awk -F '\t' \ "/^\"$NETWORK\"\t/ {printf(\"%s\n\", \\\$2 );}"` if echo $ENCRYPTION | grep -q 'PSK'; then @@ -258,6 +271,7 @@ if echo $ENCRYPTION | grep -q 'PSK'; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID psk=\"$PASS\" priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf @@ -273,6 +287,7 @@ elif echo $ENCRYPTION | grep -q EAP; the exec 3>&- echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf echo "$USERPASS" | awk ' { @@ -294,6 +309,7 @@ elif echo $ENCRYPTION | grep -q WEP; the || exec $0 $@ echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE wep_key0=\"$WEPKEY\" wep_tx_keyidx=0 @@ -302,6 +318,7 @@ echo "network={ else # Open echo "network={ ssid=\"$NETWORK\" + scan_ssid=$SCANSSID key_mgmt=NONE priority=5 }" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311683 - stable/11/cddl/lib/libdtrace
Author: ae Date: Sun Jan 8 13:38:17 2017 New Revision: 311683 URL: https://svnweb.freebsd.org/changeset/base/311683 Log: MFC r310785: Convert ipv4_flags and ipv4_offset fields into host byte order. Also save only high bits in the ipv4_flags, because it is defined as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20. Modified: stable/11/cddl/lib/libdtrace/ip.d Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/lib/libdtrace/ip.d == --- stable/11/cddl/lib/libdtrace/ip.d Sun Jan 8 13:35:10 2017 (r311682) +++ stable/11/cddl/lib/libdtrace/ip.d Sun Jan 8 13:38:17 2017 (r311683) @@ -255,8 +255,8 @@ translator ipv4info_t < struct ip *p > { ipv4_tos = p == NULL ? 0 : p->ip_tos; ipv4_length = p == NULL ? 0 : ntohs(p->ip_len); ipv4_ident =p == NULL ? 0 : ntohs(p->ip_id); - ipv4_flags =p == NULL ? 0 : (p->ip_off & 0xe000); - ipv4_offset = p == NULL ? 0 : p->ip_off; + ipv4_flags =p == NULL ? 0 : (ntohs(p->ip_off) & 0xe000) >> 8; + ipv4_offset = p == NULL ? 0 : ntohs(p->ip_off) & 0x1fff; ipv4_ttl = p == NULL ? 0 : p->ip_ttl; ipv4_protocol = p == NULL ? 0 : p->ip_p; ipv4_protostr = p == NULL ? "" : protocols[p->ip_p]; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311682 - stable/11/sys/netinet
Author: ae Date: Sun Jan 8 13:35:10 2017 New Revision: 311682 URL: https://svnweb.freebsd.org/changeset/base/311682 Log: MFC r310783: When we are sending IP fragments, update ip pointers in IP_PROBE() for each fragment. Modified: stable/11/sys/netinet/ip_fastfwd.c stable/11/sys/netinet/ip_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_fastfwd.c == --- stable/11/sys/netinet/ip_fastfwd.c Sun Jan 8 13:31:24 2017 (r311681) +++ stable/11/sys/netinet/ip_fastfwd.c Sun Jan 8 13:35:10 2017 (r311682) @@ -400,8 +400,9 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, - ip, NULL); + IP_PROBE(send, NULL, NULL, + mtod(m, struct ip *), nh.nh_ifp, + mtod(m, struct ip *), NULL); /* XXX: we can use cached route here */ error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, (struct sockaddr *), NULL); Modified: stable/11/sys/netinet/ip_output.c == --- stable/11/sys/netinet/ip_output.c Sun Jan 8 13:31:24 2017 (r311681) +++ stable/11/sys/netinet/ip_output.c Sun Jan 8 13:35:10 2017 (r311682) @@ -693,7 +693,8 @@ sendit: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); + IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, + mtod(m, struct ip *), NULL); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); } else ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311681 - in stable/11/sys: conf netinet6
Author: ae Date: Sun Jan 8 13:31:24 2017 New Revision: 311681 URL: https://svnweb.freebsd.org/changeset/base/311681 Log: MFC r309883: Add ip6_tryforward() - a run to completion forwarding implementation for IPv6. It gets performance benefits from reduced number of checks. It doesn't copy mbuf to be able send ICMPv6 error message, because it keeps mbuf unchanged until the moment, when the route decision has been made. It doesn't do IPsec checks, and when some IPsec security policies present, ip6_input() uses normal slow path. Relnotes: yes Sponsored by: Yandex LLC Added: stable/11/sys/netinet6/ip6_fastfwd.c - copied unchanged from r309883, head/sys/netinet6/ip6_fastfwd.c Modified: stable/11/sys/conf/files stable/11/sys/netinet6/in6_var.h stable/11/sys/netinet6/ip6_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files == --- stable/11/sys/conf/filesSun Jan 8 13:26:34 2017(r311680) +++ stable/11/sys/conf/filesSun Jan 8 13:31:24 2017(r311681) @@ -3873,6 +3873,7 @@ netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 netinet6/in6_rss.c optional inet6 rss netinet6/in6_src.c optional inet6 +netinet6/ip6_fastfwd.c optional inet6 netinet6/ip6_forward.c optional inet6 netinet6/ip6_gre.c optional gre inet6 netinet6/ip6_id.c optional inet6 Modified: stable/11/sys/netinet6/in6_var.h == --- stable/11/sys/netinet6/in6_var.hSun Jan 8 13:26:34 2017 (r311680) +++ stable/11/sys/netinet6/in6_var.hSun Jan 8 13:31:24 2017 (r311681) @@ -819,6 +819,7 @@ voidin6_newaddrmsg(struct in6_ifaddr *, /* * Extended API for IPv6 FIB support. */ +struct mbuf *ip6_tryforward(struct mbuf *); void in6_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *, u_int); intin6_rtrequest(int, struct sockaddr *, struct sockaddr *, Copied: stable/11/sys/netinet6/ip6_fastfwd.c (from r309883, head/sys/netinet6/ip6_fastfwd.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/netinet6/ip6_fastfwd.cSun Jan 8 13:31:24 2017 (r311681, copy of r309883, head/sys/netinet6/ip6_fastfwd.c) @@ -0,0 +1,295 @@ +/*- + * Copyright (c) 2014-2016 Andrey V. Elsukov+ * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet6.h" +#include "opt_ipstealth.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int +ip6_findroute(struct nhop6_basic *pnh, const struct sockaddr_in6 *dst, +struct mbuf *m) +{ + + if (fib6_lookup_nh_basic(M_GETFIB(m), >sin6_addr, + dst->sin6_scope_id, 0, dst->sin6_flowinfo, pnh) != 0) { + IP6STAT_INC(ip6s_noroute); + IP6STAT_INC(ip6s_cantforward); + icmp6_error(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_NOROUTE, 0); + return (EHOSTUNREACH); + } + if (pnh->nh_flags & NHF_BLACKHOLE) { + IP6STAT_INC(ip6s_cantforward); + m_freem(m); + return (EHOSTUNREACH); + } + + if (pnh->nh_flags & NHF_REJECT)
svn commit: r311680 - head/sys/cam/ctl
Author: mav Date: Sun Jan 8 13:26:34 2017 New Revision: 311680 URL: https://svnweb.freebsd.org/changeset/base/311680 Log: Make CTL_GETSTATS ioctl return partial data if buffer is small. MFC after:2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sun Jan 8 12:40:07 2017(r311679) +++ head/sys/cam/ctl/ctl.c Sun Jan 8 13:26:34 2017(r311680) @@ -2779,32 +2779,29 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_GETSTATS: { - struct ctl_stats *stats; + struct ctl_stats *stats = (struct ctl_stats *)addr; int i; - stats = (struct ctl_stats *)addr; - - if ((sizeof(struct ctl_lun_io_stats) * softc->num_luns) > -stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - stats->num_luns = softc->num_luns; - break; - } /* * XXX KDM no locking here. If the LUN list changes, * things can blow up. */ i = 0; + stats->status = CTL_SS_OK; + stats->fill_len = 0; STAILQ_FOREACH(lun, >lun_list, links) { + if (stats->fill_len + sizeof(lun->stats) > + stats->alloc_len) { + stats->status = CTL_SS_NEED_MORE_SPACE; + break; + } retval = copyout(>stats, >lun_stats[i++], sizeof(lun->stats)); if (retval != 0) break; + stats->fill_len += sizeof(lun->stats); } stats->num_luns = softc->num_luns; - stats->fill_len = sizeof(struct ctl_lun_io_stats) * -softc->num_luns; - stats->status = CTL_SS_OK; #ifdef CTL_TIME_IO stats->flags = CTL_STATS_FLAG_TIME_VALID; #else ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311679 - head/sys/netipsec
Author: ae Date: Sun Jan 8 12:40:07 2017 New Revision: 311679 URL: https://svnweb.freebsd.org/changeset/base/311679 Log: Add direction argument to ipsec_setspidx_inpcb() function. This function is used only by ipsec_getpolicybysock() to fill security policy index selector for locally generated packets (that have INPCB). The function incorrectly assumes that spidx is the same for both directions. Fix this by using new direction argument to specify correct INPCB security policy - sp_in or sp_out. There is no need to fill both policy indeces, because they are overwritten for each packet. This fixes security policy matching for outbound packets when user has specified TCP/UDP ports in the security policy upperspec. PR: 213869 MFC after:1 week Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c == --- head/sys/netipsec/ipsec.c Sun Jan 8 10:13:05 2017(r311678) +++ head/sys/netipsec/ipsec.c Sun Jan 8 12:40:07 2017(r311679) @@ -241,7 +241,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, #endif /* INET6 */ static int ipsec_in_reject(struct secpolicy *, const struct mbuf *); -static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *); +static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *, u_int); static int ipsec_setspidx(const struct mbuf *, struct secpolicyindex *, int); static void ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); static int ipsec4_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); @@ -343,7 +343,7 @@ ipsec_getpolicybysock(const struct mbuf } /* Set spidx in pcb. */ - *error = ipsec_setspidx_inpcb(m, inp); + *error = ipsec_setspidx_inpcb(m, inp, dir); if (*error) return (NULL); @@ -500,8 +500,9 @@ ipsec4_checkpolicy(const struct mbuf *m, } static int -ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp, u_int dir) { + struct secpolicyindex *spidx; int error; IPSEC_ASSERT(inp != NULL, ("null inp")); @@ -509,11 +510,13 @@ ipsec_setspidx_inpcb(const struct mbuf * IPSEC_ASSERT(inp->inp_sp->sp_out != NULL && inp->inp_sp->sp_in != NULL, ("null sp_in || sp_out")); - error = ipsec_setspidx(m, >inp_sp->sp_in->spidx, 1); + if (dir == IPSEC_DIR_INBOUND) + spidx = >inp_sp->sp_in->spidx; + else + spidx = >inp_sp->sp_out->spidx; + error = ipsec_setspidx(m, spidx, 1); if (error == 0) { - inp->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND; - inp->inp_sp->sp_out->spidx = inp->inp_sp->sp_in->spidx; - inp->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND; + spidx->dir = dir; } else { bzero(>inp_sp->sp_in->spidx, sizeof (inp->inp_sp->sp_in->spidx)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311678 - head/sys/net80211
Author: adrian Date: Sun Jan 8 10:13:05 2017 New Revision: 311678 URL: https://svnweb.freebsd.org/changeset/base/311678 Log: [net80211] add roaming parameters for 11ac. These are mostly placeholders for now. Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c == --- head/sys/net80211/ieee80211_scan.c Sun Jan 8 10:07:54 2017 (r311677) +++ head/sys/net80211/ieee80211_scan.c Sun Jan 8 10:13:05 2017 (r311678) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #defineROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ #defineROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ #defineROAM_MCS_11N_DEFAULT(1 | IEEE80211_RATE_MCS) /* 11n bss */ +#defineROAM_MCS_11AC_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11ac bss; XXX not used yet */ void ieee80211_scan_attach(struct ieee80211com *ic) @@ -116,6 +117,11 @@ static const struct ieee80211_roamparam .rate = ROAM_MCS_11N_DEFAULT }, [IEEE80211_MODE_11NG] = { .rssi = ROAM_RSSI_11B_DEFAULT, .rate = ROAM_MCS_11N_DEFAULT }, + [IEEE80211_MODE_VHT_2GHZ] = { .rssi = ROAM_RSSI_11B_DEFAULT, + .rate = ROAM_MCS_11AC_DEFAULT }, + [IEEE80211_MODE_VHT_5GHZ] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_MCS_11AC_DEFAULT }, + }; void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311677 - head/sys/net80211
Author: adrian Date: Sun Jan 8 10:07:54 2017 New Revision: 311677 URL: https://svnweb.freebsd.org/changeset/base/311677 Log: [net80211] use the correct freq2 field when populating VHT operation element. Whilst here, leave a TODO comment so I revisit this routine in the context of hostap operation probe requests for IBSS/mesh. Modified: head/sys/net80211/ieee80211_vht.c Modified: head/sys/net80211/ieee80211_vht.c == --- head/sys/net80211/ieee80211_vht.c Sun Jan 8 09:18:08 2017 (r311676) +++ head/sys/net80211/ieee80211_vht.c Sun Jan 8 10:07:54 2017 (r311677) @@ -352,6 +352,14 @@ ieee80211_vht_get_chwidth_ie(struct ieee /* * Note: this just uses the current channel information; * it doesn't use the node info after parsing. + * + * XXX TODO: need to make the basic MCS set configurable. + * XXX TODO: read 802.11-2013 to determine what to set + * chwidth to when scanning. I have a feeling + * it isn't involved in scanning and we shouldn't + * be sending it; and I don't yet know what to set + * it to for IBSS or hostap where the peer may be + * a completely different channel width to us. */ uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) @@ -380,7 +388,7 @@ ieee80211_add_vhtinfo(uint8_t *frm, stru *frm++ = ni->ni_chan->ic_vht_ch_freq1; /* 8-bit freq2 */ - *frm++ = ni->ni_chan->ic_vht_ch_freq1; + *frm++ = ni->ni_chan->ic_vht_ch_freq2; /* 16-bit basic MCS set - just MCS0..7 for NSS=1 for now */ ADDSHORT(frm, 0xfffc); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311676 - stable/11/sys/vm
Author: kib Date: Sun Jan 8 09:18:08 2017 New Revision: 311676 URL: https://svnweb.freebsd.org/changeset/base/311676 Log: MFC r311014: Style fixes for vm_map_insert(). Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c == --- stable/11/sys/vm/vm_map.c Sun Jan 8 09:16:07 2017(r311675) +++ stable/11/sys/vm/vm_map.c Sun Jan 8 09:18:08 2017(r311676) @@ -1180,8 +1180,8 @@ vm_map_insert(vm_map_t map, vm_object_t vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow) { vm_map_entry_t new_entry, prev_entry, temp_entry; - vm_eflags_t protoeflags; struct ucred *cred; + vm_eflags_t protoeflags; vm_inherit_t inheritance; VM_MAP_ASSERT_LOCKED(map); @@ -1194,8 +1194,7 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Check that the start and end points are not bogus. */ - if ((start < map->min_offset) || (end > map->max_offset) || - (start >= end)) + if (start < map->min_offset || end > map->max_offset || start >= end) return (KERN_INVALID_ADDRESS); /* @@ -1210,8 +1209,7 @@ vm_map_insert(vm_map_t map, vm_object_t /* * Assert that the next entry doesn't overlap the end point. */ - if ((prev_entry->next != >header) && - (prev_entry->next->start < end)) + if (prev_entry->next != >header && prev_entry->next->start < end) return (KERN_NO_SPACE); protoeflags = 0; @@ -1241,9 +1239,10 @@ vm_map_insert(vm_map_t map, vm_object_t ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); - KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || + KASSERT(object == NULL || + (protoeflags & MAP_ENTRY_NEEDS_COPY) != 0 || object->cred == NULL, - ("OVERCOMMIT: vm_map_insert o %p", object)); + ("overcommit: vm_map_insert o %p", object)); cred = curthread->td_ucred; } @@ -1263,29 +1262,27 @@ charged: if (object->ref_count > 1 || object->shadow_count != 0) vm_object_clear_flag(object, OBJ_ONEMAPPING); VM_OBJECT_WUNLOCK(object); - } - else if ((prev_entry != >header) && -(prev_entry->eflags == protoeflags) && -(cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && -(prev_entry->end == start) && -(prev_entry->wired_count == 0) && -(prev_entry->cred == cred || - (prev_entry->object.vm_object != NULL && - (prev_entry->object.vm_object->cred == cred))) && - vm_object_coalesce(prev_entry->object.vm_object, - prev_entry->offset, - (vm_size_t)(prev_entry->end - prev_entry->start), - (vm_size_t)(end - prev_entry->end), cred != NULL && - (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { + } else if (prev_entry != >header && + prev_entry->eflags == protoeflags && + (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 && + prev_entry->end == start && prev_entry->wired_count == 0 && + (prev_entry->cred == cred || + (prev_entry->object.vm_object != NULL && + prev_entry->object.vm_object->cred == cred)) && + vm_object_coalesce(prev_entry->object.vm_object, + prev_entry->offset, + (vm_size_t)(prev_entry->end - prev_entry->start), + (vm_size_t)(end - prev_entry->end), cred != NULL && + (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) { /* * We were able to extend the object. Determine if we * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == inheritance) && - (prev_entry->protection == prot) && - (prev_entry->max_protection == max)) { - map->size += (end - prev_entry->end); + if (prev_entry->inheritance == inheritance && + prev_entry->protection == prot && + prev_entry->max_protection == max) { + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); @@ -1300,7 +1297,7 @@ charged: */ object =
Re: svn commit: r311665 - head/sys/fs/cd9660
On Sun, Jan 08, 2017 at 06:21:49AM +, Conrad E. Meyer wrote: > +/* > + * When ino_t becomes 64-bit, we can remove this definition in favor of > ino_t. > + */ > +#define cd_ino_t uint64_t > + Why the type is defined and not typedef-ed ? Also, I do not think that it is good idea to rely on specific size of the special-purpose system types, like ino_t, even if it is only an intent. Both because the types can change, and because it reduces the usefulness of the code outside the FreeBSD content (our code is often taken into weird embedded systems), where system types might be different. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311675 - head/sys/fs/cd9660
Author: cem Date: Sun Jan 8 09:16:07 2017 New Revision: 311675 URL: https://svnweb.freebsd.org/changeset/base/311675 Log: iso_rrip.h: Hide kernel definitions from makefs(8) Reported by: O. Hartmann Modified: head/sys/fs/cd9660/iso_rrip.h Modified: head/sys/fs/cd9660/iso_rrip.h == --- head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 08:53:34 2017 (r311674) +++ head/sys/fs/cd9660/iso_rrip.h Sun Jan 8 09:16:07 2017 (r311675) @@ -54,6 +54,7 @@ #defineISO_SUSP_STOP 0x1000 #defineISO_SUSP_UNKNOWN0x8000 +#ifdef _KERNEL typedef struct { struct iso_node *inop; int fields; /* interesting fields in this analysis */ @@ -80,3 +81,4 @@ int cd9660_rrip_getsymname(struct iso_di struct iso_mnt *imp); int cd9660_rrip_offset(struct iso_directory_record *isodir, struct iso_mnt *imp); +#endif /* _KERNEL */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311674 - stable/11/usr.bin/netstat
Author: ume Date: Sun Jan 8 08:53:34 2017 New Revision: 311674 URL: https://svnweb.freebsd.org/changeset/base/311674 Log: MFC r311426: When displaying netstat details with libxo in JSON or XML modes, the value conversion for tcp6 and udp6 port numbers drops last digit. PR: 215682 Modified: stable/11/usr.bin/netstat/inet6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/inet6.c == --- stable/11/usr.bin/netstat/inet6.c Sun Jan 8 08:52:53 2017 (r311673) +++ stable/11/usr.bin/netstat/inet6.c Sun Jan 8 08:53:34 2017 (r311674) @@ -1290,7 +1290,7 @@ inet6print(const char *container, struct xo_emit("{d:target/%-*.*s} ", width, width, line); - plen = strlen(cp) - 1; + plen = strlen(cp); alen--; xo_emit("{e:address/%*.*s}{e:port/%*.*s}", alen, alen, line, plen, plen, cp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311673 - stable/10/sys/cam/ctl
Author: mav Date: Sun Jan 8 08:52:53 2017 New Revision: 311673 URL: https://svnweb.freebsd.org/changeset/base/311673 Log: MFC r311446: Fix bootverbose affecting code logic in r294558. Reported by:Jilles TjoelkerModified: stable/10/sys/cam/ctl/ctl_ha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ha.c == --- stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:16 2017 (r311672) +++ stable/10/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:53 2017 (r311673) @@ -443,8 +443,9 @@ ctl_ha_connect(struct ha_softc *softc) memcpy(, >ha_peer_in, sizeof(sa)); error = soconnect(so, (struct sockaddr *), td); - if (error != 0 && bootverbose) { - printf("%s: soconnect() error %d\n", __func__, error); + if (error != 0) { + if (bootverbose) + printf("%s: soconnect() error %d\n", __func__, error); goto out; } return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311672 - stable/11/sys/cam/ctl
Author: mav Date: Sun Jan 8 08:52:16 2017 New Revision: 311672 URL: https://svnweb.freebsd.org/changeset/base/311672 Log: MFC r311446: Fix bootverbose affecting code logic in r294558. Reported by: Jilles TjoelkerModified: stable/11/sys/cam/ctl/ctl_ha.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_ha.c == --- stable/11/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:36:37 2017 (r311671) +++ stable/11/sys/cam/ctl/ctl_ha.c Sun Jan 8 08:52:16 2017 (r311672) @@ -443,8 +443,9 @@ ctl_ha_connect(struct ha_softc *softc) memcpy(, >ha_peer_in, sizeof(sa)); error = soconnect(so, (struct sockaddr *), td); - if (error != 0 && bootverbose) { - printf("%s: soconnect() error %d\n", __func__, error); + if (error != 0) { + if (bootverbose) + printf("%s: soconnect() error %d\n", __func__, error); goto out; } return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r311671 - head/lib/libprocstat
Author: cem Date: Sun Jan 8 08:36:37 2017 New Revision: 311671 URL: https://svnweb.freebsd.org/changeset/base/311671 Log: libprocstat: Include cd9660 headers in the same order as the kernel Fix userspace build after r311665. Modified: head/lib/libprocstat/cd9660.c Modified: head/lib/libprocstat/cd9660.c == --- head/lib/libprocstat/cd9660.c Sun Jan 8 07:25:22 2017 (r311670) +++ head/lib/libprocstat/cd9660.c Sun Jan 8 08:36:37 2017 (r311671) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); #include -#include #define _KERNEL #include #undef _KERNEL +#include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r311665 - head/sys/fs/cd9660
> On Jan 7, 2017, at 22:21, Conrad E. Meyerwrote: > > Author: cem > Date: Sun Jan 8 06:21:49 2017 > New Revision: 311665 > URL: https://svnweb.freebsd.org/changeset/base/311665 > > Log: > cd9660: Expand internal inum size to 64 bits > > Inums in cd9660 refer to byte offsets on the media. DVD and BD media > can have entries above 4GB, especially with multi-session images. This change broke the build; look for the Jenkins i386 email that notes that cd_ino_t isn't defined. Thanks, -Ngie ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"