mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 04:15:06 +01:00
Compare commits
42
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2318891ec4 | ||
|
|
dc412b00b5 | ||
|
|
fd73ee09e9 | ||
|
|
2fcc072881 | ||
|
|
1121df919e | ||
|
|
46dc671e90 | ||
|
|
4517d526a2 | ||
|
|
9a11dca784 | ||
|
|
9471e2aff3 | ||
|
|
06fe5baafd | ||
|
|
ff12590186 | ||
|
|
57eb02157d | ||
|
|
1b7f455aea | ||
|
|
e4ea187dcb | ||
|
|
82fbce84cc | ||
|
|
58f4b53eca | ||
|
|
c51853ba05 | ||
|
|
732a9a3936 | ||
|
|
5be21ecf7e | ||
|
|
ea2938fd97 | ||
|
|
70027a7adc | ||
|
|
7de120e818 | ||
|
|
0025715929 | ||
|
|
f24c4bfef1 | ||
|
|
bea6412bff | ||
|
|
9b7559478f | ||
|
|
c3f26ccfe5 | ||
|
|
e5d4da4d0f | ||
|
|
0489917303 | ||
|
|
896d2994bc | ||
|
|
2703fe37e0 | ||
|
|
43f2b8537b | ||
|
|
3acb8e70d3 | ||
|
|
3318ba1c74 | ||
|
|
1998538b2b | ||
|
|
5e16ff578b | ||
|
|
a28ab21b40 | ||
|
|
808faf4e3b | ||
|
|
14e377ffe1 | ||
|
|
7c4fc11753 | ||
|
|
8ce5685daf | ||
|
|
5c3d876b2a |
No files matched your search
@@ -114,7 +114,6 @@ lib/libbluetooth emax Pre-commit review preferred.
|
||||
lib/libsdp emax Pre-commit review preferred.
|
||||
usr.bin/bluetooth emax Pre-commit review preferred.
|
||||
usr.sbin/bluetooth emax Pre-commit review preferred.
|
||||
gnu/usr.bin/send-pr bugmaster Pre-commit review requested.
|
||||
*env(3) secteam Due to the problematic security history of this
|
||||
code, please have patches reviewed by secteam.
|
||||
share/zoneinfo edwin Heads-up appreciated, since our data is coming
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20140614: send-pr removal
|
||||
OLD_FILES+=usr/share/man/man1/send-pr.1.gz
|
||||
OLD_FILES+=etc/gnats/freefall
|
||||
OLD_DIRS+=etc/gnats
|
||||
# 20140512: new clang import which bumps version from 3.4 to 3.4.1.
|
||||
OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h
|
||||
OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h
|
||||
|
||||
@@ -11,6 +11,9 @@ handbook:
|
||||
Items affecting the ports and packages system can be found in
|
||||
/usr/ports/UPDATING. Please read that file before running portupgrade.
|
||||
|
||||
20140716:
|
||||
9.3-RELEASE.
|
||||
|
||||
20140608:
|
||||
On i386 and amd64 systems, the onifconsole flag is now set by default
|
||||
in /etc/ttys for ttyu0. This causes ttyu0 to be automatically enabled
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
!:mime text/x-awk
|
||||
0 string/wt #!\ /usr/bin/awk awk script text executable
|
||||
!:mime text/x-awk
|
||||
0 regex =^\\s*BEGIN\\s*[{] awk script text
|
||||
0 regex =^\\s{0,100}BEGIN\\s{0,100}[{] awk script text
|
||||
!:strength - 12
|
||||
|
||||
# AT&T Bell Labs' Plan 9 shell
|
||||
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
|
||||
|
||||
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
|
||||
== NULL)
|
||||
goto done;
|
||||
if ((rv = file_softmagic(ms, utf8_buf,
|
||||
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
|
||||
(size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
|
||||
rv = -1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -414,7 +414,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t,
|
||||
unichar **, size_t *, const char **, const char **, const char **);
|
||||
protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
|
||||
protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
|
||||
int, int);
|
||||
size_t, int, int);
|
||||
protected struct mlist *file_apprentice(struct magic_set *, const char *, int);
|
||||
protected uint64_t file_signextend(struct magic_set *, struct magic *,
|
||||
uint64_t);
|
||||
|
||||
@@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
|
||||
|
||||
/* try soft magic tests */
|
||||
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
|
||||
if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
|
||||
if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
|
||||
looks_text)) != 0) {
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0)
|
||||
(void)fprintf(stderr, "softmagic %d\n", m);
|
||||
|
||||
+32
-22
@@ -43,9 +43,9 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $")
|
||||
|
||||
|
||||
private int match(struct magic_set *, struct magic *, uint32_t,
|
||||
const unsigned char *, size_t, int, int);
|
||||
const unsigned char *, size_t, int, int, int);
|
||||
private int mget(struct magic_set *, const unsigned char *,
|
||||
struct magic *, size_t, unsigned int, int);
|
||||
struct magic *, size_t, unsigned int, int, int);
|
||||
private int magiccheck(struct magic_set *, struct magic *);
|
||||
private int32_t mprint(struct magic_set *, struct magic *);
|
||||
private int32_t moffset(struct magic_set *, struct magic *);
|
||||
@@ -60,6 +60,7 @@ private void cvt_16(union VALUETYPE *, const struct magic *);
|
||||
private void cvt_32(union VALUETYPE *, const struct magic *);
|
||||
private void cvt_64(union VALUETYPE *, const struct magic *);
|
||||
|
||||
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
|
||||
/*
|
||||
* softmagic - lookup one file in parsed, in-memory copy of database
|
||||
* Passed the name and FILE * of one file to be typed.
|
||||
@@ -67,13 +68,13 @@ private void cvt_64(union VALUETYPE *, const struct magic *);
|
||||
/*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */
|
||||
protected int
|
||||
file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
|
||||
int mode, int text)
|
||||
size_t level, int mode, int text)
|
||||
{
|
||||
struct mlist *ml;
|
||||
int rv;
|
||||
for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next)
|
||||
if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode,
|
||||
text)) != 0)
|
||||
text, level)) != 0)
|
||||
return rv;
|
||||
|
||||
return 0;
|
||||
@@ -108,7 +109,8 @@ file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
|
||||
*/
|
||||
private int
|
||||
match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
|
||||
const unsigned char *s, size_t nbytes, int mode, int text)
|
||||
const unsigned char *s, size_t nbytes, int mode, int text,
|
||||
int recursion_level)
|
||||
{
|
||||
uint32_t magindex = 0;
|
||||
unsigned int cont_level = 0;
|
||||
@@ -140,7 +142,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
|
||||
ms->line = m->lineno;
|
||||
|
||||
/* if main entry matches, print it... */
|
||||
switch (mget(ms, s, m, nbytes, cont_level, text)) {
|
||||
switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
|
||||
case -1:
|
||||
return -1;
|
||||
case 0:
|
||||
@@ -223,7 +225,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
switch (mget(ms, s, m, nbytes, cont_level, text)) {
|
||||
switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
|
||||
case -1:
|
||||
return -1;
|
||||
case 0:
|
||||
@@ -1018,12 +1020,18 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
|
||||
private int
|
||||
mget(struct magic_set *ms, const unsigned char *s,
|
||||
struct magic *m, size_t nbytes, unsigned int cont_level, int text)
|
||||
struct magic *m, size_t nbytes, unsigned int cont_level, int text,
|
||||
int recursion_level)
|
||||
{
|
||||
uint32_t offset = ms->offset;
|
||||
uint32_t count = m->str_range;
|
||||
union VALUETYPE *p = &ms->ms_value;
|
||||
|
||||
if (recursion_level >= 20) {
|
||||
file_error(ms, 0, "recursion nesting exceeded");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1)
|
||||
return -1;
|
||||
|
||||
@@ -1073,7 +1081,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
}
|
||||
switch (m->in_type) {
|
||||
case FILE_BYTE:
|
||||
if (nbytes < (offset + 1))
|
||||
if (OFFSET_OOB(nbytes, offset, 1))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1108,7 +1116,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_BESHORT:
|
||||
if (nbytes < (offset + 2))
|
||||
if (OFFSET_OOB(nbytes, offset, 2))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1160,7 +1168,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LESHORT:
|
||||
if (nbytes < (offset + 2))
|
||||
if (OFFSET_OOB(nbytes, offset, 2))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1212,7 +1220,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_SHORT:
|
||||
if (nbytes < (offset + 2))
|
||||
if (OFFSET_OOB(nbytes, offset, 2))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1249,7 +1257,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
break;
|
||||
case FILE_BELONG:
|
||||
case FILE_BEID3:
|
||||
if (nbytes < (offset + 4))
|
||||
if (OFFSET_OOB(nbytes, offset, 4))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1320,7 +1328,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
break;
|
||||
case FILE_LELONG:
|
||||
case FILE_LEID3:
|
||||
if (nbytes < (offset + 4))
|
||||
if (OFFSET_OOB(nbytes, offset, 4))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1390,7 +1398,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_MELONG:
|
||||
if (nbytes < (offset + 4))
|
||||
if (OFFSET_OOB(nbytes, offset, 4))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1460,7 +1468,7 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
offset = ~offset;
|
||||
break;
|
||||
case FILE_LONG:
|
||||
if (nbytes < (offset + 4))
|
||||
if (OFFSET_OOB(nbytes, offset, 4))
|
||||
return 0;
|
||||
if (off) {
|
||||
switch (m->in_op & FILE_OPS_MASK) {
|
||||
@@ -1527,14 +1535,14 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
/* Verify we have enough data to match magic type */
|
||||
switch (m->type) {
|
||||
case FILE_BYTE:
|
||||
if (nbytes < (offset + 1)) /* should alway be true */
|
||||
if (OFFSET_OOB(nbytes, offset, 1))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case FILE_SHORT:
|
||||
case FILE_BESHORT:
|
||||
case FILE_LESHORT:
|
||||
if (nbytes < (offset + 2))
|
||||
if (OFFSET_OOB(nbytes, offset, 2))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -1553,21 +1561,21 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
case FILE_FLOAT:
|
||||
case FILE_BEFLOAT:
|
||||
case FILE_LEFLOAT:
|
||||
if (nbytes < (offset + 4))
|
||||
if (OFFSET_OOB(nbytes, offset, 4))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case FILE_DOUBLE:
|
||||
case FILE_BEDOUBLE:
|
||||
case FILE_LEDOUBLE:
|
||||
if (nbytes < (offset + 8))
|
||||
if (OFFSET_OOB(nbytes, offset, 8))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
case FILE_STRING:
|
||||
case FILE_PSTRING:
|
||||
case FILE_SEARCH:
|
||||
if (nbytes < (offset + m->vallen))
|
||||
if (OFFSET_OOB(nbytes, offset, m->vallen))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -1577,13 +1585,15 @@ mget(struct magic_set *ms, const unsigned char *s,
|
||||
break;
|
||||
|
||||
case FILE_INDIRECT:
|
||||
if (offset == 0)
|
||||
return 0;
|
||||
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
|
||||
file_printf(ms, "%s", m->desc) == -1)
|
||||
return -1;
|
||||
if (nbytes < offset)
|
||||
return 0;
|
||||
return file_softmagic(ms, s + offset, nbytes - offset,
|
||||
BINTEST, text);
|
||||
recursion_level, BINTEST, text);
|
||||
|
||||
case FILE_DEFAULT: /* nothing to check */
|
||||
default:
|
||||
|
||||
@@ -230,7 +230,6 @@ distribution:
|
||||
${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
|
||||
${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
|
||||
${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
|
||||
${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
|
||||
${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
|
||||
${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
|
||||
${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
..
|
||||
devd
|
||||
..
|
||||
gnats
|
||||
..
|
||||
gss
|
||||
..
|
||||
mail
|
||||
|
||||
@@ -16,7 +16,6 @@ SUBDIR= ${_binutils} \
|
||||
patch \
|
||||
${_rcs} \
|
||||
sdiff \
|
||||
send-pr \
|
||||
sort \
|
||||
${_texinfo}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ bfdver.h: Makefile
|
||||
echo '#define BFD_VERSION 217500000' > ${.TARGET}
|
||||
echo '#define BFD_VERSION_DATE 20070703' >> ${.TARGET}
|
||||
echo '#define BFD_VERSION_STRING ${VERSION}' >> ${.TARGET}
|
||||
echo '#define REPORT_BUGS_TO "<http://www.freebsd.org/send-pr.html>"' >> ${.TARGET}
|
||||
echo '#define REPORT_BUGS_TO "<http://www.freebsd.org/support.html>"' >> ${.TARGET}
|
||||
|
||||
targmatch.h: targmatch.sed config.bfd
|
||||
sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}
|
||||
|
||||
@@ -1,339 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
he GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
@@ -1,35 +0,0 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Makefile for building a standalone send-pr.
|
||||
#
|
||||
|
||||
SCRIPTS= send-pr
|
||||
MAN= send-pr.1
|
||||
SUBMITTERS= current-users
|
||||
RELEASE= `uname -rsm`
|
||||
CLEANFILES+= send-pr send-pr.el
|
||||
|
||||
SUBDIR+= doc
|
||||
|
||||
LINKS= ${BINDIR}/send-pr ${BINDIR}/sendbug
|
||||
MLINKS= send-pr.1 sendbug.1
|
||||
|
||||
send-pr: send-pr.sh Makefile
|
||||
sed -e 's,@DATADIR@,/etc,g' \
|
||||
-e 's/@DEFAULT_RELEASE@/$(RELEASE)/g' \
|
||||
-e 's/^SUBMITTER=.*/SUBMITTER=$(SUBMITTERS)/' \
|
||||
${.ALLSRC:N*Makefile} > ${.TARGET}
|
||||
|
||||
send-pr.el: send-pr-el.in Makefile
|
||||
default_release=`uname -rsm`; \
|
||||
sed -e 's,@DATADIR@,/etc,g' \
|
||||
-e "s/@DEFAULT_RELEASE@/$${default_release}/g" \
|
||||
-e 's/"unknown"/"$(SUBMITTERS)"/g' \
|
||||
${.ALLSRC:N*Makefile} > ${.TARGET}
|
||||
|
||||
# called from /usr/src/etc/Makefile
|
||||
etc-gnats-freefall:
|
||||
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0644 \
|
||||
${.CURDIR}/categories ${DESTDIR}/etc/gnats/freefall
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -1,43 +0,0 @@
|
||||
send-pr - sends bug reports to a central support site
|
||||
|
||||
`send-pr' uses electronic mail to submit support questions and
|
||||
software bugs to a central site. No piece of software is perfect, and
|
||||
software organizations understand this `send-pr' is designed to allow
|
||||
users who have problems to submit reports of these problems to sites
|
||||
responsible for supporting the software in question, in a defined form
|
||||
which can be read by an electronically managed database.
|
||||
|
||||
`send-pr' is part of a suite of programs known collectively as GNATS,
|
||||
an acronym for Problem Report Management System. GNATS consists of
|
||||
several programs which, used in concert, formulate and partially
|
||||
administer a database of Problem Reports, or PRs, at a central support
|
||||
site. A PR goes through several states in its lifetime; GNATS tracks
|
||||
the PR and all information associated with it through each state and
|
||||
finally acts as an archive for PRs which have been resolved.
|
||||
|
||||
The same engine can be used to submit bugs to any number of support
|
||||
sites by setting up aliases for each of them; `send-pr' error-checks
|
||||
each PR as it is sent to be sure that the category specified matches a
|
||||
category supported by the site in question.
|
||||
|
||||
`send-pr' invokes an editor on a problem report template (after trying
|
||||
to fill in some fields with reasonable default values). When you exit
|
||||
the editor, `send-pr' sends the completed form to the support site.
|
||||
At the support site, the PR is assigned a unique number and is stored
|
||||
in the GNATS database according to its category and customer-id. GNATS
|
||||
automatically replies with an acknowledgement, citing the category and
|
||||
the PR number.
|
||||
|
||||
See the Texinfo file `send-pr.texi' or the Info file `send-pr.info'
|
||||
for detailed installation and usage information.
|
||||
|
||||
See the file MANIFEST for a list of the files which should have
|
||||
accompanied this distribution.
|
||||
|
||||
See `send-pr.texi', `send-pr.info', or the file INSTALL for the
|
||||
installation procedure for `send-pr'.
|
||||
|
||||
|
||||
Copyright (c) 1993, Free Software Foundation, Inc.
|
||||
See the file COPYING for copyright information concerning this
|
||||
distribution and all its components.
|
||||
@@ -1,21 +0,0 @@
|
||||
# $FreeBSD$
|
||||
advocacy
|
||||
alpha
|
||||
amd64
|
||||
arm
|
||||
bin
|
||||
conf
|
||||
docs
|
||||
gnu
|
||||
i386
|
||||
ia64
|
||||
java
|
||||
kern
|
||||
misc
|
||||
ports
|
||||
powerpc
|
||||
sparc64
|
||||
standards
|
||||
threads
|
||||
usb
|
||||
www
|
||||
@@ -1,4 +0,0 @@
|
||||
INFO = send-pr
|
||||
INFOSECTION="System Utilities"
|
||||
|
||||
.include <bsd.info.mk>
|
||||
@@ -1,125 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
@node Valid Categories
|
||||
@unnumberedsec Valid Categories
|
||||
@cindex valid categories
|
||||
@cindex example of a list of valid categories
|
||||
|
||||
@table @code
|
||||
@item bfd
|
||||
@sc{gnu} binary file descriptor library.
|
||||
|
||||
@item bifrabulator
|
||||
This one doesn't actually exist.
|
||||
|
||||
@item binutils
|
||||
@sc{gnu} utilities for binary files (@code{ar}, @code{nm}, @code{size}@dots{}).
|
||||
|
||||
@item bison
|
||||
@sc{gnu} parser generator.
|
||||
|
||||
@item byacc
|
||||
Free parser generator.
|
||||
|
||||
@item config
|
||||
Cygnus Solutions Software configuration and installation.
|
||||
|
||||
@item cvs
|
||||
Concurrent Version System.
|
||||
|
||||
@item diff
|
||||
@sc{gnu} @code{diff} program.
|
||||
|
||||
@item doc
|
||||
Documentation and manuals.
|
||||
|
||||
@item emacs
|
||||
@sc{gnu} Emacs editor and related functions.
|
||||
|
||||
@item flex
|
||||
@sc{gnu} lexical analyzer.
|
||||
|
||||
@item g++
|
||||
@sc{gnu} C++ compiler.
|
||||
|
||||
@item gas
|
||||
@sc{gnu} assembler.
|
||||
|
||||
@item gcc
|
||||
@sc{gnu} C compiler.
|
||||
|
||||
@item gdb
|
||||
@sc{gnu} source code debugger.
|
||||
|
||||
@item glob
|
||||
The filename globbing functions.
|
||||
|
||||
@item gprof
|
||||
@sc{gnu} profiler.
|
||||
|
||||
@item grep
|
||||
@sc{gnu} @code{grep} program.
|
||||
|
||||
@item info
|
||||
@sc{gnu} @code{info} hypertext reader.
|
||||
|
||||
@item ispell
|
||||
@sc{gnu} spelling checker.
|
||||
|
||||
@item kerberos
|
||||
Kerberos authentication system.
|
||||
|
||||
@item ld
|
||||
@sc{gnu} linker.
|
||||
|
||||
@item libc
|
||||
Cygnus Solutions C Support Library.
|
||||
|
||||
@item libg++
|
||||
@sc{gnu} C++ class library.
|
||||
|
||||
@item libiberty
|
||||
@sc{gnu} @samp{libiberty} library.
|
||||
|
||||
@item libm
|
||||
Cygnus Solutions C Math Library.
|
||||
|
||||
@item make
|
||||
@sc{gnu} @code{make} program.
|
||||
|
||||
@item makeinfo
|
||||
@sc{gnu} utility to build Info files from Texinfo documents.
|
||||
|
||||
@item mas
|
||||
@sc{gnu} Motorola syntax assembler.
|
||||
|
||||
@item newlib
|
||||
Cygnus Solutions C Support and Math Libraries.
|
||||
|
||||
@item patch
|
||||
@sc{gnu} bug patch program.
|
||||
|
||||
@item gnats
|
||||
@sc{gnu} Problem Report Management System.
|
||||
|
||||
@item rcs
|
||||
Revision Control System.
|
||||
|
||||
@item readline
|
||||
@sc{gnu} @code{readline} library.
|
||||
|
||||
@item send-pr
|
||||
@sc{gnu} Problem Report submitting program.
|
||||
|
||||
@item test
|
||||
Category to use when testing @code{send-pr}.
|
||||
|
||||
@item texindex
|
||||
@sc{gnu} documentation indexing utility.
|
||||
|
||||
@item texinfo
|
||||
@sc{gnu} documentation macros.
|
||||
|
||||
@item other
|
||||
Anything which is not covered by the above categories.
|
||||
@end table
|
||||
@@ -1,522 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
@node Fields
|
||||
@section Problem Report format
|
||||
@cindex Problem Report format
|
||||
@cindex format
|
||||
@cindex database similarities
|
||||
@cindex fields
|
||||
|
||||
The format of a PR is designed to reflect the nature of @sc{gnats} as a
|
||||
database. Information is arranged into @dfn{fields}, and kept in
|
||||
individual records (Problem Reports).
|
||||
|
||||
A Problem Report contains two different types of fields: @dfn{Mail
|
||||
Header} fields, which are used by the mail handler for delivery, and
|
||||
@dfn{Problem Report} fields, which contain information relevant to the
|
||||
Problem Report and its submitter. A Problem Report is essentially a
|
||||
specially formatted electronic mail message.
|
||||
|
||||
Problem Report fields are denoted by a keyword which begins with
|
||||
@samp{>} and ends with @samp{:}, as in @samp{>Confidential:}. Fields
|
||||
belong to one of three data types:
|
||||
|
||||
@table @asis
|
||||
@cindex Problem Report data types
|
||||
@cindex @emph{Enumerated} data types
|
||||
@item @sc{Enumerated}
|
||||
One of a specific set of values, which vary according to the field. The
|
||||
value for each keyword must be on the same line as the keyword. These
|
||||
values are not configurable (yet).
|
||||
|
||||
@ifset SENDPR
|
||||
For each @sc{Enumerated} keyword, the possible choices are listed in the
|
||||
@code{send-pr} template as a comment.
|
||||
@end ifset
|
||||
The following fields are @sc{Enumerated} format; see the descriptions of
|
||||
fields below for explanations of each field in detail:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
>Confidential: >Severity: >Priority:
|
||||
>Class: >State: >Number:
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@cindex @emph{Text} data types
|
||||
@item @sc{Text}
|
||||
One single line of text which must begin and end on the same line (i.e.,
|
||||
before a newline) as the keyword. See the descriptions of fields below
|
||||
for explanations of each field in detail. The following fields are
|
||||
@sc{Text} format:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
>Submitter-Id: >Originator: >Synopsis:
|
||||
>Category: >Release: >Responsible:
|
||||
>Arrival-Date:
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@cindex @emph{MultiText} data types
|
||||
@item @sc{MultiText}
|
||||
Text of any length may occur in this field. @sc{MultiText} may span
|
||||
multiple lines and may also include blank lines. A @sc{MultiText} field
|
||||
ends only when another keyword appears. See the descriptions of fields
|
||||
below for explanations of each field in detail.
|
||||
|
||||
The following fields are @sc{MultiText} format:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
>Organization: >Environment: >Description:
|
||||
>How-To-Repeat: >Fix: >Audit-Trail:
|
||||
>Unformatted:
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@end table
|
||||
|
||||
@ifclear SENDPR
|
||||
@subheading Example Problem Report
|
||||
@end ifclear
|
||||
|
||||
The following is an example Problem Report. Mail headers are at the
|
||||
top, followed by @sc{gnats} fields, which begin with @samp{>} and end
|
||||
with @samp{:}. The @samp{Subject:} line in the mail header and the
|
||||
@samp{>Synopsis:} field are usually duplicates of each other.
|
||||
|
||||
@cindex sample Problem Report
|
||||
@cindex example Problem Report
|
||||
@cindex Problem Report template
|
||||
@cartouche
|
||||
@smallexample
|
||||
@group
|
||||
Message-Id: @var{message-id}
|
||||
Date: @var{date}
|
||||
From: @var{address}
|
||||
Reply-To: @var{address}
|
||||
To: @var{bug-address}
|
||||
Subject: @var{subject}
|
||||
|
||||
>Number: @var{gnats-id}
|
||||
>Category: @var{category}
|
||||
>Synopsis: @var{synopsis}
|
||||
>Confidential: yes @emph{or} no
|
||||
>Severity: critical, serious, @emph{or} non-critical
|
||||
>Priority: high, medium @emph{or} low
|
||||
>Responsible: @var{responsible}
|
||||
>State: open, analyzed, suspended, feedback, @emph{or} closed
|
||||
>Class: sw-bug, doc-bug, change-request, support,
|
||||
@ifset SENDPR
|
||||
@emph{or} duplicate
|
||||
@end ifset
|
||||
@ifclear SENDPR
|
||||
duplicate, @emph{or} mistaken
|
||||
@end ifclear
|
||||
>Submitter-Id: @var{submitter-id}
|
||||
>Arrival-Date: @var{date}
|
||||
>Originator: @var{name}
|
||||
>Organization: @var{organization}
|
||||
>Release: @var{release}
|
||||
>Environment:
|
||||
@var{environment}
|
||||
>Description:
|
||||
@var{description}
|
||||
>How-To-Repeat:
|
||||
@var{how-to-repeat}
|
||||
>Fix:
|
||||
@var{fix}
|
||||
>Audit-Trail:
|
||||
@var{appended-messages@dots{}}
|
||||
State-Changed-From-To: @var{from}-@var{to}
|
||||
State-Changed-When: @var{date}
|
||||
State-Changed-Why:
|
||||
@var{reason}
|
||||
Responsible-Changed-From-To: @var{from}-@var{to}
|
||||
Responsible-Changed-When: @var{date}
|
||||
Responsible-Changed-Why:
|
||||
@var{reason}
|
||||
>Unformatted:
|
||||
@var{miscellaneous}
|
||||
@end group
|
||||
@end smallexample
|
||||
@end cartouche
|
||||
|
||||
@menu
|
||||
* Mail header fields::
|
||||
* Problem Report fields::
|
||||
@end menu
|
||||
|
||||
@c ----------------------
|
||||
@node Mail header fields
|
||||
@subsection Mail header fields
|
||||
@cindex mail header fields
|
||||
@cindex Internet standard RFC-822
|
||||
|
||||
A Problem Report may contain any mail header field described in the
|
||||
Internet standard RFC-822. However, only the fields which identify the
|
||||
sender and the subject are required by @code{send-pr}:
|
||||
|
||||
@table @code
|
||||
@cindex @code{To:} header
|
||||
@item To:
|
||||
The preconfigured mail address for the Support Site where the PR is to
|
||||
be sent, automatically supplied by @code{send-pr}.
|
||||
|
||||
@cindex @code{Subject:} header
|
||||
@item Subject:
|
||||
A terse description of the problem. This field normally contains the
|
||||
same information as the @samp{>Synopsis:} field.
|
||||
|
||||
@cindex @code{From:} header
|
||||
@item From:
|
||||
Usually supplied automatically by the originator's mailer; should
|
||||
contain the originator's electronic mail address.
|
||||
|
||||
@cindex @code{Reply-To:} header
|
||||
@item Reply-To:
|
||||
A return address to which electronic replies can be sent; in most cases,
|
||||
the same address as the @code{From:} field.
|
||||
@end table
|
||||
|
||||
@ifclear SENDPR
|
||||
@cindex @code{Received-By:} headers
|
||||
One of the configurable options for @sc{gnats} is whether or not to
|
||||
retain @w{@samp{Received-By:}} headers, which often consume a lot of
|
||||
space and are not often used. @xref{Local configuration,,Changing your
|
||||
local configuration}.
|
||||
@end ifclear
|
||||
|
||||
@c ----------------------
|
||||
@node Problem Report fields
|
||||
@subsection Problem Report fields
|
||||
@cindex GNATS database fields
|
||||
@cindex field format
|
||||
|
||||
@c FIXME - this node is loooooooooooooooong...
|
||||
|
||||
@subheading Field descriptions
|
||||
|
||||
The following fields are present whenever a PR is submitted via the
|
||||
program @code{send-pr}. @sc{gnats} adds additional fields when the PR
|
||||
arrives at the Support Site; explanations of them follow this list.
|
||||
|
||||
@cindex fields - list
|
||||
@cindex GNATS fields - list
|
||||
@table @code
|
||||
@cindex @code{Submitter-Id} field
|
||||
@cindex @code{>Submitter-Id:}
|
||||
@item >Submitter-Id:
|
||||
(@sc{Text}) A unique identification code assigned by the Support Site.
|
||||
It is used to identify all Problem Reports coming from a particular
|
||||
site. (Submitters without a value for this field can invoke
|
||||
@code{send-pr} with the @samp{--request-id} option to apply for one from
|
||||
the support organization. Problem Reports from those not affiliated
|
||||
with the support organization should use the default value of @samp{net}
|
||||
for this field.)
|
||||
|
||||
@cindex @code{Originator} field
|
||||
@cindex @code{>Originator:}
|
||||
@item >Originator:
|
||||
(@sc{Text}) Originator's real name. The default is the value of the
|
||||
originator's environment variable @code{NAME}.
|
||||
|
||||
@cindex @code{>Organization:}
|
||||
@cindex @code{Organization} field
|
||||
@item >Organization:
|
||||
(@sc{MultiText}) The originator's organization. The default value is
|
||||
set with the variable @w{@code{DEFAULT_ORGANIZATION}} in the
|
||||
@ifclear SENDPR
|
||||
@file{config} file (@pxref{config file,,The @code{config} file}).
|
||||
@end ifclear
|
||||
@ifset SENDPR
|
||||
@code{send-pr} shell script.
|
||||
@end ifset
|
||||
|
||||
@cindex @code{Confidential} field
|
||||
@cindex @code{>Confidential:}
|
||||
@cindex confidentiality in PRs
|
||||
@cindex PR confidentiality
|
||||
@item >Confidential:
|
||||
(@sc{Enumerated}) Use of this field depends on the originator's
|
||||
relationship with the support organization; contractual agreements often
|
||||
have provisions for preserving confidentiality. Conversely, a lack of a
|
||||
contract often means that any data provided will not be considered
|
||||
confidential. Submitters should be advised to contact the support
|
||||
organization directly if this is an issue.
|
||||
|
||||
If the originator's relationship to the support organization provides
|
||||
for confidentiality, then if the value of this field is @samp{yes} the
|
||||
support organization treats the PR as confidential; any code samples
|
||||
provided are not made publicly available (e.g., in regression test
|
||||
suites). The default value is @samp{no}.
|
||||
|
||||
@cindex @code{Synopsis} field
|
||||
@cindex @code{>Synopsis:}
|
||||
@item >Synopsis:
|
||||
(@sc{Text}) One-line summary of the problem. @w{@code{send-pr}} copies
|
||||
this information to the @samp{Subject:} line when you submit a Problem
|
||||
Report.
|
||||
|
||||
@cindex @code{Severity} field
|
||||
@cindex @code{>Severity:}
|
||||
@item >Severity:
|
||||
(@sc{Enumerated}) The severity of the problem. Accepted values include:
|
||||
|
||||
@table @code
|
||||
@cindex @emph{critical} severity problems
|
||||
@item critical
|
||||
The product, component or concept is completely non-operational or some
|
||||
essential functionality is missing. No workaround is known.
|
||||
|
||||
@cindex @emph{serious} severity problems
|
||||
@item serious
|
||||
The product, component or concept is not working properly or significant
|
||||
functionality is missing. Problems that would otherwise be considered
|
||||
@samp{critical} are rated @samp{serious} when a workaround is known.
|
||||
|
||||
@cindex @emph{non-critical} severity problems
|
||||
@item non-critical
|
||||
The product, component or concept is working in general, but lacks
|
||||
features, has irritating behavior, does something wrong, or doesn't
|
||||
match its documentation.
|
||||
@end table
|
||||
@noindent
|
||||
The default value is @samp{serious}.
|
||||
@sp 1
|
||||
|
||||
@cindex @code{Priority} field
|
||||
@cindex @code{>Priority:}
|
||||
@item >Priority:
|
||||
(@sc{Enumerated}) How soon the originator requires a solution. Accepted
|
||||
values include:
|
||||
|
||||
@table @code
|
||||
@cindex @emph{high} priority problems
|
||||
@item high
|
||||
A solution is needed as soon as possible.
|
||||
|
||||
@cindex @emph{medium} priority problems
|
||||
@item medium
|
||||
The problem should be solved in the next release.
|
||||
|
||||
@cindex @emph{low} priority problems
|
||||
@item low
|
||||
The problem should be solved in a future release.
|
||||
@end table
|
||||
@noindent
|
||||
The default value is @samp{medium}.
|
||||
@sp 1
|
||||
|
||||
@cindex @code{Category} field
|
||||
@cindex @code{>Category:}
|
||||
@item >Category:
|
||||
(@sc{Text}) The name of the product, component or concept where
|
||||
the problem lies. The values for this field are defined by the Support
|
||||
Site.
|
||||
@ifclear SENDPR
|
||||
@xref{categories file,,The @code{categories} file}, for details.
|
||||
@end ifclear
|
||||
|
||||
@cindex @code{Class} field
|
||||
@cindex @code{>Class:}
|
||||
@item >Class:
|
||||
(@sc{Enumerated}) The class of a problem can be one of the following:
|
||||
|
||||
@table @code
|
||||
@cindex @emph{sw-bug} class
|
||||
@item sw-bug
|
||||
A general product problem. (@samp{sw} stands for ``software''.)
|
||||
|
||||
@cindex @emph{doc-bug} class
|
||||
@item doc-bug
|
||||
A problem with the documentation.
|
||||
|
||||
@cindex @emph{change-request} class
|
||||
@item change-request
|
||||
A request for a change in behavior, etc.
|
||||
|
||||
@cindex @emph{support} class
|
||||
@item support
|
||||
A support problem or question.
|
||||
|
||||
@cindex @emph{duplicate} class
|
||||
@item duplicate (@var{pr-number})
|
||||
Duplicate PR. @var{pr-number} should be the number of the original PR.
|
||||
|
||||
@ifclear SENDPR
|
||||
@cindex @emph{mistaken} class
|
||||
@item mistaken
|
||||
No problem, user error or misunderstanding. This value is valid only at
|
||||
the Support Site.
|
||||
@end ifclear
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
The default is @samp{sw-bug}.
|
||||
@sp 1
|
||||
|
||||
@cindex @code{Release} field
|
||||
@cindex @code{>Release:}
|
||||
@item >Release:
|
||||
(@sc{Text}) Release or version number of the product, component or
|
||||
concept.
|
||||
|
||||
@cindex @code{Environment} field
|
||||
@cindex @code{>Environment:}
|
||||
@item >Environment:
|
||||
(@sc{MultiText}) Description of the environment where the problem occured:
|
||||
machine architecture, operating system, host and target types,
|
||||
libraries, pathnames, etc.
|
||||
|
||||
@cindex @code{Description} field
|
||||
@cindex @code{>Description:}
|
||||
@item >Description:
|
||||
(@sc{MultiText}) Precise description of the problem.
|
||||
|
||||
@cindex @code{How-To-Repeat} field
|
||||
@cindex @code{>How-To-Repeat:}
|
||||
@item >How-To-Repeat:
|
||||
(@sc{MultiText}) Example code, input, or activities to reproduce the
|
||||
problem. The support organization uses example code both to reproduce
|
||||
the problem and to test whether the problem is fixed. Include all
|
||||
preconditions, inputs, outputs, conditions after the problem, and
|
||||
symptoms. Any additional important information should be included.
|
||||
Include all the details that would be necessary for someone else to
|
||||
recreate the problem reported, however obvious. Sometimes seemingly
|
||||
arbitrary or obvious information can point the way toward a solution.
|
||||
See also @ref{Helpful hints,,Helpful hints}.
|
||||
|
||||
@cindex @code{Fix} field
|
||||
@cindex @code{>Fix:}
|
||||
@item >Fix:
|
||||
(@sc{MultiText}) A description of a solution to the problem, or a patch
|
||||
which solves the problem. (This field is most often filled in at the
|
||||
Support Site; we provide it to the submitter in case she has solved the
|
||||
problem.)
|
||||
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
@sc{gnats} adds the following fields when the PR arrives at the Support
|
||||
Site:
|
||||
|
||||
@table @code
|
||||
@cindex @code{Number} field
|
||||
@cindex @code{>Number:}
|
||||
@item >Number:
|
||||
(@sc{Enumerated}) The incremental identification number for this PR.
|
||||
@ifclear SENDPR
|
||||
This is included in the automated reply to the submitter (if that
|
||||
feature of @sc{gnats} is activated; @pxref{Local configuration,,Changing
|
||||
your local configuration}). It is also included in the copy of the PR
|
||||
that is sent to the maintainer.
|
||||
@end ifclear
|
||||
|
||||
The @samp{>Number:} field is often paired with the @samp{>Category:}
|
||||
field as
|
||||
|
||||
@smallexample
|
||||
@var{category}/@var{number}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
in subsequent email messages. This is for historical reasons, as well
|
||||
as because Problem Reports are stored in subdirectories which are named
|
||||
by category.
|
||||
|
||||
@cindex @code{State} field
|
||||
@cindex @code{>State:}
|
||||
@item >State:
|
||||
(@sc{Enumerated}) The current state of the PR. Accepted values are:
|
||||
|
||||
@table @code
|
||||
@item open
|
||||
The PR has been filed and the responsible person notified.
|
||||
|
||||
@item analyzed
|
||||
The responsible person has analyzed the problem.
|
||||
|
||||
@item feedback
|
||||
The problem has been solved, and the originator has been given a patch
|
||||
or other fix.
|
||||
|
||||
@item closed
|
||||
The changes have been integrated, documented, and tested, and the
|
||||
originator has confirmed that the solution works.
|
||||
|
||||
@item suspended
|
||||
Work on the problem has been postponed.
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
The initial state of a PR is @samp{open}. @xref{States,,States of
|
||||
Problem Reports}.
|
||||
|
||||
@cindex @code{Responsible} field
|
||||
@cindex @code{>Responsible:}
|
||||
@item >Responsible:
|
||||
(@sc{Text}) The person responsible for this category.
|
||||
@ifclear SENDPR
|
||||
@sc{gnats} retrieves this information from the @file{categories} file
|
||||
(@pxref{categories file,,The @code{categories} file}).
|
||||
@end ifclear
|
||||
|
||||
@cindex @code{>Arrival-Date:}
|
||||
@cindex @code{Arrival-Date} field
|
||||
@item >Arrival-Date:
|
||||
(@sc{Text}) The time that this PR was received by @sc{gnats}. The date
|
||||
is provided automatically by @sc{gnats}.
|
||||
|
||||
@cindex @code{>Audit-Trail:}
|
||||
@cindex @code{Audit-Trail} field
|
||||
@item >Audit-Trail:
|
||||
(@sc{MultiText}) Tracks related electronic mail as well as changes in
|
||||
the @samp{>State:} and @samp{>Responsible:} fields with the sub-fields:
|
||||
|
||||
@table @code
|
||||
@cindex @code{State-Changed-<From>-<To>:} in @code{>Audit-Trail:}
|
||||
@item @w{State-Changed-<From>-<To>: @var{oldstate}>-<@var{newstate}}
|
||||
The old and new @samp{>State:} field values.
|
||||
|
||||
@cindex @code{Responsible-Changed-<From>-<To>:} in @code{>Audit-Trail:}
|
||||
@item @w{Responsible-Changed-<From>-<To>: @var{oldresp}>-<@var{newresp}}
|
||||
The old and new @samp{>Responsible:} field values.
|
||||
|
||||
@cindex @code{State-Changed-By:} in @code{>Audit-Trail:}
|
||||
@cindex @code{Responsible-Changed-By:} in @code{>Audit-Trail:}
|
||||
@item State-Changed-By: @var{name}
|
||||
@itemx Responsible-Changed-By: @var{name}
|
||||
The name of the maintainer who effected the change.
|
||||
|
||||
@cindex @code{State-Changed-When:} in @code{>Audit-Trail:}
|
||||
@cindex @code{Responsible-Changed-When:} in @code{>Audit-Trail:}
|
||||
@item State-Changed-When: @var{timestamp}
|
||||
@itemx Responsible-Changed-When: @var{timestamp}
|
||||
The time the change was made.
|
||||
|
||||
@cindex @code{State-Changed-Why:} in @code{>Audit-Trail:}
|
||||
@cindex @code{Responsible-Changed-Why:} in @code{>Audit-Trail:}
|
||||
@item State-Changed-Why: @var{reason@dots{}}
|
||||
@itemx Responsible-Changed-Why: @var{reason@dots{}}
|
||||
The reason for the change.
|
||||
@end table
|
||||
|
||||
@cindex subsequent mail
|
||||
@cindex other mail
|
||||
@cindex appending PRs
|
||||
@cindex saving related mail
|
||||
@cindex related mail
|
||||
@noindent
|
||||
The @samp{>Audit-Trail:} field also contains any mail messages received
|
||||
by @sc{gnats} related to this PR, in the order received.
|
||||
|
||||
@cindex @code{>Unformatted:}
|
||||
@cindex @code{Unformatted} field
|
||||
@item
|
||||
>Unformatted:
|
||||
(@sc{MultiText}) Any random text found outside the fields in the
|
||||
original Problem Report.
|
||||
@end table
|
||||
|
||||
@@ -1,570 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
@c This is the usage section for send-pr. It is called as
|
||||
@c chapter (Invoking send-pr) by send-pr.texi, and also as
|
||||
@c section (Submitting Problem Reports) by gnats.texi (chapter/section
|
||||
@c identifiers are adjusted accordingly)
|
||||
|
||||
@c FIXME! This still seems jumbled...
|
||||
|
||||
You can invoke @code{send-pr} from a shell prompt, or from within
|
||||
@sc{gnu} Emacs using @w{@samp{M-x send-pr}}.
|
||||
|
||||
@menu
|
||||
* using send-pr:: Creating new Problem Reports
|
||||
* send-pr in Emacs:: Using send-pr from within Emacs
|
||||
* send-pr from the shell:: Invoking send-pr from the shell
|
||||
* Submitting via e-mail:: Submitting a Problem Report via direct e-mail
|
||||
* Helpful hints::
|
||||
@end menu
|
||||
|
||||
@node using send-pr
|
||||
@section Creating new Problem Reports
|
||||
|
||||
@c FIXME - this is a long node
|
||||
Invoking @code{send-pr} presents a PR @dfn{template} with a number of
|
||||
fields already filled in. Complete the template as thoroughly as
|
||||
possible to make a useful bug report. Submit only one bug with each PR.
|
||||
|
||||
@cindex template
|
||||
A template consists of three sections:
|
||||
|
||||
@table @dfn
|
||||
@item Comments
|
||||
The top several lines of a blank template consist of a series of
|
||||
comments that provide some basic instructions for completing the Problem
|
||||
Report, as well as a list of valid entries for the @samp{>Category:}
|
||||
field. These comments are all preceded by the string @samp{SEND-PR:}
|
||||
and are erased automatically when the PR is submitted. The
|
||||
instructional comments within @samp{<} and @samp{>} are also removed.
|
||||
(Only these comments are removed; lines you provide that happen to have
|
||||
those characters in them, such as examples of shell-level redirection,
|
||||
are not affected.)
|
||||
|
||||
@item Mail Header
|
||||
@code{send-pr} creates a standard mail header. @code{send-pr} completes
|
||||
all fields except the @samp{Subject:} line with default values.
|
||||
(@xref{Fields,,Problem Report format}.)
|
||||
|
||||
@item @sc{gnats} fields
|
||||
These are the informational fields that @sc{gnats} uses to route your
|
||||
Problem Report to the responsible party for further action. They should
|
||||
be filled out as completely as possible. (@xref{Fields,,Problem Report
|
||||
format}. Also see @ref{Helpful hints,,Helpful hints}.)
|
||||
@end table
|
||||
|
||||
@ifset SENDPR
|
||||
@noindent
|
||||
For examples of a Problem Report template and complete Problem Report,
|
||||
see @ref{An Example}.
|
||||
@end ifset
|
||||
|
||||
The default template contains your preconfigured @samp{>Submitter-Id:}.
|
||||
@code{send-pr} attempts to determine values for the @samp{>Originator:}
|
||||
and @samp{>Organization:} fields (@pxref{Fields,,Problem Report
|
||||
format}). @code{send-pr} will set the @samp{>Originator:} field to
|
||||
the value of the @code{NAME} environment variable if it has been set;
|
||||
similarly, @samp{>Organization:} will be set to the value of @code{ORGANIZATION}.
|
||||
@code{send-pr} also attempts to find out some information
|
||||
about your system and architecture, and places this information in the
|
||||
@samp{>Environment:} field if it finds any.
|
||||
|
||||
You may submit problem reports to different Support Sites from the
|
||||
default site by specifying the alternate site when you invoke
|
||||
@code{send-pr}. @xref{send-pr from the shell}.
|
||||
Each @code{site} has its own list of categories for
|
||||
which it accepts Problem Reports.
|
||||
@c FIXME! This should go in..
|
||||
@c For a list of sites to whom @code{send-pr} is configured to send
|
||||
@c Problem Reports, type @w{@samp{send-pr -S}}.
|
||||
@ifset SENDPR
|
||||
(@xref{default site,,Setting a default @var{site}}.)
|
||||
@end ifset
|
||||
|
||||
@code{send-pr} also provides the mail header section of the template
|
||||
with default values in the @samp{To:}, @samp{From:}, and
|
||||
@samp{Reply-To:} fields. The @samp{Subject:} field is empty.
|
||||
|
||||
The template begins with a comment section:
|
||||
|
||||
@cindex template comment section
|
||||
@cindex comment section in the PR template
|
||||
@smallexample
|
||||
@group
|
||||
SEND-PR: -*- send-pr -*-
|
||||
SEND-PR: Lines starting with `SEND-PR' will be removed
|
||||
SEND-PR: automatically as well as all comments (the text
|
||||
SEND-PR: below enclosed in `<' and `>').
|
||||
SEND-PR:
|
||||
SEND-PR: Please consult the document `Reporting Problems
|
||||
SEND-PR: Using send-pr' if you are not sure how to fill out
|
||||
SEND-PR: a problem report.
|
||||
SEND-PR:
|
||||
SEND-PR: Choose from the following categories:
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
and also contains a list of valid @code{>Category:} values for the
|
||||
Support Site to whom you are submitting this Problem Report. One (and
|
||||
only one) of these values should be placed in the @code{>Category:}
|
||||
field.
|
||||
@ifset SENDPR
|
||||
A complete sample bug report, from template to completed PR, is shown in
|
||||
@ref{An Example}. For a complete list of valid categories, type
|
||||
@w{@samp{send-pr -L}} at your prompt. @xref{Valid Categories,,Valid
|
||||
Categories}, for a sample list of categories, .
|
||||
@end ifset
|
||||
|
||||
@c FIXME.. this sounds awkward
|
||||
The mail header is just below the comment section. Fill out the
|
||||
@samp{Subject:} field, if it is not already completed using the value of
|
||||
@samp{>Synopsis:}. The other mail header fields contain default values.
|
||||
|
||||
@cindex mail header section
|
||||
@smallexample
|
||||
@group
|
||||
To: @var{support-site}
|
||||
Subject: @emph{complete this field}
|
||||
From: @var{your-login}@@@var{your-site}
|
||||
Reply-To: @var{your-login}@@@var{your-site}
|
||||
X-send-pr-version: send-pr @value{VERSION}
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
where @var{support-site} is an alias on your local machine for the
|
||||
Support Site you wish to submit this PR to.
|
||||
|
||||
The rest of the template contains @sc{gnats} fields. Each field is
|
||||
either automatically completed with valid information (such as your
|
||||
@samp{>Submitter-Id:}) or contains a one-line instruction specifying the
|
||||
information that field requires in order to be correct. For example,
|
||||
the @samp{>Confidential:} field expects a value of @samp{yes} or
|
||||
@samp{no}, and the answer must fit on one line; similarly, the
|
||||
@samp{>Synopsis:} field expects a short synopsis of the problem, which
|
||||
must also fit on one line. Fill out the fields as completely as
|
||||
possible. @xref{Helpful hints,,Helpful hints}, for suggestions as to
|
||||
what kinds of information to include.
|
||||
|
||||
In this example, words in @emph{italics} are filled in with
|
||||
pre-configured information:
|
||||
|
||||
@cindex @code{send-pr} fields
|
||||
@smallexample
|
||||
@group
|
||||
>Submitter-Id: @emph{your submitter-id}
|
||||
>Originator: @emph{your name here}
|
||||
>Organization:
|
||||
@emph{your organization}
|
||||
>Confidential:<[ yes | no ] (one line)>
|
||||
>Synopsis: <synopsis of the problem (one line)>
|
||||
>Severity: <[non-critical | serious | critical](one line)>
|
||||
>Priority: <[ low | medium | high ] (one line)>
|
||||
>Category: <name of the product (one line)>
|
||||
>Class: <[sw-bug | doc-bug | change-request | support]>
|
||||
>Release: <release number (one line)>
|
||||
>Environment:
|
||||
<machine, os, target, libraries (multiple lines)>
|
||||
|
||||
>Description:
|
||||
<precise description of the problem (multiple lines)>
|
||||
>How-To-Repeat:
|
||||
<code/input/activities to reproduce (multiple lines)>
|
||||
>Fix:
|
||||
<how to correct or work around the problem, if known
|
||||
(multiple lines)>
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@cindex @code{Submitter-Id} field
|
||||
@cindex @code{>Submitter-Id:}
|
||||
When you finish editing the Problem Report, @code{send-pr} mails it to
|
||||
the address named in the @samp{To:} field in the mail header.
|
||||
@code{send-pr} checks that the complete form contains a valid
|
||||
@samp{>Category:}.
|
||||
|
||||
@ifset SENDPR
|
||||
Your copy of @code{send-pr} should have already been customized on
|
||||
installation to reflect your @samp{>Submitter-Id:}. (@xref{Installing
|
||||
send-pr, , Installing @code{send-pr} on your system}.) If you don't
|
||||
know your @samp{>Submitter-Id:}, you can request it using
|
||||
@w{@samp{send-pr --request-id}}. If your organization is not affiliated
|
||||
with the site you send Problem Reports to, a good generic
|
||||
@samp{>Submitter-Id:} to use is @samp{net}. @emph{NOTE:} If you are using
|
||||
send-pr to send problem reports to the FreeBSD Project, this version of
|
||||
send-pr already has a customer ID in it and you do not need to request a
|
||||
new one.
|
||||
@end ifset
|
||||
|
||||
@cindex bad Problem Reports
|
||||
@cindex errors
|
||||
@cindex invalid Problem Reports
|
||||
If your PR has an invalid value in one of the @sc{Enumerated} fields
|
||||
(@pxref{Fields,,Problem Report format}), @code{send-pr} places the PR in
|
||||
a temporary file named @samp{/tmp/pbad@var{nnnn}} on your machine.
|
||||
@var{nnnn} is the process identification number given to your current
|
||||
@code{send-pr} session. If you are running @code{send-pr} from the
|
||||
shell, you are prompted as to whether or not you wish to try editing the
|
||||
same Problem Report again. If you are running @code{send-pr} from
|
||||
Emacs, the Problem Report is placed in the buffer
|
||||
@w{@samp{*send-pr-error*}}; you can edit this file and then submit it
|
||||
with
|
||||
|
||||
@smallexample
|
||||
M-x gnats-submit-pr
|
||||
@end smallexample
|
||||
|
||||
@cindex subsequent mail
|
||||
@cindex other mail
|
||||
@cindex appending PRs
|
||||
@cindex saving related mail
|
||||
@cindex related mail
|
||||
Any further mail concerning this Problem Report should be carbon-copied
|
||||
to the @sc{gnats} mailing address as well, with the category and
|
||||
identification number in the @samp{Subject:} line of the message.
|
||||
|
||||
@smallexample
|
||||
Subject: Re: PR @var{category}/@var{gnats-id}: @var{original message subject}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
Messages which arrive with @samp{Subject:} lines of this form are
|
||||
automatically appended to the Problem Report in the @samp{>Audit-Trail:}
|
||||
field in the order received.
|
||||
|
||||
@c ---------------------------------------------------------------
|
||||
@node send-pr in Emacs
|
||||
@section Using @code{send-pr} from within Emacs
|
||||
@cindex using @code{send-pr} from within Emacs
|
||||
@cindex @code{send-pr} within Emacs
|
||||
@cindex invoking @code{send-pr} from Emacs
|
||||
@cindex interactive interface
|
||||
|
||||
You can use an interactive @code{send-pr} interface from within @sc{gnu}
|
||||
Emacs to fill out your Problem Report. We recommend that you
|
||||
familiarize yourself with Emacs before using this feature
|
||||
(@pxref{Introduction,,Introduction,emacs,GNU Emacs}).
|
||||
|
||||
Call @code{send-pr} with @w{@samp{M-x send-pr}}.@footnote{If typing
|
||||
@w{@samp{M-x send-pr}} doesn't work, see your system administrator for
|
||||
help loading @code{send-pr} into Emacs.} @code{send-pr} responds with a
|
||||
Problem Report template preconfigured for the Support Site from which
|
||||
you received @code{send-pr}. (If you use @code{send-pr} locally, the
|
||||
default Support Site is probably your local site.)
|
||||
|
||||
You may also submit problem reports to different Support Sites from the
|
||||
default site. To use this feature, invoke @code{send-pr} with
|
||||
|
||||
@smallexample
|
||||
C-u M-x send-pr
|
||||
@end smallexample
|
||||
|
||||
@code{send-pr} prompts you for the name of a @var{site}. @var{site} is
|
||||
an alias on your local machine which points to an alternate Support
|
||||
Site.
|
||||
|
||||
@cindex Emacs
|
||||
@code{send-pr} displays the template and prompts you in the minibuffer
|
||||
with the line:
|
||||
@smallexample
|
||||
>Category: other
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
Delete the default value @samp{other} @emph{in the minibuffer} and
|
||||
replace it with the keyword corresponding to your problem (the list of
|
||||
valid categories is in the topmost section of the PR template). For
|
||||
example, if the problem you wish to report has to do with the @sc{gnu} C
|
||||
compiler, and your support organization accepts bugs submitted for this
|
||||
program under the category @samp{gcc}, delete @samp{other} and then type
|
||||
@w{@samp{gcc[@key{RET}]}}. @code{send-pr} replaces the line
|
||||
|
||||
@smallexample
|
||||
>Category: <name of the product (one line)>
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
in the template with
|
||||
|
||||
@smallexample
|
||||
>Category: gcc
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
and moves on to another field.
|
||||
|
||||
@cindex completion in Emacs
|
||||
@cindex name completion in Emacs
|
||||
@w{@code{send-pr}} provides name completion in the minibuffer. For
|
||||
instance, you can also type @w{@samp{gc[@key{TAB}]}}, and @code{send-pr}
|
||||
attempts to complete the entry for you. Typing @w{@samp{g[@key{TAB}]}}
|
||||
may not have the same effect if several possible entries begin with
|
||||
@samp{g}. In that case @code{send-pr} cannot complete the entry because
|
||||
it cannot determine whether you mean @samp{gcc} or, for example,
|
||||
@samp{gdb}, if both of those are possible categories.
|
||||
@w{@code{send-pr}} continues to prompt you for a valid entry until you
|
||||
enter one.
|
||||
|
||||
@w{@code{send-pr}} prompts you interactively to enter each field for
|
||||
which there is a range of specific choices. If you attempt to enter a
|
||||
value which is not in the range of acceptable entries, @code{send-pr}
|
||||
responds with @w{@samp{[No match]}} and allows you to change the entry
|
||||
until it contains an acceptable value. This avoids unusable information
|
||||
(at least in these fields) and also avoids typographical errors which
|
||||
could cause problems later.
|
||||
|
||||
@code{send-pr} prompts you for the following fields:
|
||||
|
||||
@c FIXME - should these go before the discussion on completion?
|
||||
@example
|
||||
@group
|
||||
>Category:
|
||||
>Confidential: (@emph{default}: no)
|
||||
>Severity: (@emph{default}: serious)
|
||||
>Priority: (@emph{default}: medium)
|
||||
>Class: (@emph{default}: sw-bug)
|
||||
>Release:
|
||||
>Synopsis: (@emph{this value is copied to @code{Subject:}})
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
After you complete these fields, @w{@code{send-pr}} places the cursor in
|
||||
the @samp{>Description:} field and displays the message
|
||||
|
||||
@smallexample
|
||||
To send the problem report use: C-c C-c
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
in the minibuffer. At this point, edit the file in the main buffer to
|
||||
reflect your specific problem, putting relevant information in the
|
||||
proper fields.
|
||||
@ifset SENDPR
|
||||
@xref{An Example}, for a sample Problem Report.
|
||||
@end ifset
|
||||
|
||||
@w{@samp{send-pr}} provides a few key bindings to make moving
|
||||
around in a template buffer more simple:
|
||||
|
||||
@table @code
|
||||
@item C-c C-f
|
||||
@itemx M-x change-field
|
||||
Changes the field under the cursor. @code{edit-pr} prompts you for a
|
||||
new value.
|
||||
|
||||
@item M-C-b
|
||||
@itemx M-x gnats-backward-field
|
||||
Moves the cursor to the beginning of the value of the current field.
|
||||
|
||||
@item M-C-f
|
||||
@itemx M-x gnats-forward-field
|
||||
Moves the cursor to the end of the value of the current field.
|
||||
|
||||
@item M-p
|
||||
@itemx M-x gnats-previous-field
|
||||
Moves the cursor back one field to the beginning of the value of the
|
||||
previous field.
|
||||
|
||||
@item M-n
|
||||
@itemx M-x gnats-next-field
|
||||
Moves the cursor forward one field to the beginning of the value of the
|
||||
next field.
|
||||
@end table
|
||||
|
||||
@code{send-pr} takes over again when you type @samp{C-c C-c} to send the
|
||||
message. @code{send-pr} reports any errors in a separate buffer, which
|
||||
remains in existence until you send the PR properly (or, of course,
|
||||
until you explicitly kill the buffer).
|
||||
|
||||
For detailed instructions on using Emacs, see
|
||||
@ref{Introduction,,,emacs,GNU Emacs}.
|
||||
|
||||
@node send-pr from the shell
|
||||
@section Invoking @code{send-pr} from the shell
|
||||
@cindex command line options
|
||||
@cindex invoking @code{send-pr} from the shell
|
||||
@cindex shell invocation
|
||||
|
||||
@c FIXME! Add [ -S ] right after [ -L ]...
|
||||
@smallexample
|
||||
send-pr [ @var{site} ]
|
||||
[ -f @var{problem-report} | --file @var{problem-report} ]
|
||||
[ -t @var{mail-address} | --to @var{mail-address} ]
|
||||
[ --request-id ]
|
||||
[ -L | --list ] [ -P | --print ]
|
||||
[ -V | --version] [ -h | --help ]
|
||||
@end smallexample
|
||||
|
||||
@var{site} is an alias on your local machine which points to an address
|
||||
used by a Support Site. If this argument is not present, the default
|
||||
@var{site} is usually the site which you received @code{send-pr} from,
|
||||
or your local site if you use @sc{gnats} locally.
|
||||
@ifset SENDPR
|
||||
(@xref{default site,,Setting a default @var{site}}.)
|
||||
@end ifset
|
||||
|
||||
Invoking @code{send-pr} with no options calls the editor named in your
|
||||
environment variable @code{EDITOR} on a default PR template. If the
|
||||
environment variable @code{PR_FORM} is set, its value is used as a file
|
||||
name which contains a valid template. If @code{PR_FORM} points to a
|
||||
missing or unreadable file, or if the file is empty, @code{send-pr}
|
||||
generates an error message and opens the editor on a default template.
|
||||
|
||||
@table @code
|
||||
@item -f @var{problem-report}
|
||||
@itemx --file @var{problem-report}
|
||||
Specifies a file, @var{problem-report}, where a completed Problem Report
|
||||
already exists. @code{send-pr} sends the contents of the file without
|
||||
invoking an editor. If @var{problem-report} is @samp{-},
|
||||
@w{@code{send-pr}} reads from standard input.
|
||||
|
||||
@item -t @var{mail-address}
|
||||
@itemx --to @var{mail-address}
|
||||
Sends the PR to @var{mail-address}. The default is preset when
|
||||
@code{send-pr} is configured. @emph{This option is not recommended};
|
||||
instead, use the argument @var{site} on the command line.
|
||||
|
||||
@item -c @var{mail-address}
|
||||
@itemx --cc @var{mail-address}
|
||||
Places @var{mail-address} in the @code{Cc:} header field of the message
|
||||
to be sent.
|
||||
|
||||
@item --request-id
|
||||
Sends a request for a @code{>Submitter-Id:} to the Support Site.
|
||||
|
||||
@cindex listing valid categories
|
||||
@item -L
|
||||
@itemx --list
|
||||
Prints the list of valid @code{>Category:} values on standard output.
|
||||
No mail is sent.
|
||||
|
||||
@item -s @var{severity}
|
||||
@itemx --severity @var{severity}
|
||||
@cindex @code{send-pr} fields
|
||||
Sets the initial value of the @code{>Severity:} field to @var{severity}.
|
||||
|
||||
@ignore
|
||||
@item -S
|
||||
@itemx --sites
|
||||
Displays a list of valid @var{site} values on standard output. No mail
|
||||
is sent.
|
||||
@end ignore
|
||||
|
||||
@item -P
|
||||
@itemx --print
|
||||
Displays the PR template. If the variable @code{PR_FORM} is set in your
|
||||
environment, the file it specifies is printed. If @code{PR_FORM} is not
|
||||
set, @code{send-pr} prints the standard blank form. If the file
|
||||
specified by @code{PR_FORM} doesn't exist, @code{send-pr} displays an
|
||||
error message. No mail is sent.
|
||||
|
||||
@item -V
|
||||
@itemx --version
|
||||
Displays the @code{send-pr} version number and a usage summary. No mail
|
||||
is sent.
|
||||
|
||||
@item -h
|
||||
@itemx --help
|
||||
Displays a usage summary for @code{send-pr}. No mail is sent.
|
||||
@end table
|
||||
|
||||
@c -------------------------------------------------------------------------
|
||||
@node Submitting via e-mail
|
||||
@section Submitting a Problem Report via direct e-mail
|
||||
@cindex Direct e-mail
|
||||
@cindex Submitting a PR via e-mail
|
||||
In addition to using @code{send-pr}, there is another way to submit a problem
|
||||
report. You can simply send an e-mail message to the support site.
|
||||
|
||||
To do this, look at the address in the @samp{To:} field of the @code{send-pr}
|
||||
template. When you send unformatted e-mail to this address, @sc{gnats}
|
||||
processes the message as a new problem report, filling in as many fields from
|
||||
defaults as it can:
|
||||
|
||||
@table @code
|
||||
@item Synopsis
|
||||
The @samp{>Synopsis} field is filled in by the @samp{Subject:} header.
|
||||
|
||||
@item Submitter ID
|
||||
@sc{gnats} will try to derive the @samp{>Submitter} field from the address
|
||||
in the @samp{From:} header.
|
||||
|
||||
@item Description
|
||||
All of the text in the body of the e-mail message is put into the
|
||||
@samp{>Description} field. Each line of the text is indented by one space,
|
||||
indicating that it is "quoted text" from the sender.
|
||||
@end table
|
||||
|
||||
Other fields, such as category, version, severity, etc. are set to default
|
||||
values (if the @sc{gnats} administrator has set them).
|
||||
|
||||
@c --------------------------------------------------------------------------
|
||||
@node Helpful hints
|
||||
@section Helpful hints
|
||||
@cindex helpful hints
|
||||
@cindex Using and Porting @sc{gnu} CC
|
||||
@cindex effective problem reporting
|
||||
@cindex kinds of helpful information
|
||||
@cindex information to submit
|
||||
@cindex Report all the facts!
|
||||
|
||||
There is no orthodox standard for submitting effective bug reports,
|
||||
though you might do well to consult the section on submitting bugs for
|
||||
@sc{gnu} @code{gcc} in @ref{Bugs, , Reporting Bugs, gcc, Using and
|
||||
Porting GNU CC}, by Richard Stallman. This section contains
|
||||
instructions on what kinds of information to include and what kinds of
|
||||
mistakes to avoid.
|
||||
|
||||
In general, common sense (assuming such an animal exists) dictates the
|
||||
kind of information that would be most helpful in tracking down and
|
||||
resolving problems in software.
|
||||
@itemize @bullet
|
||||
@item
|
||||
Include anything @emph{you} would want to know if you were looking at
|
||||
the report from the other end. There's no need to include every minute
|
||||
detail about your environment, although anything that might be different
|
||||
from someone else's environment should be included (your path, for
|
||||
instance).
|
||||
|
||||
@item
|
||||
Narratives are often useful, given a certain degree of restraint. If a
|
||||
person responsible for a bug can see that A was executed, and then B and
|
||||
then C, knowing that sequence of events might trigger the realization of
|
||||
an intermediate step that was missing, or an extra step that might have
|
||||
changed the environment enough to cause a visible problem. Again,
|
||||
restraint is always in order (``I set the build running, went to get a
|
||||
cup of coffee (Columbian, cream but no sugar), talked to Sheila on the
|
||||
phone, and then THIS happened@dots{}'') but be sure to include anything
|
||||
relevant.
|
||||
|
||||
@item
|
||||
Richard Stallman writes, ``The fundamental principle of reporting bugs
|
||||
usefully is this: @strong{report all the facts}. If you are not sure
|
||||
whether to state a fact or leave it out, state it!'' This holds true
|
||||
across all problem reporting systems, for computer software or social
|
||||
injustice or motorcycle maintenance. It is especially important in the
|
||||
software field due to the major differences seemingly insignificant
|
||||
changes can make (a changed variable, a missing semicolon, etc.).
|
||||
|
||||
@item
|
||||
Submit only @emph{one} problem with each Problem Report. If you have
|
||||
multiple problems, use multiple PRs. This aids in tracking each problem
|
||||
and also in analyzing the problems associated with a given program.
|
||||
|
||||
@item
|
||||
It never hurts to do a little research to find out if the bug you've
|
||||
found has already been reported. Most software releases contain lists
|
||||
of known bugs in the Release Notes which come with the software; see
|
||||
your system administrator if you don't have a copy of these.
|
||||
|
||||
@item
|
||||
The more closely a PR adheres to the standard format, the less
|
||||
interaction is required by a database administrator to route the
|
||||
information to the proper place. Keep in mind that anything that
|
||||
requires human interaction also requires time that might be better spent
|
||||
in actually fixing the problem. It is therefore in everyone's best
|
||||
interest that the information contained in a PR be as correct as
|
||||
possible (in both format and content) at the time of submission.
|
||||
@end itemize
|
||||
@@ -1,658 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
\input texinfo @c -*-texinfo-*-
|
||||
@setfilename send-pr.info
|
||||
@settitle Reporting Problems Using send-pr
|
||||
|
||||
@setchapternewpage odd
|
||||
|
||||
@include version.texi
|
||||
@set SENDPR
|
||||
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* send-pr: (send-pr). Reporting problems--using send-pr
|
||||
END-INFO-DIR-ENTRY
|
||||
@end format
|
||||
@end ifinfo
|
||||
|
||||
@ifinfo
|
||||
Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
@ignore
|
||||
Permission is granted to process this file through TeX and print the
|
||||
results, provided the printed document carries a copying permission
|
||||
notice identical to this one except for the removal of this paragraph
|
||||
(this paragraph not being relevant to the printed manual).
|
||||
|
||||
@end ignore
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided also that
|
||||
the entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions.
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@finalout
|
||||
@title Reporting Problems
|
||||
@subtitle Using @code{send-pr}, version @value{VERSION}
|
||||
@subtitle October 1993
|
||||
@author Jeffrey M. Osier
|
||||
@author Cygnus Support
|
||||
@page
|
||||
|
||||
@vskip 0pt plus 1filll
|
||||
|
||||
Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided also that
|
||||
the entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions.
|
||||
|
||||
@end titlepage
|
||||
|
||||
@c ---------------------------------------------------------------
|
||||
@node Top
|
||||
@top Overview
|
||||
@cindex foreword to @code{send-pr}
|
||||
@cindex overview to @code{send-pr}
|
||||
@cindex introduction to @code{send-pr}
|
||||
|
||||
This manual documents @code{send-pr},
|
||||
@ifinfo
|
||||
version @value{VERSION},
|
||||
@end ifinfo
|
||||
which uses electronic mail to submit support questions and problem
|
||||
reports to a central Support Site. No body of work is perfect, and
|
||||
support organizations understand this; @code{send-pr} is designed to
|
||||
allow users who have problems to submit reports of these problems to
|
||||
sites responsible for supporting the products in question, in a defined
|
||||
form which can be read by an electronically managed database.
|
||||
|
||||
@cindex GNATS
|
||||
@code{send-pr} is part of a suite of programs known collectively as
|
||||
@sc{gnats}, the @sc{gnu} Problem Report Management System. @sc{gnats}
|
||||
consists of several programs which, used in concert, formulate and
|
||||
partially administer a database of @dfn{Problem Reports}, or @dfn{PRs},
|
||||
at a central Support Site. A PR goes through several states in its
|
||||
lifetime; @sc{gnats} tracks the PR and all information associated with it
|
||||
through each state and finally acts as an archive for PRs which have
|
||||
been @dfn{closed}.
|
||||
|
||||
Because @code{send-pr} exists as a shell (@file{/bin/sh}) script and as
|
||||
an Elisp file for use with @sc{gnu} Emacs, it can be used from any
|
||||
machine on your network which can run a shell script and/or Emacs.
|
||||
|
||||
In general, you can use any editor and mailer to submit valid Problem
|
||||
Reports, as long as the format required by @sc{gnats} is preserved.
|
||||
@code{send-pr} automates the process, however, and ensures that certain
|
||||
fields necessary for automatic processing are present. @code{send-pr}
|
||||
is strongly recommended for all initial problem-oriented correspondence
|
||||
with your Support Site. The organization you submit Problem Reports to
|
||||
supplies an address to which further information can be sent; the person
|
||||
responsible for the category of the problem you report contacts you
|
||||
directly.
|
||||
|
||||
@menu
|
||||
* send-pr in detail:: Details about send-pr and GNATS
|
||||
* Invoking send-pr:: Editing and sending PRs
|
||||
* An Example:: A working example
|
||||
* Installing send-pr:: Installing send-pr on your system
|
||||
* Index::
|
||||
@end menu
|
||||
|
||||
@node send-pr in detail
|
||||
@chapter Details about send-pr and GNATS
|
||||
|
||||
@cindex details about @code{send-pr}
|
||||
@cindex Problem Reports
|
||||
A @dfn{Problem Report} is a message that describes a problem you are
|
||||
having with a body of work. @code{send-pr} organizes this message into
|
||||
a form which can be understood and automatically processed by @sc{gnats},
|
||||
the @sc{gnu} Problem Report Management System. A Problem Report is
|
||||
organized into @dfn{fields} which contain data describing you, your
|
||||
organization, and the problem you are announcing (@pxref{Fields,,Problem
|
||||
Report format}). Problem Reports go through several defined states in
|
||||
their lifetimes, from @dfn{open} to @dfn{closed} (@pxref{States,,States
|
||||
of Problem Reports}).
|
||||
|
||||
@menu
|
||||
* States:: States of Problem Reports
|
||||
* Fields:: Problem Report format
|
||||
@end menu
|
||||
|
||||
@include states.texi
|
||||
|
||||
@include fields.texi
|
||||
|
||||
@node Invoking send-pr
|
||||
@chapter Editing and sending PRs
|
||||
@cindex editing and sending PRs
|
||||
@cindex sending PRs
|
||||
@cindex invoking send-pr
|
||||
@cindex using send-pr
|
||||
@cindex generating new PRs
|
||||
|
||||
@include s-usage.texi
|
||||
|
||||
@node An Example
|
||||
@chapter An Example
|
||||
@cindex an example
|
||||
@cindex example PR
|
||||
@cindex Cygnus Solutions
|
||||
@cindex @sc{gnu} software support
|
||||
Cygnus Solutions in Sunnyvale, CA, uses @sc{gnats} and @code{send-pr}
|
||||
extensively for their support activities. As a support company, Cygnus
|
||||
finds problem tracking to be a crucial part of everyday business.
|
||||
Cygnus supports the @sc{gnu} compiling tools (including @sc{gnats} and
|
||||
@code{send-pr}) over several many platforms
|
||||
|
||||
With each shipment of the Cygnus Solutions Developer's Kit, customers
|
||||
receive the latest version of @code{send-pr}, which contains an
|
||||
up-to-date listing of valid categories (values for the @code{>Category:}
|
||||
field). Using these tools, Cygnus' customers can communicate their
|
||||
problems to Cygnus effectively and receive automatic confirmation of
|
||||
receipt as well as notification of changes in the status of their
|
||||
reported problems. Much of Cygnus' support mechanism relies on
|
||||
electronic mail.
|
||||
|
||||
As an example, let's pretend we're a customer of Cygnus Solutions, and
|
||||
that we're having a problem compiling some of our software using the
|
||||
@sc{gnu} C compiler, which Cygnus supports.
|
||||
|
||||
Assume that we're getting an error in our @code{bifrabulator} program
|
||||
wherein the @samp{prestidigitation} routines don't match with the
|
||||
@samp{whatsitsname}. We've made sure we're following the rules of the
|
||||
program and checked the Release Notes from Cygnus and found that the bug
|
||||
isn't already known. In other words, we're pretty sure we've found a
|
||||
bug.
|
||||
|
||||
@cindex Imaginary Software, Ltd.
|
||||
Our first step is to call @code{send-pr}. It really doesn't matter
|
||||
whether we use @code{send-pr} from the shell or from within Emacs.
|
||||
Indeed, if we use Emacs as a primary editor, calling @code{send-pr} from
|
||||
the shell is likely to start @code{send-pr} in an Emacs buffer anyway.
|
||||
So, since our company, @emph{Imaginary Software, Ltd.}, uses @sc{gnu}
|
||||
software extensively, we're pretty familiar with Emacs, so from within
|
||||
Emacs we type
|
||||
@smallexample
|
||||
M-x send-pr
|
||||
@end smallexample
|
||||
@noindent
|
||||
and we're greeted with the following screen:
|
||||
|
||||
@cindex default PR template
|
||||
@cindex example of a default template
|
||||
@cindex blank PR template
|
||||
@cindex @code{bifrabulator}
|
||||
@cartouche
|
||||
@smallexample
|
||||
SEND-PR: -*- text -*-
|
||||
SEND-PR: Lines starting with `SEND-PR' will be removed
|
||||
SEND-PR: automatically as well as all comments (the text
|
||||
SEND-PR: below enclosed in `<' and `>').
|
||||
SEND-PR: Please consult the manual if you are not sure
|
||||
SEND-PR: how to fill out a problem report.
|
||||
SEND-PR:
|
||||
SEND-PR: Choose from the following categories:
|
||||
SEND-PR:
|
||||
SEND-PR: bfd binutils bison
|
||||
SEND-PR: byacc clib config cvs diff
|
||||
SEND-PR: doc emacs flex g++ gas
|
||||
SEND-PR: gcc gdb glob gprof grep
|
||||
SEND-PR: info ispell kerberos ld libg++
|
||||
SEND-PR: libiberty make makeinfo mas newlib
|
||||
SEND-PR: other patch rcs readline send-pr
|
||||
SEND-PR: test texindex texinfo texinfo.tex
|
||||
SEND-PR: bifrabulator <---@emph{note: this one is fake}
|
||||
SEND-PR:
|
||||
To: cygnus-bugs@@cygnus.com
|
||||
Subject:
|
||||
From: jeffrey@@imaginary.com
|
||||
Reply-To: jeffrey@@imaginary.com
|
||||
X-send-pr-version: send-pr @value{VERSION}
|
||||
|
||||
>Submitter-Id: imaginary
|
||||
>Originator: Jeffrey Osier
|
||||
>Organization:
|
||||
Imaginary Software, Ltd.
|
||||
>Confidential: <[ yes | no ] (one line)>
|
||||
>Synopsis: <synopsis of the problem (one line)>
|
||||
>Severity: <[ non-critical | serious | critical ] (one line)>
|
||||
>Priority: <[ low | medium | high ] (one line)>
|
||||
>Category: <name of the product (one line)>
|
||||
>Class: <[sw-bug|doc-bug|change-request|support](oneline)>
|
||||
>Release: <release number or tag (one line)>
|
||||
>Environment:
|
||||
<machine, os, target, libraries (multiple lines)>
|
||||
System: SunOS imaginary.com 4.1.1 1 sun4
|
||||
Architecture: sun4
|
||||
|
||||
>Description:
|
||||
<precise description of the problem (multiple lines)>
|
||||
>How-To-Repeat:
|
||||
<code/input/activities to reproduce (multiple lines)>
|
||||
>Fix:
|
||||
@iftex
|
||||
@hrule
|
||||
@end iftex
|
||||
-----Emacs: *send-pr* (send-pr Fill)----All------------------
|
||||
@iftex
|
||||
@hrule
|
||||
@end iftex
|
||||
>Category: other[]
|
||||
@end smallexample
|
||||
@end cartouche
|
||||
@page
|
||||
We know from past experience that we need to set certain information into
|
||||
each field, so we compile all the information we know about our problem.
|
||||
We have some sample code which we know should work, even though it
|
||||
doesn't, so we'll include that. Below is the completed PR; we send this
|
||||
using @kbd{C-c C-c}. (The comments have been truncated).
|
||||
|
||||
@cindex completed Problem Report
|
||||
@cindex example of a completed PR
|
||||
@cartouche
|
||||
@smallexample
|
||||
SEND-PR: Lines starting with `SEND-PR' will be removed
|
||||
SEND-PR: automatically as well as all comments (the text
|
||||
SEND-PR: @dots{}
|
||||
SEND-PR:
|
||||
To: cygnus-bugs@@cygnus.com
|
||||
Subject: bifrabulator routines don't match
|
||||
From: jeffrey@@imaginary.com
|
||||
Reply-To: jeffrey@@imaginary.com
|
||||
X-send-pr-version: send-pr @value{VERSION}
|
||||
|
||||
>Submitter-Id: imaginary
|
||||
>Originator: Jeffrey Osier
|
||||
>Organization:
|
||||
Imaginary Software, Ltd.
|
||||
>Confidential: no
|
||||
>Synopsis: bifrabulator routines don't match
|
||||
>Severity: serious
|
||||
>Priority: medium
|
||||
>Category: bifrabulator
|
||||
>Class: sw-bug
|
||||
>Release: progressive-930101
|
||||
>Environment:
|
||||
System: SunOS imaginary.com 4.1.1 1 sun4
|
||||
Architecture: sun4 (SPARC)
|
||||
|
||||
>Description:
|
||||
the following code I fed into the bifrabulator came back
|
||||
with a strange error. apparently, the prestidigitation
|
||||
routine doesn't match with the whatsitsname in all cases.
|
||||
|
||||
>How-To-Repeat:
|
||||
call the bifrabulator on the following code.
|
||||
@emph{code sample@dots{}}
|
||||
|
||||
>Fix:
|
||||
@iftex
|
||||
@hrule
|
||||
@end iftex
|
||||
-----Emacs: *send-pr* (send-pr Fill)----All------------------
|
||||
@iftex
|
||||
@hrule
|
||||
@end iftex
|
||||
To send the problem report use: C-c C-c
|
||||
@end smallexample
|
||||
@end cartouche
|
||||
|
||||
We type @kbd{C-c C-c}, and off it goes. Now, we depend on Cygnus
|
||||
Support to figure out the answer to our problem.
|
||||
|
||||
Soon afterward, we get the following message from Cygnus:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
From: gnats (GNATS management)
|
||||
Sender: gnats-admin
|
||||
Reply-To: hacker@@cygnus.com
|
||||
To: jeffrey@@imaginary.com
|
||||
Subject: Re: bifrabulator/1425: routines don't match
|
||||
|
||||
Thank you very much for your problem report.
|
||||
It has the internal identification: g++/1425.
|
||||
The individual assigned to look at your bug is: hacker
|
||||
(F.B. Hacker)
|
||||
|
||||
Category: bifrabulator
|
||||
Responsible: hacker
|
||||
Synopsis: bifrabulator routines don't match
|
||||
Arrival-Date: Sat Feb 30 03:12:55 1993
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
This is our receipt that the bug has been accepted and forwarded to the
|
||||
responsible party.
|
||||
|
||||
@noindent
|
||||
A while later, we get the analysis:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
To: jeffrey@@imaginary.com
|
||||
From: hacker@@cygnus.com
|
||||
Subject: Re: bifrabulator/1425: routines don't match
|
||||
Reply-To: hacker@@cygnus.com
|
||||
|
||||
Got your message, Jeff. It seems that the bifrabulator was
|
||||
confusing the prestidigitation routines with the realitychecker
|
||||
when lexically parsing the whatsitsname.
|
||||
|
||||
I'm working on robustisizing the bifrabulator now.
|
||||
|
||||
How about lunch next week?
|
||||
--
|
||||
F.B. Hacker
|
||||
Cygnus Solutions, Sunnyvale, CA 408 542 9600
|
||||
#include <std-disclaimer.h>
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
About the same time, we get another message from Cygnus.
|
||||
|
||||
@cindex state change example
|
||||
@cindex example of a state change
|
||||
@smallexample
|
||||
@group
|
||||
From: hacker@@cygnus.com
|
||||
To: jeffrey@@imaginary.com
|
||||
Subject: Re: bifrabulator/1425: doesn't match prestidig
|
||||
Reply-To: hacker@@cygnus.com
|
||||
|
||||
|
||||
`F.B. Hacker' changed the state to `analyzed'.
|
||||
|
||||
State-Changed-From-To: open-analyzed
|
||||
State-Changed-By: hacker
|
||||
State-Changed-When: Fri Feb 31 1993 08:59:16 1993
|
||||
State-Changed-Why:
|
||||
figured out the problem, working on a patch this afternoon
|
||||
--
|
||||
F.B. Hacker
|
||||
Cygnus Solutions, Sunnyvale, CA 408 542 9600
|
||||
#include <std-disclaimer.h>
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
The bug has now been analyzed, and Cygnus is working on a solution.
|
||||
|
||||
@noindent
|
||||
Sometime later, we get more mail from F.B.:
|
||||
|
||||
@smallexample
|
||||
@group
|
||||
To: jeffrey@@imaginary.com
|
||||
From: hacker@@cygnus.com
|
||||
Subject: Re: bifrabulator/1425: routines don't match
|
||||
Reply-To: hacker@@cygnus.com
|
||||
|
||||
There's a patch now that you can ftp over and check out.
|
||||
|
||||
Hey, that joke you sent me was great! The one about the
|
||||
strings walking into a bar... my boss laughed for an hour!
|
||||
--
|
||||
F.B. Hacker
|
||||
Cygnus Solutions, Sunnyvale, CA 408 542 9600
|
||||
#include <std-disclaimer.h>
|
||||
@end group
|
||||
@end smallexample
|
||||
@sp 2
|
||||
@smallexample
|
||||
@group
|
||||
From: hacker@@cygnus.com
|
||||
To: jeffrey@@imaginary.com
|
||||
Subject: Re: bifrabulator/1425: doesn't match prestidig
|
||||
Reply-To: hacker@@cygnus.com
|
||||
|
||||
|
||||
`F.B. Hacker' changed the state to `feedback'.
|
||||
|
||||
State-Changed-From-To: analyzed-feedback
|
||||
State-Changed-By: hacker
|
||||
State-Changed-When: Fri Feb 31 1993 23:43:16 1993
|
||||
State-Changed-Why:
|
||||
got the patch finished, notified Jeff at Imaginary Software
|
||||
--
|
||||
F.B. Hacker
|
||||
Cygnus Solutions, Sunnyvale, CA 408 542 9600
|
||||
#include <std-disclaimer.h>
|
||||
@end group
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
The bug has gone into @dfn{feedback} status now, until we get the patch,
|
||||
install it and test it. When everything tests well, we can mail F.B.
|
||||
back and tell him the bug's been fixed, and he can change the state of
|
||||
the PR from @dfn{feedback} to @dfn{closed}.
|
||||
|
||||
Following is a list of valid @samp{>Category:} entries that are
|
||||
supported by Cygnus.
|
||||
|
||||
@menu
|
||||
* Valid Categories::
|
||||
@end menu
|
||||
|
||||
@c FIXME - is this list up to date?
|
||||
@include categ.texi
|
||||
|
||||
@node Installing send-pr
|
||||
@appendix Installing @code{send-pr} on your system
|
||||
@cindex installation
|
||||
|
||||
If you receive @code{send-pr} as part of a larger software distribution,
|
||||
it probably gets installed when the full distribution is installed. If
|
||||
you are using @sc{gnats} at your site as well, you must decide where
|
||||
@code{send-pr} sends Problem Reports by default; see @ref{default site,,
|
||||
Setting a default @var{site}}.
|
||||
|
||||
@menu
|
||||
* installation:: installing `send-pr' by itself
|
||||
* default site:: setting a default site
|
||||
@end menu
|
||||
|
||||
@node installation
|
||||
@section Installing @code{send-pr} by itself
|
||||
@cindex installation procedure
|
||||
|
||||
Install @code{send-pr} by following these steps (you may need
|
||||
@code{root} access in order to change the @file{aliases} file and to
|
||||
install @code{send-pr}):
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
Unpack the distribution into a directory which we refer to as
|
||||
@var{srcdir}.
|
||||
|
||||
@item
|
||||
Edit the file @file{Makefile} to reflect local conventions.
|
||||
Specifically, you should edit the variable @samp{prefix} to alter the
|
||||
installation location. The default is @file{/usr/local}. All files are
|
||||
installed under @samp{prefix} (see below).
|
||||
|
||||
@item @emph{Run}
|
||||
@smallexample
|
||||
make all install [ info ] [ install-info ] [ clean ]
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
The targets mean the following:
|
||||
|
||||
@table @code
|
||||
@item all
|
||||
Builds @code{send-pr} and @code{install-sid}
|
||||
|
||||
@item install
|
||||
Installs the following:
|
||||
|
||||
@table @code
|
||||
@item install-sid
|
||||
@itemx send-pr
|
||||
into @file{@var{prefix}/bin}
|
||||
|
||||
@item send-pr.1
|
||||
into @file{@var{prefix}/man/man1}
|
||||
|
||||
@item @var{site}
|
||||
the list of valid @var{categories} for the Support Site from which you
|
||||
received @code{send-pr}, installed as
|
||||
@w{@file{@var{prefix}/share/gnats/@var{site}}}
|
||||
|
||||
@item send-pr.el
|
||||
into @w{@file{@var{prefix}/share/emacs/lisp}}@footnote{If your main Emacs
|
||||
lisp repository is in a different directory from this, substitute that
|
||||
directory for @w{@file{@var{prefix}/share/emacs/lisp}}.}
|
||||
@end table
|
||||
|
||||
@item info (@emph{optional})
|
||||
Builds @file{send-pr.info} from @file{send-pr.texi}@*
|
||||
@c FIXME - is this still true?
|
||||
(@file{send-pr.info} is included with this distribution)
|
||||
|
||||
@item install-info (@emph{optional})
|
||||
Installs @file{send-pr.info} into @w{@file{@var{prefix}/info}}
|
||||
|
||||
@item clean (@emph{optional})
|
||||
Removes all intermediary build files that can be rebuilt from source
|
||||
code
|
||||
@end table
|
||||
|
||||
@item
|
||||
Run
|
||||
|
||||
@smallexample
|
||||
install-sid @var{your-sid}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
where @var{your-sid} is the identification code you received with
|
||||
@w{@code{send-pr}}. @code{send-pr} automatically inserts this value
|
||||
into the template field @samp{>Submitter-Id:}. If you've downloaded
|
||||
@code{send-pr} from the Net, use @samp{net} for this value.
|
||||
|
||||
@item
|
||||
Place the following line in
|
||||
@w{@file{@var{prefix}/share/emacs/lisp/default.el}}, or instruct your
|
||||
users to place the following line in their @file{.emacs} files:
|
||||
|
||||
@smallexample
|
||||
(autoload 'send-pr "send-pr" "Submit a Problem Report." t)
|
||||
@end smallexample
|
||||
|
||||
@item
|
||||
Create a mail alias for the Support Site from which you received
|
||||
@code{send-pr}, and for every site with which you wish to use
|
||||
@code{send-pr} to communicate. Each alias must have a suffix of
|
||||
@samp{-gnats}. The Support Site(s) will provide the correct addresses
|
||||
where these aliases should point. For instance, edit your mail aliases
|
||||
file to contain something like:
|
||||
|
||||
@smallexample
|
||||
# support sites; for use with send-pr
|
||||
cygnus-gnats: bugs@@cygnus.com # Cygnus Solutions
|
||||
bumblebee-gnats: bumblebugs@@bumblebee.com # Bumblebee Inc.
|
||||
mycompany-gnats: bugs@@my.company.com (@emph{if you use @sc{gnats} locally})
|
||||
@end smallexample
|
||||
|
||||
@code{send-pr} automatically searches for these aliases when you type
|
||||
|
||||
@smallexample
|
||||
send-pr cygnus
|
||||
send-pr bumblebee
|
||||
send-pr @var{site}@dots{}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
@code{send-pr} also uses @var{site} to determine the categories of
|
||||
problems accepted by the site in question by looking in
|
||||
|
||||
@smallexample
|
||||
@var{prefix}/share/gnats/@var{site}
|
||||
@end smallexample
|
||||
|
||||
@end itemize
|
||||
|
||||
@node default site
|
||||
@section Setting a default @var{site}
|
||||
@cindex default @var{site}
|
||||
@cindex setting a default @var{site}
|
||||
|
||||
@code{send-pr} is capable of sending Problem Reports to any number of
|
||||
Support Sites, using mail aliases which have @samp{-gnats} appended them.
|
||||
@code{send-pr} automatically appends the suffix, so that when you type
|
||||
|
||||
@smallexample
|
||||
send-pr @var{site}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
the Problem Report goes to the address noted in the @file{aliases} file
|
||||
as @w{@samp{@var{site}-gnats}}. You can do this in the Emacs version of
|
||||
@code{send-pr} by invoking the program with
|
||||
|
||||
@smallexample
|
||||
C-u M-x send-pr
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
You are prompted for @var{site}.
|
||||
|
||||
@var{site} is also used to error-check the @samp{>Category:} field, as a
|
||||
precaution against sending mistaken information (and against sending
|
||||
information to the wrong site).
|
||||
|
||||
You may also simply type
|
||||
|
||||
@smallexample
|
||||
send-pr
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
from the shell (or @w{@samp{M-x send-pr}} in Emacs), and the Problem
|
||||
Report you generate will be sent to the @var{site}, which is usually the
|
||||
site from which you received your distribution of @w{@code{send-pr}}.
|
||||
If you use @sc{gnats} at your own organization, the default is usually
|
||||
your local address for reporting problems.
|
||||
|
||||
To change this, simply edit the file @file{Makefile} before installing
|
||||
and change the line
|
||||
|
||||
@smallexample
|
||||
GNATS_SITE = @var{site}
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
to reflect the site where you wish to send PRs by default.
|
||||
|
||||
@c ---------------------------------------------------------------
|
||||
@node Index
|
||||
@unnumbered Index
|
||||
|
||||
@printindex cp
|
||||
|
||||
@c ---------------------------------------------------------------
|
||||
@contents
|
||||
@bye
|
||||
@@ -1,58 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
@node States
|
||||
@section States of Problem Reports
|
||||
|
||||
@cindex life-cycle of a Problem Report
|
||||
@cindex states of Problem Reports
|
||||
@cindex Problem Report states
|
||||
@cindex automatic notification
|
||||
|
||||
Each PR goes through a defined series of states between origination and
|
||||
closure. The originator of a PR receives notification automatically of
|
||||
any state changes.
|
||||
|
||||
Unless your site has customized states (see @pxref{states
|
||||
file,,,gnats}), @sc{gnats} uses these states:
|
||||
|
||||
@table @dfn
|
||||
@cindex @emph{open} state
|
||||
@cindex initial state (@dfn{open})
|
||||
@cindex state---@dfn{open}
|
||||
@item open
|
||||
The initial state of a Problem Report. This means the PR has been filed
|
||||
and the responsible person(s) notified.
|
||||
|
||||
@cindex @emph{analyzed} state
|
||||
@cindex state---@dfn{analyzed}
|
||||
@item analyzed
|
||||
The responsible person has analyzed the problem. The analysis should
|
||||
contain a preliminary evaluation of the problem and an estimate of the
|
||||
amount of time and resources necessary to solve the problem. It should
|
||||
also suggest possible workarounds.
|
||||
|
||||
@cindex @emph{feedback} state
|
||||
@cindex state---@dfn{feedback}
|
||||
@item feedback
|
||||
The problem has been solved, and the originator has been given a patch
|
||||
or other fix. The PR remains in this state until the originator
|
||||
acknowledges that the solution works.
|
||||
|
||||
@cindex @emph{closed} state
|
||||
@cindex state---@dfn{closed}
|
||||
@cindex final state (@dfn{closed})
|
||||
@item closed
|
||||
A Problem Report is closed (``the bug stops here'') only when any
|
||||
changes have been integrated, documented, and tested, and the submitter
|
||||
has confirmed the solution.
|
||||
|
||||
@cindex @emph{suspended} state
|
||||
@cindex state---@dfn{suspended}
|
||||
@item suspended
|
||||
Work on the problem has been postponed. This happens if a timely
|
||||
solution is not possible or is not cost-effective at the present time.
|
||||
The PR continues to exist, though a solution is not being actively
|
||||
sought. If the problem cannot be solved at all, it should be closed
|
||||
rather than suspended.
|
||||
@end table
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
@c $FreeBSD$
|
||||
|
||||
@set VERSION 3.113
|
||||
@@ -1,82 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Drop in the SUBMITTER id into a site's installed send-pr script.
|
||||
# Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
# Contributed by Brendan Kehoe ([email protected]), based on a
|
||||
# version written by Heinz G. Seidl ([email protected]).
|
||||
#
|
||||
# This file is part of GNU GNATS.
|
||||
#
|
||||
# GNU GNATS is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU GNATS is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU GNATS; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
COMMAND=`echo $0 | sed -e 's,.*/,,g'`
|
||||
USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id"
|
||||
|
||||
VERSION=3.2
|
||||
|
||||
BINDIR=@BINDIR@
|
||||
|
||||
SUBMITTER=
|
||||
TEMP=/tmp/sp$$
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "$USAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*)
|
||||
I=`echo "$1" | sed 's/-*i[a-z\-]*=//'`
|
||||
BINDIR=$I/bin ;;
|
||||
--version) echo $COMMAND version $VERSION ; exit 1 ;;
|
||||
-*) echo "$USAGE" ; exit 1 ;;
|
||||
*) SUBMITTER=$1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
path=`echo $0 | sed -e "s;${COMMAND};;"`
|
||||
|
||||
[ -z "$path" ] && path=.
|
||||
|
||||
if [ -f $BINDIR/send-pr ]; then
|
||||
SPPATH=$BINDIR/send-pr
|
||||
elif [ -f $path/send-pr ]; then
|
||||
SPPATH=$path/send-pr
|
||||
else
|
||||
echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rm -f $TEMP ; exit 0' 0
|
||||
trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15
|
||||
|
||||
sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP
|
||||
|
||||
if grep $SUBMITTER $TEMP > /dev/null; then
|
||||
cp $SPPATH $SPPATH.orig &&
|
||||
rm -f $SPPATH &&
|
||||
cp $TEMP $SPPATH &&
|
||||
chmod a+rx $SPPATH &&
|
||||
rm -f $TEMP $SPPATH.orig ||
|
||||
{ echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; }
|
||||
else
|
||||
echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr"
|
||||
|
||||
exit 0
|
||||
@@ -1,813 +0,0 @@
|
||||
;;;; -*-emacs-lisp-*-
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; EMACS interface for send-pr (by Heinz G. Seidl)
|
||||
;;;; Slightly hacked by Brendan Kehoe ([email protected]).
|
||||
;;;;
|
||||
;;;; This file is part of the Problem Report Management System (GNATS)
|
||||
;;;; Copyright 1992, 1993, 1997 Cygnus Support
|
||||
;;;;
|
||||
;;;; This program is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU General Public
|
||||
;;;; License as published by the Free Software Foundation; either
|
||||
;;;; version 2 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;; This program is distributed in the hope that it will be useful,
|
||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;;; General Public License for more details.
|
||||
;;;;
|
||||
;;;; You should have received a copy of the GNU Library General Public
|
||||
;;;; License along with this program; if not, write to the Free
|
||||
;;;; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;;;;
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;;
|
||||
;;;; This file contains the EMACS interface to the Problem Report Management
|
||||
;;;; System (GNATS):
|
||||
;;;;
|
||||
;;;; - The `send-pr' command and the `send-pr-mode' for sending
|
||||
;;;; Problem Reports (PRs).
|
||||
;;;;
|
||||
;;;; For more information about how to send a PR see send-pr(1).
|
||||
;;;;
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;;
|
||||
;;;; Configuration: the symbol `DEFAULT-RELEASE' can be replaced by
|
||||
;;;; site/release specific strings during the configuration/installation
|
||||
;;;; process.
|
||||
;;;;
|
||||
;;;; Install this file in your EMACS library directory.
|
||||
;;;;
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;;
|
||||
;;;; $FreeBSD$
|
||||
|
||||
(provide 'send-pr)
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; Customization: put the following forms into your default.el file
|
||||
;;;; (or into your .emacs)
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
;(autoload 'send-pr-mode "send-pr"
|
||||
; "Major mode for sending problem reports." t)
|
||||
|
||||
;(autoload 'send-pr "send-pr"
|
||||
; "Command to create and send a problem report." t)
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; End of Customization Section
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(autoload 'server-buffer-done "server")
|
||||
(defvar server-buffer-clients nil)
|
||||
(defvar mail-self-blind nil)
|
||||
(defvar mail-default-reply-to nil)
|
||||
|
||||
(defconst send-pr::version "3.113")
|
||||
|
||||
(defvar gnats:root "/home/gnats"
|
||||
"*The top of the tree containing the GNATS database.")
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; hooks
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defvar text-mode-hook nil) ; we define it here in case it's not defined
|
||||
(defvar send-pr-mode-hook text-mode-hook "Called when send-pr is invoked.")
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; Domains and default values for (some of) the Problem Report fields;
|
||||
;;;; constants and definitions.
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defconst gnats::emacs-19p
|
||||
(not (or (and (boundp 'epoch::version) epoch::version)
|
||||
(string-lessp emacs-version "19")))
|
||||
"Is this emacs v19?")
|
||||
|
||||
;;; This has to be here rather than at the bottom of this file with
|
||||
;;; the other utility functions because it is used by
|
||||
;;; gnats::get-config, which is called when send-pr.el is being
|
||||
;;; loaded (see the "defconst" below), before the whole file has been
|
||||
;;; loaded.
|
||||
|
||||
(defun gnats::find-safe-default-directory (&optional buffer)
|
||||
"If the directory referred to by `default-directory' for the current
|
||||
buffer (or for optional argument BUFFER) does not exist, set it to the home
|
||||
directory of the current user if that exists, or to `/'.
|
||||
|
||||
Returns the final value of default-directory in the buffer."
|
||||
(let ((homedir (expand-file-name "~/")))
|
||||
(save-excursion
|
||||
(if buffer (set-buffer buffer))
|
||||
(if (not (file-exists-p default-directory))
|
||||
(if (file-exists-p homedir)
|
||||
(setq default-directory homedir)
|
||||
(setq default-directory "/")))
|
||||
default-directory)))
|
||||
|
||||
;;; These may be changed during configuration/installation or by the individual
|
||||
;;; user in his/her .emacs file.
|
||||
;;;
|
||||
(defun gnats::get-config (var)
|
||||
(let ((shell-file-name "/bin/sh")
|
||||
(buf (generate-new-buffer " *GNATS config*"))
|
||||
ret)
|
||||
(save-excursion
|
||||
(set-buffer buf)
|
||||
(shell-command-on-region
|
||||
(point-min) (point-max)
|
||||
(concat ". " gnats:root "/gnats-adm/config; echo $" var ) t)
|
||||
(goto-char (point-min))
|
||||
; We have to use get-buffer, since shell-command-on-region will wipe
|
||||
; out the buffer if there's no output from the command.
|
||||
(if (or (not (get-buffer "*Shell Command Output*"))
|
||||
(looking-at "^\\.:\\|/bin/sh:\\|\n"))
|
||||
(setq ret nil)
|
||||
(setq ret (buffer-substring (point-min) (- (point-max) 1)))))
|
||||
(if (and ret (string-equal ret "")) (setq ret nil))
|
||||
(kill-buffer buf)
|
||||
ret))
|
||||
|
||||
;; const because it must match the script's value
|
||||
(defconst send-pr:datadir (or (gnats::get-config "DATADIR") "@DATADIR@")
|
||||
"*Where the `gnats' subdirectory containing category lists lives.")
|
||||
|
||||
(defvar send-pr::sites nil
|
||||
"List of GNATS support sites; computed at runtime.")
|
||||
(defvar send-pr:default-site
|
||||
(or (gnats::get-config "GNATS_SITE") "freefall")
|
||||
"Default site to send bugs to.")
|
||||
(defvar send-pr:::site send-pr:default-site
|
||||
"The site to which a problem report is currently being submitted, or NIL
|
||||
if using the default site (buffer local).")
|
||||
|
||||
(defvar send-pr:::categories nil
|
||||
"Buffer local list of available categories, derived at runtime from
|
||||
send-pr:::site and send-pr::category-alist.")
|
||||
(defvar send-pr::category-alist nil
|
||||
"Alist of GNATS support sites and the categories supported at each; computed
|
||||
at runtime.")
|
||||
|
||||
;;; Ideally we would get all the following values from a central database
|
||||
;;; during runtime instead of having them here in the code.
|
||||
;;;
|
||||
(defconst send-pr::fields
|
||||
(` (("Category" send-pr::set-categories
|
||||
(, (or (gnats::get-config "DEFAULT_CATEGORY") nil)) enum)
|
||||
("Class" (("sw-bug") ("doc-bug") ("change-request") ("update") ("maintainer-update"))
|
||||
(, (or (gnats::get-config "DEFAULT_CLASS") 0)) enum)
|
||||
("Confidential" (("yes") ("no"))
|
||||
(, (or (gnats::get-config "DEFAULT_CONFIDENTIAL") 1)) enum)
|
||||
("Severity" (("non-critical") ("serious") ("critical"))
|
||||
(, (or (gnats::get-config "DEFAULT_SEVERITY") 1)) enum)
|
||||
("Priority" (("low") ("medium") ("high"))
|
||||
(, (or (gnats::get-config "DEFAULT_PRIORITY") 1)) enum)
|
||||
("Release" nil
|
||||
(, (or (gnats::get-config "DEFAULT_RELEASE") "@DEFAULT_RELEASE@"))
|
||||
text)
|
||||
("Submitter-Id" nil
|
||||
(, (or (gnats::get-config "DEFAULT_SUBMITTER") "unknown")) text)
|
||||
("Synopsis" nil nil text
|
||||
(lambda (a b c) (gnats::set-mail-field "Subject" c)))))
|
||||
"AList, keyed on the name of the field, of:
|
||||
1) The field name.
|
||||
2) The list of completions. This can be a list, a function to call, or nil.
|
||||
3) The default value.
|
||||
4) The type of the field.
|
||||
5) A sub-function to call when changed.")
|
||||
|
||||
(defvar gnats::fields nil)
|
||||
|
||||
(defmacro gnats::push (i l)
|
||||
(` (setq (, l) (cons (,@ (list i l))))))
|
||||
|
||||
(defun send-pr::set-categories (&optional arg)
|
||||
"Get the list of categories for the current site out of
|
||||
send-pr::category-alist if there or from send-pr if not. With arg, force
|
||||
update."
|
||||
;;
|
||||
(let ((entry (assoc send-pr:::site send-pr::category-alist)))
|
||||
(or (and entry (null arg))
|
||||
(let ((oldpr (getenv "GNATS_ROOT")) cats)
|
||||
(send-pr::set-sites arg)
|
||||
(setenv "GNATS_ROOT" gnats:root)
|
||||
(setq cats (gnats::get-value-from-shell
|
||||
"send-pr" "-CL" send-pr:::site))
|
||||
(setenv "GNATS_ROOT" oldpr)
|
||||
(if entry (setcdr entry cats)
|
||||
(setq entry (cons send-pr:::site cats))
|
||||
(gnats::push entry send-pr::category-alist))))
|
||||
(setq send-pr:::categories (cdr entry))))
|
||||
|
||||
(defun send-pr::set-sites (&optional arg)
|
||||
"Get the list of sites (by listing the contents of DATADIR/gnats) and assign
|
||||
it to send-pr::sites. With arg, force update."
|
||||
(or (and (null arg) send-pr::sites)
|
||||
(progn
|
||||
(setq send-pr::sites nil)
|
||||
(mapcar
|
||||
(function
|
||||
(lambda (file)
|
||||
(or (memq t (mapcar (function (lambda (x) (string= x file)))
|
||||
'("." ".." "pr-edit" "pr-addr")))
|
||||
(not (file-readable-p file))
|
||||
(gnats::push (list (file-name-nondirectory file))
|
||||
send-pr::sites))))
|
||||
(directory-files (format "%s/gnats" send-pr:datadir) t))
|
||||
(setq send-pr::sites (reverse send-pr::sites)))))
|
||||
|
||||
(defconst send-pr::pr-buffer-name "*send-pr*"
|
||||
"Name of the temporary buffer, where the problem report gets composed.")
|
||||
|
||||
(defconst send-pr::err-buffer-name "*send-pr-error*"
|
||||
"Name of the temporary buffer, where send-pr error messages appear.")
|
||||
|
||||
(defvar send-pr:::err-buffer nil
|
||||
"The error buffer used by the current PR buffer.")
|
||||
|
||||
(defvar send-pr:::spawn-to-send nil
|
||||
"Whether or not send-pr-mode should spawn a send-pr process to send the PR.")
|
||||
|
||||
(defconst gnats::indent 17 "Indent for formatting the value.")
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; `send-pr' - command for creating and sending of problem reports
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(fset 'send-pr 'send-pr:send-pr)
|
||||
(defun send-pr:send-pr (&optional site)
|
||||
"Create a buffer and read in the result of `send-pr -P'.
|
||||
When finished with editing the problem report use \\[send-pr:submit-pr]
|
||||
to send the PR with `send-pr -b -f -'."
|
||||
;;
|
||||
(interactive
|
||||
(if current-prefix-arg
|
||||
(list (completing-read "Site: " (send-pr::set-sites 'recheck) nil t
|
||||
send-pr:default-site))))
|
||||
(or site (setq site send-pr:default-site))
|
||||
(let ((buf (get-buffer send-pr::pr-buffer-name)))
|
||||
(if (or (not buf)
|
||||
(progn (switch-to-buffer buf)
|
||||
(cond ((or (not (buffer-modified-p buf))
|
||||
(y-or-n-p "Erase previous problem report? "))
|
||||
(erase-buffer) t)
|
||||
(t nil))))
|
||||
(send-pr::start-up site))))
|
||||
|
||||
(defun send-pr::start-up (site)
|
||||
(switch-to-buffer (get-buffer-create send-pr::pr-buffer-name))
|
||||
(setq default-directory (expand-file-name "~/"))
|
||||
(auto-save-mode auto-save-default)
|
||||
(let ((oldpr (getenv "GNATS_ROOT"))
|
||||
(case-fold-search nil))
|
||||
(setenv "GNATS_ROOT" gnats:root)
|
||||
(send-pr::insert-template site)
|
||||
(setenv "GNATS_ROOT" oldpr)
|
||||
(goto-char (point-min))
|
||||
(if (looking-at "send-pr:")
|
||||
(cond ((looking-at "send-pr: .* does not have a categories list")
|
||||
(setq send-pr::sites nil)
|
||||
(error "send-pr: the GNATS site %s does not have a categories list" site))
|
||||
(t (error (buffer-substring (point-min) (point-max)))))
|
||||
(save-excursion
|
||||
;; Clear cruft inserted by bdamaged .cshrcs
|
||||
(goto-char 1)
|
||||
(re-search-forward "^SEND-PR:")
|
||||
(delete-region 1 (match-beginning 0)))))
|
||||
(set-buffer-modified-p nil)
|
||||
(send-pr:send-pr-mode)
|
||||
(setq send-pr:::site site)
|
||||
(setq send-pr:::spawn-to-send t)
|
||||
(send-pr::set-categories)
|
||||
(if (null send-pr:::categories)
|
||||
(progn
|
||||
(and send-pr:::err-buffer (kill-buffer send-pr:::err-buffer))
|
||||
(kill-buffer nil)
|
||||
(message "send-pr: no categories found"))
|
||||
(or (stringp mail-default-reply-to)
|
||||
(setq mail-default-reply-to (getenv "REPLYTO")))
|
||||
(and mail-default-reply-to
|
||||
(gnats::set-mail-field "Reply-To" mail-default-reply-to))
|
||||
(and mail-self-blind
|
||||
(gnats::set-mail-field "BCC" (user-login-name)))
|
||||
(mapcar 'send-pr::maybe-change-field send-pr::fields)
|
||||
(gnats::position-on-field "Description")
|
||||
(message (substitute-command-keys
|
||||
"To send the problem report use: \\[send-pr:submit-pr]"))))
|
||||
|
||||
(defvar send-pr::template-alist nil
|
||||
"An alist containing the output of send-pr -P <sitename> for various sites.")
|
||||
|
||||
(defun send-pr::insert-template (site)
|
||||
(let ((elt (assoc site send-pr::template-alist)))
|
||||
(if elt
|
||||
(save-excursion (insert (cdr elt)))
|
||||
(call-process "send-pr" nil t nil "-P" site)
|
||||
(save-excursion
|
||||
(setq send-pr::template-alist
|
||||
(cons (cons site (buffer-substring (point-min) (point-max)))
|
||||
send-pr::template-alist))))))
|
||||
|
||||
(fset 'do-send-pr 'send-pr:submit-pr) ;backward compat
|
||||
(defun send-pr:submit-pr ()
|
||||
"Pipe the contents of the buffer *send-pr* to `send-pr -f -.' unless this
|
||||
buffer was loaded with emacsclient, in which case save the buffer and exit."
|
||||
;;
|
||||
(interactive)
|
||||
(cond
|
||||
((and (boundp 'server-buffer-clients)
|
||||
server-buffer-clients)
|
||||
(let ((buffer (current-buffer))
|
||||
(version-control nil) (buffer-backed-up nil))
|
||||
(save-buffer buffer)
|
||||
(kill-buffer buffer)
|
||||
(server-buffer-done buffer)))
|
||||
(send-pr:::spawn-to-send
|
||||
(if (or (buffer-modified-p)
|
||||
(not send-pr:::sent)
|
||||
(y-or-n-p "PR already sent; resend? "))
|
||||
(progn
|
||||
(or (and send-pr:::err-buffer
|
||||
(buffer-name send-pr:::err-buffer))
|
||||
(setq send-pr:::err-buffer
|
||||
(get-buffer-create send-pr::err-buffer-name)))
|
||||
(let ((err-buffer send-pr:::err-buffer) mesg ok)
|
||||
(save-excursion (set-buffer err-buffer) (erase-buffer))
|
||||
(message "running send-pr...")
|
||||
(let ((oldpr (getenv "GNATS_ROOT")))
|
||||
(setenv "GNATS_ROOT" gnats:root)
|
||||
;; ensure that a final newline is present:
|
||||
(if (not (equal (char-after (1- (point-max))) ?\n))
|
||||
(save-excursion (goto-char (point-max))
|
||||
(insert ?\n)))
|
||||
(call-process-region (point-min) (point-max) "send-pr"
|
||||
nil err-buffer nil send-pr:::site
|
||||
"-b" "-f" "-")
|
||||
(setenv "GNATS_ROOT" oldpr))
|
||||
(message "running send-pr...done")
|
||||
;; stupidly we cannot check the return value in EMACS 18.57,
|
||||
;; thus we need this kluge to find out whether send-pr succeeded.
|
||||
(if (save-excursion
|
||||
(set-buffer err-buffer)
|
||||
(goto-char (point-min))
|
||||
(setq mesg (buffer-substring (point-min) (- (point-max) 1)))
|
||||
(search-forward "problem report sent" nil t))
|
||||
(progn (message mesg)
|
||||
(kill-buffer err-buffer)
|
||||
(delete-auto-save-file-if-necessary)
|
||||
(set-buffer-modified-p nil)
|
||||
(setq send-pr:::sent t)
|
||||
(bury-buffer))
|
||||
(pop-to-buffer err-buffer))
|
||||
))))
|
||||
(t
|
||||
(save-buffer)
|
||||
(message "Exit emacs to send the PR."))))
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; send-pr:send-pr-mode mode
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defvar send-pr-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map "\C-c\C-c" 'send-pr:submit-pr)
|
||||
(define-key map "\C-c\C-f" 'gnats:change-field)
|
||||
(define-key map "\M-n" 'gnats:next-field)
|
||||
(define-key map "\M-p" 'gnats:previous-field)
|
||||
(define-key map "\C-\M-f" 'gnats:forward-field)
|
||||
(define-key map "\C-\M-b" 'gnats:backward-field)
|
||||
map)
|
||||
"Keymap for send-pr mode.")
|
||||
|
||||
(defconst gnats::keyword "^>\\([-a-zA-Z]+\\):")
|
||||
(defconst gnats::before-keyword "[ \t\n\f]*[\n\f]+>\\([-a-zA-Z]+\\):")
|
||||
(defconst gnats::after-keyword "^>\\([-a-zA-Z]+\\):[ \t\n\f]+")
|
||||
|
||||
(fset 'send-pr-mode 'send-pr:send-pr-mode)
|
||||
(defun send-pr:send-pr-mode ()
|
||||
"Major mode for submitting problem reports.
|
||||
For information about the form see gnats(1) and send-pr(1).
|
||||
Special commands: \\{send-pr-mode-map}
|
||||
Turning on send-pr-mode calls the value of the variable send-pr-mode-hook,
|
||||
if it is not nil."
|
||||
(interactive)
|
||||
(gnats::patch-exec-path)
|
||||
(put 'send-pr:send-pr-mode 'mode-class 'special)
|
||||
(kill-all-local-variables)
|
||||
(setq major-mode 'send-pr:send-pr-mode)
|
||||
(setq mode-name "send-pr")
|
||||
(use-local-map send-pr-mode-map)
|
||||
(set-syntax-table text-mode-syntax-table)
|
||||
(setq local-abbrev-table text-mode-abbrev-table)
|
||||
(setq buffer-offer-save t)
|
||||
(make-local-variable 'send-pr:::site)
|
||||
(make-local-variable 'send-pr:::categories)
|
||||
(make-local-variable 'send-pr:::err-buffer)
|
||||
(make-local-variable 'send-pr:::spawn-to-send)
|
||||
(make-local-variable 'send-pr:::sent)
|
||||
(setq send-pr:::sent nil)
|
||||
(make-local-variable 'paragraph-separate)
|
||||
(setq paragraph-separate (concat (default-value 'paragraph-separate)
|
||||
"\\|" gnats::keyword "[ \t\n\f]*$"))
|
||||
(make-local-variable 'paragraph-start)
|
||||
(setq paragraph-start (concat (default-value 'paragraph-start)
|
||||
"\\|" gnats::keyword))
|
||||
(run-hooks 'send-pr-mode-hook)
|
||||
t)
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; Functions to read and replace field values.
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defun gnats::position-on-field (field &optional quiet)
|
||||
(goto-char (point-min))
|
||||
(if (not (re-search-forward (concat "^>" field ":") nil t))
|
||||
(if quiet
|
||||
nil
|
||||
(error "Field `>%s:' not found." field))
|
||||
(re-search-forward "[ \t\n\f]*")
|
||||
(if (looking-at gnats::keyword)
|
||||
(backward-char 1))
|
||||
t))
|
||||
|
||||
(defun gnats::mail-position-on-field (field)
|
||||
(let (end
|
||||
(case-fold-search t))
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "^$")
|
||||
(setq end (match-beginning 0))
|
||||
(goto-char (point-min))
|
||||
(if (not (re-search-forward (concat "^" field ":") end 'go-to-end))
|
||||
(insert field ": \n")
|
||||
(re-search-forward "[ \t\n\f]*"))
|
||||
(skip-chars-backward "\n")
|
||||
t))
|
||||
|
||||
(defun gnats::field-contents (field &optional elem move)
|
||||
(let (pos)
|
||||
(unwind-protect
|
||||
(save-excursion
|
||||
(if (not (gnats::position-on-field field t))
|
||||
nil
|
||||
(setq pos (point-marker))
|
||||
(if (or (looking-at "<.*>$") (eolp))
|
||||
t
|
||||
(looking-at ".*$") ; to set match-{beginning,end}
|
||||
(gnats::nth-word
|
||||
(buffer-substring (match-beginning 0) (match-end 0))
|
||||
elem))))
|
||||
(and move pos (goto-char pos)))))
|
||||
|
||||
(defun gnats::functionp (thing)
|
||||
(or (and (symbolp thing) (fboundp thing))
|
||||
(and (listp thing) (eq (car thing) 'lambda))))
|
||||
|
||||
(defun gnats::field-values (field)
|
||||
"Return the possible (known) values for field FIELD."
|
||||
(let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
|
||||
send-pr::fields))
|
||||
(thing (elt (assoc field fields) 1)))
|
||||
(cond ((gnats::functionp thing) (funcall thing))
|
||||
((listp thing) thing)
|
||||
(t (error "ACK")))))
|
||||
|
||||
(defun gnats::field-default (field)
|
||||
"Return the default value for field FIELD."
|
||||
(let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
|
||||
send-pr::fields))
|
||||
(thing (elt (assoc field fields) 2)))
|
||||
(cond ((stringp thing) thing)
|
||||
((null thing) "")
|
||||
((numberp thing) (car (elt (gnats::field-values field) thing)))
|
||||
((gnats::functionp thing)
|
||||
(funcall thing (gnats::field-contents field)))
|
||||
((eq thing t) (gnats::field-contents field))
|
||||
(t (error "ACK")))))
|
||||
|
||||
(defun gnats::field-type (field)
|
||||
"Return the type of field FIELD."
|
||||
(let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
|
||||
send-pr::fields))
|
||||
(thing (elt (assoc field fields) 3)))
|
||||
thing))
|
||||
|
||||
(defun gnats::field-action (field)
|
||||
"Return the extra handling function for field FIELD."
|
||||
(let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
|
||||
send-pr::fields))
|
||||
(thing (elt (assoc field fields) 4)))
|
||||
(cond ((null thing) 'ignore)
|
||||
((gnats::functionp thing) thing)
|
||||
(t (error "ACK")))))
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; Point movement functions
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(or (fboundp 'defsubst) (fset 'defsubst 'defun))
|
||||
|
||||
(defun send-pr::maybe-change-field (field)
|
||||
(setq field (car field))
|
||||
(let ((thing (gnats::field-contents field)))
|
||||
(and thing (eq t thing)
|
||||
(not (eq 'multi-text (gnats::field-type field)))
|
||||
(gnats:change-field field))))
|
||||
|
||||
(defun gnats:change-field (&optional field default)
|
||||
"Change the value of the field containing the cursor. With arg, ask the
|
||||
user for the field to change. From a program, the function takes optional
|
||||
arguments of the field to change and the default value to use."
|
||||
(interactive)
|
||||
(or field current-prefix-arg (setq field (gnats::current-field)))
|
||||
(or field
|
||||
(setq field
|
||||
(completing-read "Field: "
|
||||
(if (eq major-mode 'gnats:gnats-mode)
|
||||
gnats::fields
|
||||
send-pr::fields)
|
||||
nil t)))
|
||||
(gnats::position-on-field field)
|
||||
(sit-for 0)
|
||||
(let* ((old (gnats::field-contents field))
|
||||
new)
|
||||
(if (null old)
|
||||
(error "ACK")
|
||||
(if (or (interactive-p) t)
|
||||
(let ((prompt (concat ">" field ": "))
|
||||
(domain (gnats::field-values field))
|
||||
(type (gnats::field-type field)))
|
||||
(or default (setq default (gnats::field-default field)))
|
||||
(setq new
|
||||
(if (eq type 'enum)
|
||||
(completing-read prompt domain nil t
|
||||
(if gnats::emacs-19p (cons default 0)
|
||||
default))
|
||||
(read-string prompt (if gnats::emacs-19p (cons default 1)
|
||||
default)))))
|
||||
(setq new default))
|
||||
(gnats::set-field field new)
|
||||
(funcall (gnats::field-action field) field old new)
|
||||
new)))
|
||||
|
||||
(defun gnats::set-field (field value)
|
||||
(save-excursion
|
||||
(gnats::position-on-field field)
|
||||
(delete-horizontal-space)
|
||||
(looking-at ".*$")
|
||||
(replace-match
|
||||
(concat (make-string (- gnats::indent (length field) 2) ?\40 ) value) t)))
|
||||
|
||||
(defun gnats::set-mail-field (field value)
|
||||
(save-excursion
|
||||
(gnats::mail-position-on-field field)
|
||||
(delete-horizontal-space)
|
||||
(looking-at ".*$")
|
||||
(replace-match (concat " " value) t)))
|
||||
|
||||
(defun gnats::before-keyword (&optional where)
|
||||
"Returns t if point is in some white space before a keyword.
|
||||
If where is nil, then point is not changed; if where is t then point is moved
|
||||
to the beginning of the keyword, otherwise it is moved to the beginning
|
||||
of the white space it was in."
|
||||
;;
|
||||
(if (looking-at gnats::before-keyword)
|
||||
(prog1 t
|
||||
(cond ((eq where t)
|
||||
(re-search-forward "^>") (backward-char))
|
||||
((not (eq where nil))
|
||||
(re-search-backward "[^ \t\n\f]") (forward-char))))
|
||||
nil))
|
||||
|
||||
(defun gnats::after-keyword (&optional where)
|
||||
"Returns t if point is in some white space after a keyword.
|
||||
If where is nil, then point is not changed; if where is t then point is moved
|
||||
to the beginning of the keyword, otherwise it is moved to the end of the white
|
||||
space it was in."
|
||||
;;
|
||||
(if (gnats::looking-after gnats::after-keyword)
|
||||
(prog1 t
|
||||
(cond ((eq where t)
|
||||
(re-search-backward "^>"))
|
||||
((not (eq where nil))
|
||||
(re-search-forward "[^ \t\n\f]") (backward-char))))
|
||||
nil))
|
||||
|
||||
(defun gnats::in-keyword (&optional where)
|
||||
"Returns t if point is within a keyword.
|
||||
If where is nil, then point is not changed; if where is t then point is moved
|
||||
to the beginning of the keyword."
|
||||
;;
|
||||
(let ((old-point (point-marker)))
|
||||
(beginning-of-line)
|
||||
(cond ((and (looking-at gnats::keyword)
|
||||
(< old-point (match-end 0)))
|
||||
(prog1 t
|
||||
(if (eq where t)
|
||||
t
|
||||
(goto-char old-point))))
|
||||
(t (goto-char old-point)
|
||||
nil))))
|
||||
|
||||
(defun gnats::forward-bofield ()
|
||||
"Moves point to the beginning of a field. Assumes that point is in the
|
||||
keyword."
|
||||
;;
|
||||
(if (re-search-forward "[ \t\n\f]+[^ \t\n\f]" (point-max) '-)
|
||||
(backward-char)
|
||||
t))
|
||||
|
||||
(defun gnats::backward-eofield ()
|
||||
"Moves point to the end of a field. Assumes point is in the keyword."
|
||||
;;
|
||||
(if (re-search-backward "[^ \t\n\f][ \t\n\f]+" (point-min) '-)
|
||||
(forward-char)
|
||||
t))
|
||||
|
||||
(defun gnats::forward-eofield ()
|
||||
"Moves point to the end of a field. Assumes that point is in the field."
|
||||
;;
|
||||
;; look for the next field
|
||||
(if (re-search-forward gnats::keyword (point-max) '-)
|
||||
(progn (beginning-of-line) (gnats::backward-eofield))
|
||||
(re-search-backward "[^ \t\n\f][ \t\n\f]*" (point-min) '-)
|
||||
(forward-char)))
|
||||
|
||||
(defun gnats::backward-bofield ()
|
||||
"Moves point to the beginning of a field. Assumes that point is in the
|
||||
field."
|
||||
;;
|
||||
;;look for previous field
|
||||
(if (re-search-backward gnats::keyword (point-min) '-)
|
||||
(gnats::forward-bofield)
|
||||
t))
|
||||
|
||||
|
||||
(defun gnats:forward-field ()
|
||||
"Move point forward to the end of the field or to the beginning of the next
|
||||
field."
|
||||
;;
|
||||
(interactive)
|
||||
(if (or (gnats::before-keyword t) (gnats::in-keyword t)
|
||||
(gnats::after-keyword t))
|
||||
(gnats::forward-bofield)
|
||||
(gnats::forward-eofield)))
|
||||
|
||||
(defun gnats:backward-field ()
|
||||
"Move point backward to the beginning/end of a field."
|
||||
;;
|
||||
(interactive)
|
||||
(backward-char)
|
||||
(if (or (gnats::before-keyword t) (gnats::in-keyword t)
|
||||
(gnats::after-keyword t))
|
||||
(gnats::backward-eofield)
|
||||
(gnats::backward-bofield)))
|
||||
|
||||
(defun gnats:next-field ()
|
||||
"Move point to the beginning of the next field."
|
||||
;;
|
||||
(interactive)
|
||||
(if (or (gnats::before-keyword t) (gnats::in-keyword t)
|
||||
(gnats::after-keyword t))
|
||||
(gnats::forward-bofield)
|
||||
(if (re-search-forward gnats::keyword (point-max) '-)
|
||||
(gnats::forward-bofield)
|
||||
t)))
|
||||
|
||||
(defun gnats:previous-field ()
|
||||
"Move point to the beginning of the previous field."
|
||||
;;
|
||||
(interactive)
|
||||
(backward-char)
|
||||
(if (or (gnats::after-keyword t) (gnats::in-keyword t)
|
||||
(gnats::before-keyword t))
|
||||
(progn (re-search-backward gnats::keyword (point-min) '-)
|
||||
(gnats::forward-bofield))
|
||||
(gnats::backward-bofield)))
|
||||
|
||||
(defun gnats:beginning-of-field ()
|
||||
"Move point to the beginning of the current field."
|
||||
(interactive)
|
||||
(cond ((gnats::in-keyword t)
|
||||
(gnats::forward-bofield))
|
||||
((gnats::after-keyword 0))
|
||||
(t
|
||||
(gnats::backward-bofield))))
|
||||
|
||||
(defun gnats::current-field ()
|
||||
(save-excursion
|
||||
(if (cond ((or (gnats::in-keyword t) (gnats::after-keyword t))
|
||||
(looking-at gnats::keyword))
|
||||
((re-search-backward gnats::keyword nil t)))
|
||||
(buffer-substring (match-beginning 1) (match-end 1))
|
||||
nil)))
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
;;;; Support functions
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defun gnats::looking-after (regex)
|
||||
"Returns t if point is after regex."
|
||||
;;
|
||||
(let* ((old-point (point))
|
||||
(start (if (eobp)
|
||||
old-point
|
||||
(forward-char) (point))))
|
||||
(cond ((re-search-backward regex (point-min) t)
|
||||
(goto-char old-point)
|
||||
(cond ((eq (match-end 0) start)
|
||||
t))))))
|
||||
|
||||
(defun gnats::nth-word (string &optional elem)
|
||||
"Returns the elem-th word of the string.
|
||||
If elem is nil, then the first wort is returned, if elem is 0 then
|
||||
the whole string is returned."
|
||||
;;
|
||||
(if (integerp elem)
|
||||
(cond ((eq elem 0) string)
|
||||
((eq elem 1) (gnats::first-word string))
|
||||
((equal string "") "")
|
||||
((>= elem 2)
|
||||
(let ((i 0) (value ""))
|
||||
(setq string ; strip leading blanks
|
||||
(substring string (or (string-match "[^ \t]" string) 0)))
|
||||
(while (< i elem)
|
||||
(setq value
|
||||
(substring string 0
|
||||
(string-match "[ \t]*$\\|[ \t]+" string)))
|
||||
(setq string
|
||||
(substring string (match-end 0)))
|
||||
(setq i (+ i 1)))
|
||||
value)))
|
||||
(gnats::first-word string)))
|
||||
|
||||
(defun gnats::first-word (string)
|
||||
(setq string
|
||||
(substring string (or (string-match "[^ \t]" string) 0)))
|
||||
(substring string 0 (string-match "[ \t]*$\\|[ \t]+" string)))
|
||||
|
||||
;;;;---------------------------------------------------------------------------
|
||||
|
||||
(defun gnats::patch-exec-path ()
|
||||
;;
|
||||
"Replaces `//' by `/' in `exec-path'."
|
||||
;;
|
||||
;(make-local-variable 'exec-path)
|
||||
(let ((err-buffer (get-buffer-create " *gnats::patch-exec-path*"))
|
||||
(ret))
|
||||
(setq exec-path (save-excursion (set-buffer err-buffer)
|
||||
(prin1 exec-path err-buffer)
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "//" nil t)
|
||||
(replace-match "/" nil t))
|
||||
(goto-char (point-min))
|
||||
(setq ret (read err-buffer))
|
||||
(kill-buffer err-buffer)
|
||||
ret
|
||||
))))
|
||||
|
||||
(defun gnats::get-value-from-shell (&rest command)
|
||||
"Execute shell command to get a list of valid values for `variable'."
|
||||
;;
|
||||
(let ((err-buffer (get-buffer-create " *gnats::get-value-from-shell*")))
|
||||
(save-excursion
|
||||
(set-buffer err-buffer)
|
||||
(unwind-protect
|
||||
(condition-case var
|
||||
(progn
|
||||
(apply 'call-process
|
||||
(car command) nil err-buffer nil (cdr command))
|
||||
(goto-char (point-min))
|
||||
(if (looking-at "[-a-z]+: ")
|
||||
(error (buffer-substring (point-min) (point-max))))
|
||||
(read err-buffer))
|
||||
(error nil))
|
||||
(kill-buffer err-buffer)))))
|
||||
|
||||
(or (fboundp 'setenv)
|
||||
(defun setenv (variable &optional value)
|
||||
"Set the value of the environment variable named VARIABLE to VALUE.
|
||||
VARIABLE should be a string. VALUE is optional; if not provided or is
|
||||
`nil', the environment variable VARIABLE will be removed.
|
||||
This function works by modifying `process-environment'."
|
||||
(interactive "sSet environment variable: \nsSet %s to value: ")
|
||||
(if (string-match "=" variable)
|
||||
(error "Environment variable name `%s' contains `='" variable)
|
||||
(let ((pattern (concat "\\`" (regexp-quote (concat variable "="))))
|
||||
(case-fold-search nil)
|
||||
(scan process-environment))
|
||||
(while scan
|
||||
(cond
|
||||
((string-match pattern (car scan))
|
||||
(if (eq nil value)
|
||||
(setq process-environment (delq (car scan)
|
||||
process-environment))
|
||||
(setcar scan (concat variable "=" value)))
|
||||
(setq scan nil))
|
||||
((null (setq scan (cdr scan)))
|
||||
(setq process-environment
|
||||
(cons (concat variable "=" value)
|
||||
process-environment)))))))))
|
||||
|
||||
;;;; end of send-pr.el
|
||||
@@ -1,355 +0,0 @@
|
||||
.\" -*- nroff -*-
|
||||
.\" ---------------------------------------------------------------------------
|
||||
.\" man page for send-pr (by Heinz G. Seidl, [email protected])
|
||||
.\" updated Feb 1993 for GNATS 3.00 by Jeffrey Osier, [email protected]
|
||||
.\"
|
||||
.\" This file is part of the Problem Report Management System (GNATS)
|
||||
.\" Copyright 1992 Cygnus Support
|
||||
.\"
|
||||
.\" This program is free software; you can redistribute it and/or
|
||||
.\" modify it under the terms of the GNU General Public
|
||||
.\" License as published by the Free Software Foundation; either
|
||||
.\" version 2 of the License, or (at your option) any later version.
|
||||
.\"
|
||||
.\" This program is distributed in the hope that it will be useful,
|
||||
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
.\" General Public License for more details.
|
||||
.\"
|
||||
.\" You should have received a copy of the GNU Library General Public
|
||||
.\" License along with this program; if not, write to the Free
|
||||
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
|
||||
.\"
|
||||
.\" ---------------------------------------------------------------------------
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.nh
|
||||
.TH SEND-PR 1 3.113 "October 2006"
|
||||
.SH NAME
|
||||
send-pr \- send problem report (PR) to a central support site
|
||||
.SH SYNOPSIS
|
||||
.B send-pr
|
||||
[
|
||||
.I site
|
||||
]
|
||||
[
|
||||
.B \-f
|
||||
.I problem-report
|
||||
]
|
||||
[
|
||||
.B \-t
|
||||
.I mail-address
|
||||
]
|
||||
.br
|
||||
.in +0.8i
|
||||
[
|
||||
.B \-P
|
||||
]
|
||||
[
|
||||
.B \-L
|
||||
]
|
||||
[
|
||||
.B \-s
|
||||
.I severity
|
||||
]
|
||||
[
|
||||
.B \-V
|
||||
]
|
||||
.br
|
||||
[
|
||||
.B \-\-version
|
||||
]
|
||||
[
|
||||
.B \-c
|
||||
.I address
|
||||
]
|
||||
[
|
||||
.B \-a
|
||||
.I file
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.B send-pr
|
||||
is a tool used to submit
|
||||
.I problem reports
|
||||
.\" SITE ADMINISTRATORS - change this if you use a local default
|
||||
(PRs) to a central support site. In most cases the correct
|
||||
.I site
|
||||
will be the default. This argument indicates the support site which
|
||||
is responsible for the category of problem involved. Some sites may
|
||||
use a local address as a default.
|
||||
.I site
|
||||
values are defined by using the
|
||||
.BR aliases (5).
|
||||
.LP
|
||||
.B send-pr
|
||||
invokes an editor on a problem report template (after trying to fill
|
||||
in some fields with reasonable default values). When you exit the
|
||||
editor,
|
||||
.B send-pr
|
||||
sends the completed form to the
|
||||
.I Problem Report Management System
|
||||
(\fBGNATS\fR) at a central support site. At the support site, the PR
|
||||
is assigned a unique number and is stored in the \fBGNATS\fR database
|
||||
according to its category and submitter-id. \fBGNATS\fR automatically
|
||||
replies with an acknowledgement, citing the category and the PR
|
||||
number.
|
||||
.LP
|
||||
To ensure that a PR is handled promptly, it should contain
|
||||
one of the available \fIcategories\fR to identify the
|
||||
problem area. (Use
|
||||
.B `send-pr -L'
|
||||
to see a list of categories.)
|
||||
.LP
|
||||
The more precise your problem description and the more complete your
|
||||
information, the faster your support team can solve your problems.
|
||||
.LP
|
||||
.B send-pr
|
||||
depends on a correctly configured mail submission system to work correctly.
|
||||
If, for any reason, sending mail is not working, problem reports can be
|
||||
submitted over the web, through:
|
||||
.IP
|
||||
.I http://www.freebsd.org/send-pr.html
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BI \-f " problem-report"
|
||||
specify a file (\fIproblem-report\fR) which already contains a
|
||||
complete problem report.
|
||||
.B send-pr
|
||||
sends the contents of the file without invoking the editor. If
|
||||
the value for
|
||||
.I problem-report
|
||||
is
|
||||
.BR `\|\-\|' ,
|
||||
then
|
||||
.B send-pr
|
||||
reads from standard input.
|
||||
.TP
|
||||
.BI \-s " severity"
|
||||
Give the problem report the severity
|
||||
.IR severity .
|
||||
.TP
|
||||
.BI \-t " mail-address"
|
||||
Change mail address at the support site for problem reports. The
|
||||
default
|
||||
.I mail-address
|
||||
is the address used for the default
|
||||
.IR site .
|
||||
Use the
|
||||
.I site
|
||||
argument rather than this option in nearly all cases.
|
||||
.TP
|
||||
.BI \-c " address"
|
||||
Put
|
||||
.I address
|
||||
in the
|
||||
.B Cc:
|
||||
header of the message.
|
||||
.TP
|
||||
.BI \-a " file"
|
||||
Copy the specified
|
||||
.I file
|
||||
into the
|
||||
.B Fix:
|
||||
section.
|
||||
Binary files are uuencoded.
|
||||
.TP
|
||||
.B \-P
|
||||
print the form specified by the environment variable
|
||||
.B PR_FORM
|
||||
on standard output. If
|
||||
.B PR_FORM
|
||||
is not set, print the standard blank PR template. No mail is sent.
|
||||
.TP
|
||||
.B \-L
|
||||
print the list of available categories. No mail is sent.
|
||||
.TP
|
||||
.B \-V
|
||||
Display the
|
||||
.B send-pr
|
||||
version number.
|
||||
This may also be specified as
|
||||
.B \-\-version.
|
||||
.LP
|
||||
Note: use
|
||||
.B send-pr
|
||||
to submit problem reports rather than mailing them directly. Using
|
||||
both the template and
|
||||
.B send-pr
|
||||
itself will help ensure all necessary information will reach the
|
||||
support site.
|
||||
.SH FREEBSD CATEGORIES
|
||||
.TP
|
||||
.B advocacy
|
||||
This used to be for the advocacy WWW pages.
|
||||
Now deprecated in favour of the
|
||||
.B www
|
||||
category, relevant alternative use of this category is encouraged.
|
||||
.TP
|
||||
.B alpha
|
||||
Alpha processor specific problems.
|
||||
.TP
|
||||
.B amd64
|
||||
AMD64 processor specific problems.
|
||||
.TP
|
||||
.B arm
|
||||
ARM processor specific problems.
|
||||
.TP
|
||||
.B bin
|
||||
Corrections or enhancements to system executables.
|
||||
.TP
|
||||
.B conf
|
||||
Corrections or enhancements to the system configuration files.
|
||||
.TP
|
||||
.B docs
|
||||
Corrections or enhancements to the manpages or other documentation.
|
||||
.TP
|
||||
.B gnu
|
||||
Corrections or enhancements to the GNU contributed software.
|
||||
.TP
|
||||
.B i386
|
||||
Intel x86 processor specific problems.
|
||||
.TP
|
||||
.B ia64
|
||||
Intel ia64 processor specific problems.
|
||||
.TP
|
||||
.B java
|
||||
Problems related to Java.
|
||||
.TP
|
||||
.B kern
|
||||
Changes or enhancements to the architecture independent kernel sources.
|
||||
.TP
|
||||
.B misc
|
||||
Problems that do not fit into any of the other categories.
|
||||
.TP
|
||||
.B ports
|
||||
Corrections or enhancements (including new ports) to the ports collection.
|
||||
.TP
|
||||
.B powerpc
|
||||
PowerPC processor specific problems.
|
||||
.TP
|
||||
.B sparc64
|
||||
SPARC processor specific problems.
|
||||
.TP
|
||||
.B standards
|
||||
Standards conformance issues.
|
||||
.TP
|
||||
.B threads
|
||||
Problems related to threading on FreeBSD.
|
||||
.TP
|
||||
.B usb
|
||||
Problems related to the USB subsystem.
|
||||
.TP
|
||||
.B www
|
||||
Changes or enhancements to the FreeBSD website.
|
||||
.SH ENVIRONMENT
|
||||
The environment variable
|
||||
.B EDITOR
|
||||
specifies the editor to invoke on the template.
|
||||
.br
|
||||
default:
|
||||
.B vi
|
||||
.sp
|
||||
If the environment variable
|
||||
.B MAIL_AGENT
|
||||
is set, its value is used as the path + command line arguments of the
|
||||
executable to be invoked for sending the problem report (which will be
|
||||
provided via standard input).
|
||||
.br
|
||||
This can be useful if you either use a MTA other than sendmail or need
|
||||
to provide additional parameters, such as the envelope sender on
|
||||
machines without a valid FQDN.
|
||||
.br
|
||||
Default value:
|
||||
.B /usr/sbin/sendmail -oi -t
|
||||
.sp
|
||||
If the environment variable
|
||||
.B PR_FORM
|
||||
is set, then its value is used as the file name of the template for
|
||||
your problem-report editing session. You can use this to start with a
|
||||
partially completed form (for example, a form with the identification
|
||||
fields already completed).
|
||||
.SH "HOW TO FILL OUT A PROBLEM REPORT"
|
||||
Problem reports have to be in a particular form so that a program can
|
||||
easily manage them. Please remember the following guidelines:
|
||||
.IP \(bu 3m
|
||||
describe only
|
||||
.B one problem
|
||||
with each problem report.
|
||||
.IP \(bu 3m
|
||||
For follow-up mail, use the same subject line as the one in the automatic
|
||||
acknowledgement. It consists of category, PR number and the original synopsis
|
||||
line. This allows the support site to relate several mail messages to a
|
||||
particular PR and to record them automatically.
|
||||
.IP \(bu 3m
|
||||
Please try to be as accurate as possible in the subject and/or synopsis line.
|
||||
.IP \(bu 3m
|
||||
The subject and the synopsis line are not confidential. This is
|
||||
because open-bugs lists are compiled from them. Avoid confidential
|
||||
information there.
|
||||
.LP
|
||||
See the GNU
|
||||
.B Info
|
||||
file
|
||||
.B send-pr.info
|
||||
or the document \fIReporting Problems With send-pr\fR\ for detailed
|
||||
information on reporting problems
|
||||
.SH "HOW TO SUBMIT TEST CASES, CODE, ETC."
|
||||
Submit small code samples with the PR. Contact the support site for
|
||||
instructions on submitting larger test cases and problematic source
|
||||
code.
|
||||
.SH FILES
|
||||
.ta \w'/tmp/pbad.XXXXXXXX 'u
|
||||
/tmp/pf.XXXXXXXX copy of PR used in editing session
|
||||
.br
|
||||
/tmp/pf.XXXXXXXX copy of empty PR form, for testing purposes
|
||||
.br
|
||||
/tmp/pr.XXXXXXXX copy of filled PR form, created on interrupt
|
||||
.br
|
||||
/tmp/pbad.XXXXXXXX file for rejected PRs
|
||||
.SH EMACS USER INTERFACE
|
||||
An Emacs user interface for
|
||||
.B send-pr
|
||||
with completion of field values is part of the
|
||||
.B send-pr
|
||||
distribution (invoked with
|
||||
.BR "M-x send-pr" ).
|
||||
See the file
|
||||
.B send-pr.info
|
||||
or the ASCII file
|
||||
.B INSTALL
|
||||
in the top level directory of the distribution for configuration and
|
||||
installation information. The Emacs LISP template file is
|
||||
.B send-pr-el.in
|
||||
and is installed as
|
||||
.BR send-pr.el .
|
||||
.SH INSTALLATION AND CONFIGURATION
|
||||
See
|
||||
.B send-pr.info
|
||||
or
|
||||
.B INSTALL
|
||||
for installation instructions.
|
||||
.SH SEE ALSO
|
||||
.I Reporting Problems Using send-pr
|
||||
(also installed as the GNU Info file
|
||||
.BR send-pr.info ).
|
||||
.SH AUTHORS
|
||||
Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus
|
||||
Support)
|
||||
.SH COPYING
|
||||
Copyright (c) 1992, 1993 Free Software Foundation, Inc.
|
||||
.PP
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
.PP
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
.PP
|
||||
Permission is granted to copy and distribute translations of this
|
||||
manual into another language, under the above conditions for modified
|
||||
versions, except that this permission notice may be included in
|
||||
translations approved by the Free Software Foundation instead of in
|
||||
the original English.
|
||||
|
||||
@@ -1,591 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Submit a problem report to a GNATS site.
|
||||
# Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
# Contributed by Brendan Kehoe ([email protected]), based on a
|
||||
# version written by Heinz G. Seidl ([email protected]).
|
||||
#
|
||||
# This file is part of GNU GNATS.
|
||||
#
|
||||
# GNU GNATS is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU GNATS is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU GNATS; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
# The version of this send-pr.
|
||||
VERSION=3.114
|
||||
|
||||
# The submitter-id for your site.
|
||||
# "current-users" is the only allowable value for FreeBSD.
|
||||
SUBMITTER="current-users"
|
||||
|
||||
# Where the GNATS directory lives, if at all.
|
||||
[ -z "$GNATS_ROOT" ] &&
|
||||
GNATS_ROOT=
|
||||
|
||||
# The default mail address for PR submissions.
|
||||
GNATS_ADDR=[email protected]
|
||||
|
||||
# Where the gnats category tree lives.
|
||||
DATADIR=@DATADIR@
|
||||
|
||||
# If we've been moved around, try using GCC_EXEC_PREFIX.
|
||||
[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && DATADIR="$GCC_EXEC_PREFIX"
|
||||
|
||||
# The default release for this host.
|
||||
DEFAULT_RELEASE="@DEFAULT_RELEASE@"
|
||||
|
||||
# The default organization.
|
||||
DEFAULT_ORGANIZATION=
|
||||
|
||||
# The default site to look for.
|
||||
GNATS_SITE=freefall
|
||||
|
||||
# Newer config information?
|
||||
[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
|
||||
|
||||
# What mailer to use. This must come after the config file, since it is
|
||||
# host-dependent.
|
||||
MAIL_AGENT="${MAIL_AGENT:-/usr/sbin/sendmail -oi -t}"
|
||||
|
||||
# Path to pw(8)
|
||||
PW="/usr/sbin/pw"
|
||||
|
||||
ECHON=bsd
|
||||
|
||||
if [ $ECHON = bsd ] ; then
|
||||
ECHON1="echo -n"
|
||||
ECHON2=
|
||||
elif [ $ECHON = sysv ] ; then
|
||||
ECHON1=echo
|
||||
ECHON2='\c'
|
||||
else
|
||||
ECHON1=echo
|
||||
ECHON2=
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
# find a user name
|
||||
if [ "$LOGNAME" = "" ]; then
|
||||
if [ "$USER" != "" ]; then
|
||||
LOGNAME="$USER"
|
||||
else
|
||||
LOGNAME="UNKNOWN"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Find out the name of the originator of this PR.
|
||||
if [ -n "$NAME" ]; then
|
||||
ORIGINATOR="$NAME"
|
||||
elif [ -f $HOME/.fullname ]; then
|
||||
ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
|
||||
else
|
||||
PTEMP=`mktemp -t p` || exit 1
|
||||
PTEMP2=`mktemp -t p` || exit 1
|
||||
# Must use temp file due to incompatibilities in quoting behavior
|
||||
# and to protect shell metacharacters in the expansion of $LOGNAME
|
||||
$ECHON1 $LOGNAME | awk '{print toupper(substr($1,1,1))substr($1,2)}' > $PTEMP2
|
||||
ICLOGNAME="`cat $PTEMP2`"
|
||||
$PW usershow $LOGNAME | awk -F: '{ print $8 }' \
|
||||
| sed -e "s/\&/$ICLOGNAME/" \
|
||||
| sed -e 's/,.*//' > $PTEMP
|
||||
ORIGINATOR="`cat $PTEMP`"
|
||||
rm -f "$PTEMP" "$PTEMP2"
|
||||
fi
|
||||
|
||||
FROM="$ORIGINATOR <$LOGNAME>"
|
||||
REPLY_TO="$ORIGINATOR <${REPLY_TO:-${REPLYTO:-$LOGNAME}}>"
|
||||
|
||||
if [ -n "$ORGANIZATION" ]; then
|
||||
if [ -f "$ORGANIZATION" ]; then
|
||||
ORGANIZATION="`cat $ORGANIZATION`"
|
||||
fi
|
||||
else
|
||||
if [ -n "$DEFAULT_ORGANIZATION" ]; then
|
||||
ORGANIZATION="$DEFAULT_ORGANIZATION"
|
||||
elif [ -f $HOME/.organization ]; then
|
||||
ORGANIZATION="`cat $HOME/.organization`"
|
||||
fi
|
||||
fi
|
||||
|
||||
# If they don't have a preferred editor set, then use
|
||||
if [ -z "$VISUAL" ]; then
|
||||
if [ -z "$EDITOR" ]; then
|
||||
EDIT=vi
|
||||
else
|
||||
EDIT="$EDITOR"
|
||||
fi
|
||||
else
|
||||
EDIT="$VISUAL"
|
||||
fi
|
||||
|
||||
# Find out some information.
|
||||
SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
|
||||
( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
|
||||
ARCH=`[ -f /bin/arch ] && /bin/arch`
|
||||
MACHINE=`[ -f /bin/machine ] && /bin/machine`
|
||||
|
||||
COMMAND=`echo $0 | sed -e 's,.*/,,'`
|
||||
USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
|
||||
[-c address] [-a file] [--version]"
|
||||
REMOVE=
|
||||
BATCH=
|
||||
CC=
|
||||
SEVERITY_C=
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-r) ;; # Ignore for backward compat.
|
||||
-t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
||||
shift ; GNATS_ADDR="$1"
|
||||
EXPLICIT_GNATS_ADDR=true
|
||||
;;
|
||||
-f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
||||
shift ; IN_FILE="$1"
|
||||
if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
|
||||
echo "$COMMAND: cannot read $IN_FILE"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-b | --batch) BATCH=true ;;
|
||||
-c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
||||
shift ; CC="$1"
|
||||
;;
|
||||
-s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
|
||||
shift ; SEVERITY_C="$1"
|
||||
;;
|
||||
-p | -P | --print) PRINT=true ;;
|
||||
-L | --list) FORMAT=norm ;;
|
||||
-l | -CL | --lisp) FORMAT=lisp ;;
|
||||
-h | --help) echo "$USAGE"; exit 0 ;;
|
||||
-V | --version) echo "$VERSION"; exit 0 ;;
|
||||
-a | --attach) if [ -z "$2" ]; then
|
||||
echo "$USAGE" ; exit 1;
|
||||
fi
|
||||
if [ -e "$2" -a ! -d "$2" ]; then
|
||||
PRETTY_NAME=`basename $2`
|
||||
if file $2 | grep "text" >/dev/null 2>/dev/null ; then
|
||||
ATTACHED_FILES="$ATTACHED_FILES
|
||||
--- $PRETTY_NAME begins here ---
|
||||
`cat \"$2\"`
|
||||
--- $PRETTY_NAME ends here ---
|
||||
"
|
||||
else
|
||||
ATTACHED_FILES="$ATTACHED_FILES
|
||||
`uuencode \"$PRETTY_NAME\" < \"$2\"`
|
||||
"
|
||||
fi
|
||||
shift;
|
||||
fi;
|
||||
;;
|
||||
-*) echo "$USAGE" ; exit 1 ;;
|
||||
*) if [ -z "$USER_GNATS_SITE" ]; then
|
||||
if [ ! -r "$DATADIR/gnats/$1" ]; then
|
||||
echo "$COMMAND: the GNATS site $1 does not have a categories list."
|
||||
exit 1
|
||||
else
|
||||
# The site name is the alias they'll have to have created.
|
||||
USER_GNATS_SITE=$1
|
||||
fi
|
||||
else
|
||||
echo "$USAGE" ; exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then
|
||||
GNATS_SITE=$USER_GNATS_SITE
|
||||
GNATS_ADDR=$USER_GNATS_SITE-gnats
|
||||
fi
|
||||
|
||||
if [ "$SUBMITTER" = "unknown" -a -z "$IN_FILE" ]; then
|
||||
SUBMITTER="current-users"
|
||||
fi
|
||||
|
||||
if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
|
||||
CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
|
||||
else
|
||||
echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$CATEGORIES" ]; then
|
||||
echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$FORMAT" in
|
||||
lisp) echo "$CATEGORIES" | \
|
||||
awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
|
||||
exit 0
|
||||
;;
|
||||
norm) l=`echo "$CATEGORIES" | \
|
||||
awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
|
||||
END {print max + 1;}'`
|
||||
c=`expr 70 / $l`
|
||||
if [ $c -eq 0 ]; then c=1; fi
|
||||
echo "$CATEGORIES" | \
|
||||
awk 'BEGIN {print "Known categories:"; i = 0 }
|
||||
{ printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
|
||||
END { print ""; }'
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
ORIGINATOR_C='<name of the PR author (one line)>'
|
||||
ORGANIZATION_C='<organization of PR author (multiple lines)>'
|
||||
CONFIDENTIAL_C='no <FreeBSD PRs are public data>'
|
||||
SYNOPSIS_C='<synopsis of the problem (one line)>'
|
||||
if [ -z "$SEVERITY_C" ]; then
|
||||
SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
|
||||
fi
|
||||
PRIORITY_C='<[ low | medium | high ] (one line)>'
|
||||
CATEGORY_C='<choose from the list of categories above (one line)>'
|
||||
CLASS_C='<[ sw-bug | doc-bug | change-request | update | maintainer-update ] (one line)>'
|
||||
RELEASE_C='<release number or tag (one line)>'
|
||||
ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
|
||||
DESCRIPTION_C='<precise description of the problem (multiple lines)>'
|
||||
HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
|
||||
FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
|
||||
|
||||
# Create temporary files, safely
|
||||
REF=`mktemp -t pf` || exit 1
|
||||
TEMP=`mktemp -t pf` || exit 1
|
||||
# Catch some signals. ($xs kludge needed by Sun /bin/sh)
|
||||
xs=0
|
||||
trap 'rm -f $REF $TEMP; exit $xs' 0
|
||||
trap 'SAV=`mktemp -t pr`;echo "$COMMAND: Aborting ... saving unfinished PR into $SAV"; rm -f $REF ; mv $TEMP $SAV; xs=1; exit' 1 2 3 13 15
|
||||
|
||||
# If they told us to use a specific file, then do so.
|
||||
if [ -n "$IN_FILE" ]; then
|
||||
if [ "$IN_FILE" = "-" ]; then
|
||||
# The PR is coming from the standard input.
|
||||
if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
|
||||
sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
|
||||
else
|
||||
cat > $TEMP
|
||||
fi
|
||||
else
|
||||
# Use the file they named.
|
||||
if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
|
||||
sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
|
||||
else
|
||||
cat $IN_FILE > $TEMP
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
|
||||
# If their PR_FORM points to a bogus entry, then bail.
|
||||
if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
|
||||
echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
|
||||
sleep 1
|
||||
PRINT_INTERN=bad_prform
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
|
||||
cp $PR_FORM $TEMP ||
|
||||
( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
|
||||
[ -n "$ATTACHED_FILES" ] && echo "$ATTACHED_FILES" >> $TEMP
|
||||
else
|
||||
for file in $TEMP $REF ; do
|
||||
cat > $file << '__EOF__'
|
||||
SEND-PR: -*- send-pr -*-
|
||||
SEND-PR: vim: syntax=sendpr
|
||||
SEND-PR:
|
||||
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
|
||||
SEND-PR: will all comments (text enclosed in `<' and `>').
|
||||
SEND-PR:
|
||||
SEND-PR: Please consult the following URL if you are not sure how to
|
||||
SEND-PR: fill out a problem report:
|
||||
SEND-PR: http://www.freebsd.org/doc/en/articles/problem-reports/
|
||||
SEND-PR:
|
||||
SEND-PR: Note that the Synopsis field is mandatory.
|
||||
SEND-PR:
|
||||
SEND-PR: Please note that (unless you state otherwise) if your report
|
||||
SEND-PR: includes a patch then it will be taken under the same license as
|
||||
SEND-PR: the one on the file(s) you want to change.
|
||||
SEND-PR:
|
||||
SEND-PR: BE ADVISED THAT FREEBSD PROBLEM REPORTS ARE PUBLIC INFORMATION AND
|
||||
SEND-PR: WILL BE PUBLISHED AS-IS ON THE PROJECT'S MAILING LISTS AND WEB SITES.
|
||||
SEND-PR: DO NOT SUBMIT ANY INFORMATION YOU DO NOT WANT MADE PUBLIC.
|
||||
SEND-PR:
|
||||
SEND-PR: If you wish to submit a problem report confidentially, then contact
|
||||
SEND-PR: the FreeBSD bugmaster ([email protected]) to arrange for a
|
||||
SEND-PR: relevant developer to be contacted.
|
||||
SEND-PR:
|
||||
SEND-PR: For sensitive security issues, consider contacting the FreeBSD
|
||||
SEND-PR: security officer team ([email protected]) directly.
|
||||
SEND-PR:
|
||||
SEND-PR: Choose from the following categories:
|
||||
SEND-PR:
|
||||
__EOF__
|
||||
|
||||
# Format the categories so they fit onto lines.
|
||||
l=`echo "$CATEGORIES" | \
|
||||
awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
|
||||
END {print max + 1;}'`
|
||||
c=`expr 61 / $l`
|
||||
if [ $c -eq 0 ]; then c=1; fi
|
||||
echo "$CATEGORIES" | \
|
||||
awk 'BEGIN {printf "SEND-PR: "; i = 0 }
|
||||
{ printf ("%-'$l'.'$l's", $0);
|
||||
if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
|
||||
END { printf "\nSEND-PR:\n"; }' >> $file
|
||||
|
||||
cat >> $file << __EOF__
|
||||
To: $GNATS_ADDR
|
||||
From: $FROM
|
||||
Reply-To: $REPLY_TO
|
||||
Cc: $CC
|
||||
X-send-pr-version: $VERSION
|
||||
X-GNATS-Notify:
|
||||
|
||||
|
||||
>Submitter-Id: $SUBMITTER
|
||||
>Originator: $ORIGINATOR
|
||||
>Organization: ${ORGANIZATION-$ORGANIZATION_C}
|
||||
>Confidential: $CONFIDENTIAL_C
|
||||
>Synopsis: $SYNOPSIS_C
|
||||
>Severity: $SEVERITY_C
|
||||
>Priority: $PRIORITY_C
|
||||
>Category: $CATEGORY_C
|
||||
>Class: $CLASS_C
|
||||
>Release: ${DEFAULT_RELEASE-$RELEASE_C}
|
||||
>Environment:
|
||||
`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
|
||||
`[ -n "$ARCH" ] && echo Architecture: $ARCH`
|
||||
`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
|
||||
$ENVIRONMENT_C
|
||||
>Description:
|
||||
$DESCRIPTION_C
|
||||
>How-To-Repeat:
|
||||
$HOW_TO_REPEAT_C
|
||||
>Fix:
|
||||
|
||||
$FIX_C
|
||||
$ATTACHED_FILES
|
||||
|
||||
__EOF__
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
|
||||
cat $TEMP
|
||||
xs=0; exit
|
||||
fi
|
||||
|
||||
chmod u+w $TEMP
|
||||
eval $EDIT $TEMP
|
||||
|
||||
if cmp -s $REF $TEMP ; then
|
||||
echo "$COMMAND: problem report not filled out, therefore not sent"
|
||||
xs=1; exit
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Check the enumeration fields
|
||||
|
||||
# This is a "sed-subroutine" with one keyword parameter
|
||||
# (with workaround for Sun sed bug)
|
||||
#
|
||||
SED_CMD='{
|
||||
s|||
|
||||
s|<.*>||
|
||||
s|^[ ]*||
|
||||
s|[ ]*$||
|
||||
p
|
||||
q
|
||||
}'
|
||||
|
||||
|
||||
while true; do
|
||||
CNT=0
|
||||
|
||||
# 1) Confidential
|
||||
#
|
||||
PATTERN=">Confidential:"
|
||||
CONFIDENTIAL=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
|
||||
case "$CONFIDENTIAL" in
|
||||
""|no) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
|
||||
esac
|
||||
#
|
||||
# 2) Severity
|
||||
#
|
||||
PATTERN=">Severity:"
|
||||
SEVERITY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
|
||||
case "$SEVERITY" in
|
||||
""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
|
||||
esac
|
||||
#
|
||||
# 3) Priority
|
||||
#
|
||||
PATTERN=">Priority:"
|
||||
PRIORITY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
|
||||
case "$PRIORITY" in
|
||||
""|low|medium|high) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
|
||||
esac
|
||||
#
|
||||
# 4) Category
|
||||
#
|
||||
PATTERN=">Category:"
|
||||
CATEGORY=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
|
||||
FOUND=
|
||||
for C in $CATEGORIES
|
||||
do
|
||||
if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
|
||||
done
|
||||
if [ -n "$FOUND" ]; then
|
||||
CNT=`expr $CNT + 1`
|
||||
else
|
||||
if [ -z "$CATEGORY" ]; then
|
||||
echo "$COMMAND: you must include a Category: field in your report."
|
||||
else
|
||||
echo "$COMMAND: \`$CATEGORY' is not a known category."
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# 5) Class
|
||||
#
|
||||
PATTERN=">Class:"
|
||||
CLASS=`eval sed -n -e "\"/$PATTERN/$SED_CMD\"" $TEMP`
|
||||
case "$CLASS" in
|
||||
""|sw-bug|doc-bug|change-request|update|maintainer-update) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
|
||||
esac
|
||||
#
|
||||
# 6) Check that synopsis is not empty
|
||||
#
|
||||
if grep "^>Synopsis:[ ]*${SYNOPSIS_C}\$" $TEMP > /dev/null
|
||||
then
|
||||
echo "$COMMAND: Synopsis must not be empty."
|
||||
else
|
||||
CNT=`expr $CNT + 1`
|
||||
fi
|
||||
|
||||
[ $CNT -lt 6 -a -z "$BATCH" ] &&
|
||||
echo "Errors were found with the problem report."
|
||||
|
||||
while true; do
|
||||
if [ -z "$BATCH" ]; then
|
||||
$ECHON1 "s)end, e)dit or a)bort? $ECHON2"
|
||||
read input
|
||||
else
|
||||
if [ $CNT -eq 6 ]; then
|
||||
input=s
|
||||
else
|
||||
input=a
|
||||
fi
|
||||
fi
|
||||
case "$input" in
|
||||
a*)
|
||||
if [ -z "$BATCH" ]; then
|
||||
BAD=`mktemp -t pbad`
|
||||
echo "$COMMAND: the problem report remains in $BAD and is not sent."
|
||||
mv $TEMP $BAD
|
||||
else
|
||||
echo "$COMMAND: the problem report is not sent."
|
||||
fi
|
||||
xs=1; exit
|
||||
;;
|
||||
e*)
|
||||
eval $EDIT $TEMP
|
||||
continue 2
|
||||
;;
|
||||
s*)
|
||||
if [ $CNT -lt 6 ]; then
|
||||
if [ -z "$BATCH" ]; then
|
||||
echo "But there are still errors in the problem report!"
|
||||
continue 2
|
||||
else
|
||||
echo "Errors found in PR"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
break 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
|
||||
#
|
||||
# Remove the subject field if one is already there. There's no reason
|
||||
# for it to be any different than the synopsis.
|
||||
#
|
||||
if grep '^Subject:' $TEMP > /dev/null
|
||||
then
|
||||
ed -s $TEMP << __EOF__
|
||||
/^Subject:/d
|
||||
w
|
||||
q
|
||||
__EOF__
|
||||
fi
|
||||
|
||||
#
|
||||
# Add the subject field with the value of $SYNOPSIS. We use the To:
|
||||
# field as an anchor, which had better be there.
|
||||
#
|
||||
SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//' |
|
||||
sed -e "s;$SYNOPSIS_C;;"`
|
||||
ed -s $TEMP << __EOF__
|
||||
/^To:/a
|
||||
Subject: $SYNOPSIS
|
||||
.
|
||||
w
|
||||
q
|
||||
__EOF__
|
||||
|
||||
#
|
||||
# Remove comments and send the problem report
|
||||
# (we have to use patterns, where the comment contains regex chars)
|
||||
#
|
||||
# /^>Originator:/s;$ORIGINATOR;;
|
||||
sed -e "
|
||||
/^SEND-PR:/d
|
||||
/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
|
||||
/^>Confidential:/s;<.*>;;
|
||||
/^>Synopsis:/s;$SYNOPSIS_C;;
|
||||
/^>Severity:/s;<.*>;;
|
||||
/^>Priority:/s;<.*>;;
|
||||
/^>Category:/s;$CATEGORY_C;;
|
||||
/^>Class:/s;<.*>;;
|
||||
/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
|
||||
/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
|
||||
/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
|
||||
/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
|
||||
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
||||
" $TEMP > $REF
|
||||
|
||||
if $MAIL_AGENT < $REF; then
|
||||
echo "$COMMAND: problem report sent"
|
||||
xs=0; exit
|
||||
else
|
||||
echo "$COMMAND: mysterious mail failure."
|
||||
if [ -z "$BATCH" ]; then
|
||||
BAD=`mktemp -t pbad`
|
||||
echo "$COMMAND: the problem report remains in $BAD and is not sent."
|
||||
mv $TEMP $BAD
|
||||
else
|
||||
echo "$COMMAND: the problem report is not sent."
|
||||
fi
|
||||
xs=1; exit
|
||||
fi
|
||||
@@ -65,5 +65,5 @@ static const struct {
|
||||
sizeof(int32_t),
|
||||
ABI_NOTETYPE,
|
||||
ABI_VENDOR,
|
||||
__FreeBSD_version
|
||||
903000
|
||||
};
|
||||
+81
-30
@@ -62,12 +62,15 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/if_types.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <sys/queue.h>
|
||||
#ifdef INET6
|
||||
#include <net/if_var.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet6/in6_var.h> /* XXX */
|
||||
#include <netinet6/in6_var.h>
|
||||
#include <netinet6/nd6.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
@@ -244,6 +247,9 @@ static int get_portmatch(const struct addrinfo *, const char *);
|
||||
static int get_port(struct addrinfo *, const char *, int);
|
||||
static const struct afd *find_afd(int);
|
||||
static int addrconfig(struct addrinfo *);
|
||||
#ifdef INET6
|
||||
static int is_ifdisabled(char *);
|
||||
#endif
|
||||
static void set_source(struct ai_order *, struct policyhead *);
|
||||
static int comp_dst(const void *, const void *);
|
||||
#ifdef INET6
|
||||
@@ -1001,7 +1007,8 @@ comp_dst(const void *arg1, const void *arg2)
|
||||
* We compare the match length in a same AF only.
|
||||
*/
|
||||
if (dst1->aio_ai->ai_addr->sa_family ==
|
||||
dst2->aio_ai->ai_addr->sa_family) {
|
||||
dst2->aio_ai->ai_addr->sa_family &&
|
||||
dst1->aio_ai->ai_addr->sa_family != AF_INET) {
|
||||
if (dst1->aio_matchlen > dst2->aio_matchlen) {
|
||||
return(-1);
|
||||
}
|
||||
@@ -1520,10 +1527,11 @@ find_afd(int af)
|
||||
}
|
||||
|
||||
/*
|
||||
* post-2553: AI_ADDRCONFIG check. if we use getipnodeby* as backend, backend
|
||||
* will take care of it.
|
||||
* the semantics of AI_ADDRCONFIG is not defined well. we are not sure
|
||||
* if the code is right or not.
|
||||
* RFC 3493: AI_ADDRCONFIG check. Determines which address families are
|
||||
* configured on the local system and correlates with pai->ai_family value.
|
||||
* If an address family is not configured on the system, it will not be
|
||||
* queried for. For this purpose, loopback addresses are not considered
|
||||
* configured addresses.
|
||||
*
|
||||
* XXX PF_UNSPEC -> PF_INET6 + PF_INET mapping needs to be in sync with
|
||||
* _dns_getaddrinfo.
|
||||
@@ -1531,37 +1539,80 @@ find_afd(int af)
|
||||
static int
|
||||
addrconfig(struct addrinfo *pai)
|
||||
{
|
||||
int s, af;
|
||||
struct ifaddrs *ifaddrs, *ifa;
|
||||
struct sockaddr_in *sin;
|
||||
#ifdef INET6
|
||||
struct sockaddr_in6 *sin6;
|
||||
#endif
|
||||
int seen_inet = 0, seen_inet6 = 0;
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Note that implementation dependent test for address
|
||||
* configuration should be done everytime called
|
||||
* (or apropriate interval),
|
||||
* because addresses will be dynamically assigned or deleted.
|
||||
*/
|
||||
af = pai->ai_family;
|
||||
if (af == AF_UNSPEC) {
|
||||
if ((s = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
|
||||
af = AF_INET;
|
||||
else {
|
||||
_close(s);
|
||||
if ((s = _socket(AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
af = AF_INET6;
|
||||
else
|
||||
_close(s);
|
||||
if (getifaddrs(&ifaddrs) != 0)
|
||||
return (0);
|
||||
|
||||
for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
|
||||
if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0)
|
||||
continue;
|
||||
switch (ifa->ifa_addr->sa_family) {
|
||||
case AF_INET:
|
||||
if (seen_inet)
|
||||
continue;
|
||||
sin = (struct sockaddr_in *)(ifa->ifa_addr);
|
||||
if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr)))
|
||||
continue;
|
||||
seen_inet = 1;
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
if (seen_inet6)
|
||||
continue;
|
||||
sin6 = (struct sockaddr_in6 *)(ifa->ifa_addr);
|
||||
if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))
|
||||
continue;
|
||||
if ((ifa->ifa_flags & IFT_LOOP) != 0 &&
|
||||
IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
|
||||
continue;
|
||||
if (is_ifdisabled(ifa->ifa_name))
|
||||
continue;
|
||||
seen_inet6 = 1;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (af != AF_UNSPEC) {
|
||||
if ((s = _socket(af, SOCK_DGRAM, 0)) < 0)
|
||||
return 0;
|
||||
_close(s);
|
||||
freeifaddrs(ifaddrs);
|
||||
|
||||
switch(pai->ai_family) {
|
||||
case AF_INET6:
|
||||
return (seen_inet6);
|
||||
case AF_INET:
|
||||
return (seen_inet);
|
||||
case AF_UNSPEC:
|
||||
if (seen_inet == seen_inet6)
|
||||
return (seen_inet);
|
||||
pai->ai_family = seen_inet ? AF_INET : AF_INET6;
|
||||
return (1);
|
||||
}
|
||||
pai->ai_family = af;
|
||||
return 1;
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifdef INET6
|
||||
static int
|
||||
is_ifdisabled(char *name)
|
||||
{
|
||||
struct in6_ndireq nd;
|
||||
int fd;
|
||||
|
||||
if ((fd = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
|
||||
return (-1);
|
||||
memset(&nd, 0, sizeof(nd));
|
||||
strlcpy(nd.ifname, name, sizeof(nd.ifname));
|
||||
if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) {
|
||||
_close(fd);
|
||||
return (-1);
|
||||
}
|
||||
_close(fd);
|
||||
return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0);
|
||||
}
|
||||
|
||||
/* convert a string to a scope identifier. XXX: IPv6 specific */
|
||||
static int
|
||||
ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
&os;.</para>
|
||||
|
||||
<para>This errata document for &os; &release.current;
|
||||
will be maintained until the release of &os; &release.next;.</para>
|
||||
will be maintained until the EoL of &os; &release.branch;.</para>
|
||||
</abstract>
|
||||
</info>
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
|
||||
<para>The procedure for doing a source code based update is
|
||||
described in
|
||||
<uri xlink:href="&url.books.handbook;/synching.html">&url.books.handbook;/synching.html</uri> and
|
||||
<uri xlink:href="&url.books.handbook;/makeworld.html">&url.books.handbook;/makeworld.html</uri>.</para>
|
||||
<uri xlink:href="&url.books.handbook;/synching.html">Synchronizing Source</uri> and
|
||||
<uri xlink:href="&url.books.handbook;/makeworld.html">Rebuilding World</uri>.</para>
|
||||
|
||||
<para>For SVN use the <filename>releng/9.3</filename> branch
|
||||
which will be where any upcoming Security Advisories or Errata
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
<para>Due to changes in the way that &os; is packaged on the
|
||||
release media, two complications may arise in this process if
|
||||
upgrading from FreeBSD 7.x or 8.x:</para>
|
||||
upgrading from FreeBSD 8.x:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
@@ -134,7 +134,7 @@
|
||||
<screen>&prompt.root; freebsd-update install</screen>
|
||||
|
||||
<para>At this point, users of systems being upgraded from &os;
|
||||
8.2-RELEASE or earlier will be prompted by
|
||||
8.4-RELEASE or earlier will be prompted by
|
||||
&man.freebsd-update.8; to rebuild all third-party applications
|
||||
(e.g., ports installed from the ports tree) due to updates in
|
||||
system libraries.</para>
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
please send mail to the &a.questions;.</para>
|
||||
|
||||
<para>If you're tracking the &release.branch; development efforts, you
|
||||
<emphasis>must</emphasis> join the &a.current;, in order to
|
||||
<emphasis>must</emphasis> join the &a.stable;, in order to
|
||||
keep abreast of recent developments and changes that may
|
||||
affect the way you use and maintain the system.</para>
|
||||
|
||||
@@ -235,22 +235,20 @@
|
||||
problems you may find. Bug reports with attached fixes are of
|
||||
course even more welcome.</para>
|
||||
|
||||
<para>The preferred method to submit bug reports from a machine
|
||||
with Internet mail connectivity is to use the &man.send-pr.1;
|
||||
command.
|
||||
<para>The method to submit bug reports from a machine
|
||||
with Internet mail connectivity is to use the <link
|
||||
xlink:href="https://bugs.freebsd.org/submit/">Bugzilla web
|
||||
interface</link>.
|
||||
<quote>Problem Reports</quote> (PRs) submitted in this way
|
||||
will be filed and their progress tracked; the &os; developers
|
||||
will do their best to respond to all reported bugs as soon as
|
||||
possible. <link xlink:href="http://www.FreeBSD.org/cgi/query-pr-summary.cgi">A list
|
||||
of all active PRs</link> is available on the &os; Web site;
|
||||
this list is useful to see what potential problems other users
|
||||
possible. A <link xlink:href="https://bugs.freebsd.org/search/">search
|
||||
interface</link> of all active PRs is available;
|
||||
this list is useful to find what potential problems other users
|
||||
have encountered.</para>
|
||||
|
||||
<para>Note that &man.send-pr.1; itself is a shell script that
|
||||
should be easy to move even onto a non-&os; system. Using
|
||||
this interface is highly preferred. If, for some reason, you
|
||||
are unable to use &man.send-pr.1; to submit a bug report, you
|
||||
can try to send it to the &a.bugs;.</para>
|
||||
<para>Note that &man.send-pr.1; is a stub shell script, and
|
||||
instructs to use the Bugzilla interface.</para>
|
||||
|
||||
<para>For more information, <link xlink:href="&url.articles.problem-reports;/"><quote>Writing
|
||||
&os; Problem Reports</quote></link>, available on the &os; Web
|
||||
@@ -320,7 +318,7 @@
|
||||
other copies are kept updated on the Internet and should be
|
||||
consulted as the <quote>current errata</quote> for this
|
||||
release. These other copies of the errata are located at
|
||||
<uri xlink:href="&url.base;/releases/">&url.base;/releases/</uri> (as
|
||||
<uri xlink:href="&url.base;/releases/">the &os; releases page</uri> (as
|
||||
well as any sites which keep up-to-date mirrors of this
|
||||
location).</para>
|
||||
</note>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<row>
|
||||
<entry><link
|
||||
xlink:href="http://security.freebsd.org/advisories/FreeBSD-SA-14:01.bsnmpd.asc">FreeBSD-SA-14:01.bsnmpd</link></entry>
|
||||
<entry>1 January 2014</entry>
|
||||
<entry>14 January 2014</entry>
|
||||
<entry><para>Fix &man.bsnmpd.1; remote denial of service
|
||||
vulnerability</para></entry>
|
||||
</row>
|
||||
@@ -118,7 +118,7 @@
|
||||
<row>
|
||||
<entry><link
|
||||
xlink:href="http://security.freebsd.org/advisories/FreeBSD-SA-14:02.ntpd.asc">FreeBSD-SA-14:02.ntpd</link></entry>
|
||||
<entry>1 January 2014</entry>
|
||||
<entry>14 January 2014</entry>
|
||||
<entry><para>Disable <quote>monitor</quote> feature in
|
||||
&man.ntpd.8; by default</para></entry>
|
||||
</row>
|
||||
@@ -126,7 +126,7 @@
|
||||
<row>
|
||||
<entry><link
|
||||
xlink:href="http://security.freebsd.org/advisories/FreeBSD-SA-14:04.bind.asc">FreeBSD-SA-14:04.bind</link></entry>
|
||||
<entry>1 January 2014</entry>
|
||||
<entry>14 January 2014</entry>
|
||||
<entry><para>Remote denial of service
|
||||
vulnerability</para></entry>
|
||||
</row>
|
||||
@@ -182,6 +182,19 @@
|
||||
<entry>5 June 2014</entry>
|
||||
<entry><para>Multiple vulnerabilities</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><link xlink:href="http://www.freebsd.org/security/advisories/FreeBSD-SA-14:16.file.asc">FreeBSD-SA-14:16.file</link></entry>
|
||||
<entry>24 June 2014</entry>
|
||||
<entry><para>Multiple vulnerabilities</para></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><link xlink:href="http://www.freebsd.org/security/advisories/FreeBSD-SA-14:17.kmem.asc">FreeBSD-SA-14:17.kmem</link></entry>
|
||||
<entry>8 July 2014</entry>
|
||||
<entry><para>Kernel memory disclosure in control
|
||||
messages and SCTP notifications</para></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
@@ -225,8 +238,8 @@
|
||||
<para revision="257373">A deadlock triggered by powering off
|
||||
a USB device has been fixed.</para>
|
||||
|
||||
<para revision="258214">The &man.ata.4; driver has been updated
|
||||
to support Intel Lynx Point PCH SMBus devices.</para>
|
||||
<para revision="258214">The &man.ichsmb.4; driver has been
|
||||
updated to support Intel Lynx Point PCH SMBus devices.</para>
|
||||
|
||||
<para revision="258215">The &man.ata.4; driver has been updated
|
||||
to support Coleto Creek devices.</para>
|
||||
@@ -327,7 +340,7 @@
|
||||
<literal>libzfs</literal>.</para>
|
||||
|
||||
<para revision="263817,263818" contrib="sponsor"
|
||||
sponsor="&ff;">The <literal>vt</literal> driver
|
||||
sponsor="&ff;">The &man.vt.4; driver
|
||||
has been merged from <literal>head/</literal>.</para>
|
||||
|
||||
<para revision="265729" contrib="sponsor"
|
||||
@@ -535,12 +548,6 @@
|
||||
numeric parameters to a flag as being treated as additional
|
||||
flags has been fixed.</para>
|
||||
|
||||
<para revision="262124">The default number of &man.nfsd.8;
|
||||
threads has been increased from <literal>4</literal> to
|
||||
<literal>(8 * N)</literal>, where <literal>N</literal> is
|
||||
the number of CPUs as reported by
|
||||
<command>sysctl -n hw.ncpu</command>.</para>
|
||||
|
||||
<para revision="262134">The &man.pciconf.8; utility now has
|
||||
a <literal>-V</literal> flag, which lists information such
|
||||
as serial numbers for each device.</para>
|
||||
@@ -656,6 +663,13 @@
|
||||
ends event collection after the specified number of
|
||||
seconds.</para>
|
||||
|
||||
<para revision="267911">The &os; Project has migrated
|
||||
from the <application>GNATS</application> bug tracking system
|
||||
to <application>Bugzilla</application>. The &man.send-pr.1;
|
||||
utility used for submitting problem reports has been replaced
|
||||
with a stub shell script that instructs to use the Bugzilla
|
||||
web interface.</para>
|
||||
|
||||
<sect3 xml:id="periodic-scripts">
|
||||
<title>&man.periodic.8; Scripts</title>
|
||||
|
||||
@@ -701,6 +715,82 @@
|
||||
been updated to version 0.9.8za.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="ports">
|
||||
<title>Ports and Packages</title>
|
||||
|
||||
<important>
|
||||
<para>Note to &os; desktop users: please read this section
|
||||
carefully, especially before upgrading ports that
|
||||
depend on <application>Xorg</application>.</para>
|
||||
</important>
|
||||
|
||||
<para>In April 2014, the &os; Ports collection switched to a
|
||||
newer version of <application>Xorg</application> that supports
|
||||
<acronym>KMS</acronym> (Kernel Mode Setting).</para>
|
||||
|
||||
<para>Users upgrading from earlier versions of &os; 9.x or
|
||||
&os; 8.x should be aware of several things regarding
|
||||
<application>Xorg</application>:</para>
|
||||
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>When applications are built from the &os; Ports
|
||||
Collection or installed from the <literal><link
|
||||
xlink:href="https://lists.freebsd.org/pipermail/freebsd-announce/2014-July/001570.html">new_xorg</link></literal>
|
||||
&man.pkg.8; repository, the newer, KMS-aware version of
|
||||
<application>Xorg</application> is used.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The <acronym>KMS</acronym> version of
|
||||
<application>Xorg</application> does not switch back to
|
||||
text mode after leaving the X desktop environment, and
|
||||
the system console will not be visible. The new
|
||||
&man.vt.4; console driver supports graphic consoles and
|
||||
keeps the console visible after X has exited. The
|
||||
&man.vt.4; driver must be compiled into the kernel.
|
||||
A <filename>VT</filename> kernel configuration example
|
||||
file is included in &release.current;, but is not
|
||||
compiled or enabled by default. See &man.vt.4; and the
|
||||
<link
|
||||
xlink:href="https://wiki.freebsd.org/VT">vt(4) wiki
|
||||
page</link> for additional information.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Packages for <application>KDE4</application> are not
|
||||
available in the default (<literal>latest</literal>)
|
||||
&man.pkg.8; repository, however are available in the
|
||||
<literal>new_xorg</literal> repository. See the <link
|
||||
xlink:href="https://lists.freebsd.org/pipermail/freebsd-announce/2014-July/001570.html">announcement
|
||||
email</link> for details on how to use the
|
||||
<literal>new_xorg</literal> repository.</para>
|
||||
|
||||
<para>The older <application>Xorg</application> that does
|
||||
not support <acronym>KMS</acronym> can still be
|
||||
installed from the <literal>latest</literal> upstream
|
||||
&man.pkg.8; repository and the packages included on the
|
||||
&release.current; DVD.</para>
|
||||
|
||||
<para>However, it is important to note that some newer
|
||||
applications require the newer
|
||||
<application>Xorg</application>, and will not work with
|
||||
the old version. The newer
|
||||
<application>Xorg</application> is recommended, and
|
||||
should be used unless not compatible with legacy
|
||||
graphics cards.</para>
|
||||
|
||||
<para>To continue using the old version of
|
||||
<application>Xorg</application> when building from the
|
||||
&os; Ports Collection, set
|
||||
<literal>WITHOUT_NEW_XORG=yes</literal> in
|
||||
&man.make.conf.5;.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="releng">
|
||||
<title>Release Engineering and Integration</title>
|
||||
|
||||
@@ -744,12 +834,10 @@
|
||||
supported using to the instructions in
|
||||
<filename>/usr/src/UPDATING</filename>.</para>
|
||||
|
||||
<?ignore
|
||||
<para>For more specific information about upgrading
|
||||
instructions, see <uri
|
||||
xlink:href="http://www.FreeBSD.org/releases/9.3R/installation.html">http://www.FreeBSD.org/releases/9.3R/installation.html</uri>.</para>
|
||||
|
||||
?>
|
||||
<important>
|
||||
<para>Upgrading &os; should only be attempted
|
||||
after backing up <emphasis>all</emphasis> data and
|
||||
@@ -761,10 +849,10 @@
|
||||
<title xml:id="upgrade-pitfalls">User-Visible
|
||||
Incompatibilities</title>
|
||||
|
||||
<para>&os; 9.0 and later have several incompatibilities in
|
||||
system configuration which you might want to know before
|
||||
upgrading your system. <emphasis>Please read this section and
|
||||
the <link
|
||||
<para>&os; 9.0 and later versions have several
|
||||
configuration incompatibilities with earlier versions of &os;.
|
||||
These differences are best understood before upgrading.
|
||||
<emphasis>Please read this section and the <link
|
||||
xlink:href="http://www.freebsd.org/releases/9.0R/relnotes-detailed.html#UPGRADE">Upgrading
|
||||
Section in 9.0-RELEASE Release Notes</link> carefully
|
||||
before submitting a problem report and/or posting a question
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
contacting <<a href="mailto:[email protected]">[email protected]</a>>.</small></p>
|
||||
|
||||
<p align="center"><small>All users of FreeBSD <xsl:value-of select="$release.branch"/> should
|
||||
subscribe to the <<a href="mailto:current@FreeBSD.org">current@FreeBSD.org</a>>
|
||||
subscribe to the <<a href="mailto:stable@FreeBSD.org">stable@FreeBSD.org</a>>
|
||||
mailing list.</small></p>
|
||||
|
||||
<p align="center"><small>For questions about this documentation,
|
||||
|
||||
@@ -12,7 +12,7 @@ UNITEXTS= hardware readme relnotes errata
|
||||
|
||||
IMAGEDIR= .imagedir
|
||||
RHOST= freefall.freebsd.org
|
||||
RDIR= public_html/relnotes/RELENG_9
|
||||
RDIR= public_html/relnotes/releng/9.3
|
||||
DOCDIR= ./release/doc
|
||||
LANG= en_US.ISO8859-1
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
<!-- WARNING: Do not forget to also change the release type in
|
||||
doc.relnotes.mk when updating this -->
|
||||
<!ENTITY release.type "snapshot">
|
||||
<!ENTITY release.type "release">
|
||||
<!ENTITY % release.type.current "IGNORE">
|
||||
<!ENTITY % release.type.snapshot "INCLUDE">
|
||||
<!ENTITY % release.type.release "IGNORE">
|
||||
<!ENTITY % release.type.snapshot "IGNORE">
|
||||
<!ENTITY % release.type.release "INCLUDE">
|
||||
|
||||
<![%release.type.current;[
|
||||
<!ENTITY release '&release.current;'>
|
||||
@@ -48,7 +48,7 @@
|
||||
<!ENTITY release.manpath.xorg "7.5.2">
|
||||
<!ENTITY release.manpath.netbsd "6.0">
|
||||
<!ENTITY release.manpath.freebsd-ports "Ports">
|
||||
<!ENTITY release.manpath.freebsd "9.2-RELEASE">
|
||||
<!ENTITY release.manpath.freebsd "9.3-RELEASE">
|
||||
|
||||
<!-- Text constants which probably don't need to be changed.-->
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# $FreeBSD$
|
||||
release: {
|
||||
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
|
||||
url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_3",
|
||||
mirror_type: "srv",
|
||||
signature_type: "fingerprints",
|
||||
fingerprints: "/usr/share/keys/pkg",
|
||||
|
||||
@@ -28,7 +28,7 @@ www/firefox
|
||||
www/links
|
||||
x11-drivers/xf86-video-vmware
|
||||
x11/gnome2
|
||||
x11/kde4
|
||||
x11-wm/xfce4
|
||||
x11/xorg"
|
||||
|
||||
# If NOPORTS is set for the release, do not attempt to build pkg(8).
|
||||
|
||||
+8
-11
@@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 9, 2014
|
||||
.Dd June 27, 2014
|
||||
.Dt "VIRTUAL TERMINALS" 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -37,7 +37,6 @@
|
||||
.Cd "options VT_FB_DEFAULT_WIDTH=X"
|
||||
.Cd "options VT_FB_DEFAULT_HEIGHT=Y"
|
||||
.Cd "options SC_NO_CUTPASTE"
|
||||
.Cd "options SC_NO_SYSMOUSE"
|
||||
.Cd "device vt"
|
||||
.Pp
|
||||
In
|
||||
@@ -139,7 +138,6 @@ version.
|
||||
.It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
|
||||
.It Dv VT_MAXWINDOWS Ta Dv MAXCONS
|
||||
.It none Ta Dv SC_NO_CUTPASTE
|
||||
.It none Ta Dv SC_NO_SYSMOUSE
|
||||
.El
|
||||
.Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
|
||||
The computer BIOS starts in text mode, and
|
||||
@@ -153,13 +151,13 @@ is set, the system remains in text mode.
|
||||
Otherwise,
|
||||
.Nm
|
||||
switches to 640x480x16 VGA mode using
|
||||
.Fn vt_vga .
|
||||
.Xr vt_vga 4 .
|
||||
If a KMS
|
||||
.Pq Kernel Mode Switching
|
||||
video driver is available, the display is switched to high resolution
|
||||
and the KMS driver takes over.
|
||||
When a KMS driver is not available,
|
||||
.Fn vt_vga
|
||||
.Xr vt_vga 4
|
||||
remains active.
|
||||
.Sh LOADER TUNABLES
|
||||
These settings can be entered at the
|
||||
@@ -201,12 +199,11 @@ terminal initialization information
|
||||
.Xr kbdmux 8 ,
|
||||
.Xr kldload 8 ,
|
||||
.Xr moused 8
|
||||
.\" WB: to be uncommented when an actual release contains vt(4)
|
||||
.\" .Sh HISTORY
|
||||
.\" The
|
||||
.\" Nm
|
||||
.\" driver first appeared in
|
||||
.\" .Fx 9.3 .
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
driver first appeared in
|
||||
.Fx 9.3 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
|
||||
@@ -97,10 +97,6 @@ see
|
||||
.Xr rc 8
|
||||
.It Pa bluetooth/
|
||||
bluetooth configuration files
|
||||
.It Pa gnats/
|
||||
gnats configuration files;
|
||||
see
|
||||
.Xr send-pr 1
|
||||
.It Pa localtime
|
||||
local timezone information;
|
||||
see
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
# John Kunze, Berkeley
|
||||
# Craig Leres, Berkeley
|
||||
#
|
||||
# Please submit changes with send-pr(1).
|
||||
# Please submit changes via https://bugs.freebsd.org/submit/
|
||||
#
|
||||
# << EOH - after reordering, above header lines survive and this line dies >>
|
||||
#
|
||||
|
||||
+2
-2
@@ -962,7 +962,7 @@ t4fw.fwo optional cxgbe \
|
||||
no-implicit-rule \
|
||||
clean "t4fw.fwo"
|
||||
t4fw.fw optional cxgbe \
|
||||
dependency "$S/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu" \
|
||||
dependency "$S/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu" \
|
||||
compile-with "${NORMAL_FW}" \
|
||||
no-obj no-implicit-rule \
|
||||
clean "t4fw.fw"
|
||||
@@ -986,7 +986,7 @@ t5fw.fwo optional cxgbe \
|
||||
no-implicit-rule \
|
||||
clean "t5fw.fwo"
|
||||
t5fw.fw optional cxgbe \
|
||||
dependency "$S/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu" \
|
||||
dependency "$S/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu" \
|
||||
compile-with "${NORMAL_FW}" \
|
||||
no-obj no-implicit-rule \
|
||||
clean "t5fw.fw"
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
TYPE="FreeBSD"
|
||||
REVISION="9.3"
|
||||
BRANCH="RC1"
|
||||
BRANCH="RELEASE"
|
||||
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
|
||||
BRANCH=${BRANCH_OVERRIDE}
|
||||
fi
|
||||
|
||||
@@ -135,6 +135,17 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res)
|
||||
default:
|
||||
panic("%s: bad resource type %u", __func__, res->Type);
|
||||
}
|
||||
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
/*
|
||||
* XXX: Certain BIOSes have buggy AML that specify an IRQ that is
|
||||
* edge-sensitive and active-lo. However, edge-sensitive IRQs
|
||||
* should be active-hi. Force IRQs with an ISA IRQ value to be
|
||||
* active-hi instead.
|
||||
*/
|
||||
if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW)
|
||||
pol = ACPI_ACTIVE_HIGH;
|
||||
#endif
|
||||
BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ?
|
||||
INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ?
|
||||
INTR_POLARITY_HIGH : INTR_POLARITY_LOW);
|
||||
|
||||
@@ -253,7 +253,8 @@ struct cluster_metadata {
|
||||
|
||||
struct fl_sdesc {
|
||||
caddr_t cl;
|
||||
uint8_t nmbuf;
|
||||
uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */
|
||||
uint8_t nembuf; /* # of allocated mbufs with ref */
|
||||
struct cluster_layout cll;
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
# Chelsio T4 Factory Default configuration file.
|
||||
#
|
||||
# Copyright (C) 2010-2013 Chelsio Communications. All rights reserved.
|
||||
# Copyright (C) 2010-2014 Chelsio Communications. All rights reserved.
|
||||
#
|
||||
# DO NOT MODIFY THIS FILE UNDER ANY CIRCUMSTANCES. MODIFICATION OF
|
||||
# THIS FILE WILL RESULT IN A NON-FUNCTIONAL T4 ADAPTER AND MAY RESULT
|
||||
@@ -496,6 +496,8 @@
|
||||
# dwm: minimum delta between high and low watermark (in units of 100
|
||||
# Bytes)
|
||||
#
|
||||
#
|
||||
|
||||
[port "0"]
|
||||
dcb = ppp, dcbx # configure for DCB PPP and enable DCBX offload
|
||||
bg_mem = 25
|
||||
@@ -503,6 +505,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "1"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -511,6 +516,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "2"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -519,6 +527,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "3"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -527,10 +538,13 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[fini]
|
||||
version = 0x14250010
|
||||
checksum = 0x5a5526c3
|
||||
version = 0x14250012
|
||||
checksum = 0xd9ae0325
|
||||
|
||||
# Total resources used by above allocations:
|
||||
# Virtual Interfaces: 104
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2012 Chelsio Communications, Inc.
|
||||
* Copyright (c) 2012-2014 Chelsio Communications, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -100,7 +100,7 @@ enum fw_wr_opcodes {
|
||||
FW_ETH_TX_PKT_WR = 0x08,
|
||||
FW_ETH_TX_PKT2_WR = 0x44,
|
||||
FW_ETH_TX_PKTS_WR = 0x09,
|
||||
FW_ETH_TX_UO_WR = 0x1c,
|
||||
FW_ETH_TX_EO_WR = 0x1c,
|
||||
FW_EQ_FLUSH_WR = 0x1b,
|
||||
FW_OFLD_CONNECTION_WR = 0x2f,
|
||||
FW_FLOWC_WR = 0x0a,
|
||||
@@ -647,21 +647,70 @@ struct fw_eth_tx_pkts_wr {
|
||||
__u8 type;
|
||||
};
|
||||
|
||||
struct fw_eth_tx_uo_wr {
|
||||
enum fw_eth_tx_eo_type {
|
||||
FW_ETH_TX_EO_TYPE_UDPSEG,
|
||||
FW_ETH_TX_EO_TYPE_TCPSEG,
|
||||
FW_ETH_TX_EO_TYPE_NVGRESEG,
|
||||
};
|
||||
|
||||
struct fw_eth_tx_eo_wr {
|
||||
__be32 op_immdlen;
|
||||
__be32 equiq_to_len16;
|
||||
__be64 r3;
|
||||
__u8 r4;
|
||||
__u8 ethlen;
|
||||
__be16 iplen;
|
||||
__u8 udplen;
|
||||
__u8 rtplen;
|
||||
__be16 r5;
|
||||
__be16 mss;
|
||||
__be16 schedpktsize;
|
||||
__be32 length;
|
||||
union fw_eth_tx_eo {
|
||||
struct fw_eth_tx_eo_udpseg {
|
||||
__u8 type;
|
||||
__u8 ethlen;
|
||||
__be16 iplen;
|
||||
__u8 udplen;
|
||||
__u8 rtplen;
|
||||
__be16 r4;
|
||||
__be16 mss;
|
||||
__be16 schedpktsize;
|
||||
__be32 plen;
|
||||
} udpseg;
|
||||
struct fw_eth_tx_eo_tcpseg {
|
||||
__u8 type;
|
||||
__u8 ethlen;
|
||||
__be16 iplen;
|
||||
__u8 tcplen;
|
||||
__u8 tsclk_tsoff;
|
||||
__be16 r4;
|
||||
__be16 mss;
|
||||
__be16 r5;
|
||||
__be32 plen;
|
||||
} tcpseg;
|
||||
struct fw_eth_tx_eo_nvgreseg {
|
||||
__u8 type;
|
||||
__u8 iphdroffout;
|
||||
__be16 grehdroff;
|
||||
__be16 iphdroffin;
|
||||
__be16 tcphdroffin;
|
||||
__be16 mss;
|
||||
__be16 r4;
|
||||
__be32 plen;
|
||||
} nvgreseg;
|
||||
} u;
|
||||
};
|
||||
|
||||
#define S_FW_ETH_TX_EO_WR_IMMDLEN 0
|
||||
#define M_FW_ETH_TX_EO_WR_IMMDLEN 0x1ff
|
||||
#define V_FW_ETH_TX_EO_WR_IMMDLEN(x) ((x) << S_FW_ETH_TX_EO_WR_IMMDLEN)
|
||||
#define G_FW_ETH_TX_EO_WR_IMMDLEN(x) \
|
||||
(((x) >> S_FW_ETH_TX_EO_WR_IMMDLEN) & M_FW_ETH_TX_EO_WR_IMMDLEN)
|
||||
|
||||
#define S_FW_ETH_TX_EO_WR_TSCLK 6
|
||||
#define M_FW_ETH_TX_EO_WR_TSCLK 0x3
|
||||
#define V_FW_ETH_TX_EO_WR_TSCLK(x) ((x) << S_FW_ETH_TX_EO_WR_TSCLK)
|
||||
#define G_FW_ETH_TX_EO_WR_TSCLK(x) \
|
||||
(((x) >> S_FW_ETH_TX_EO_WR_TSCLK) & M_FW_ETH_TX_EO_WR_TSCLK)
|
||||
|
||||
#define S_FW_ETH_TX_EO_WR_TSOFF 0
|
||||
#define M_FW_ETH_TX_EO_WR_TSOFF 0x3f
|
||||
#define V_FW_ETH_TX_EO_WR_TSOFF(x) ((x) << S_FW_ETH_TX_EO_WR_TSOFF)
|
||||
#define G_FW_ETH_TX_EO_WR_TSOFF(x) \
|
||||
(((x) >> S_FW_ETH_TX_EO_WR_TSOFF) & M_FW_ETH_TX_EO_WR_TSOFF)
|
||||
|
||||
struct fw_eq_flush_wr {
|
||||
__u8 opcode;
|
||||
__u8 r1[3];
|
||||
@@ -794,13 +843,13 @@ enum fw_flowc_mnem_tcpstate {
|
||||
FW_FLOWC_MNEM_TCPSTATE_TIMEWAIT = 10, /* not expected */
|
||||
};
|
||||
|
||||
enum fw_flowc_mnem_uostate {
|
||||
FW_FLOWC_MNEM_UOSTATE_CLOSED = 0, /* illegal */
|
||||
FW_FLOWC_MNEM_UOSTATE_ESTABLISHED = 1, /* default */
|
||||
FW_FLOWC_MNEM_UOSTATE_CLOSING = 2, /* graceful close, after sending
|
||||
enum fw_flowc_mnem_eostate {
|
||||
FW_FLOWC_MNEM_EOSTATE_CLOSED = 0, /* illegal */
|
||||
FW_FLOWC_MNEM_EOSTATE_ESTABLISHED = 1, /* default */
|
||||
FW_FLOWC_MNEM_EOSTATE_CLOSING = 2, /* graceful close, after sending
|
||||
* outstanding payload
|
||||
*/
|
||||
FW_FLOWC_MNEM_UOSTATE_ABORTING = 3, /* immediate close, after
|
||||
FW_FLOWC_MNEM_EOSTATE_ABORTING = 3, /* immediate close, after
|
||||
* discarding outstanding payload
|
||||
*/
|
||||
};
|
||||
@@ -816,7 +865,7 @@ enum fw_flowc_mnem {
|
||||
FW_FLOWC_MNEM_MSS = 7,
|
||||
FW_FLOWC_MNEM_TXDATAPLEN_MAX = 8,
|
||||
FW_FLOWC_MNEM_TCPSTATE = 9,
|
||||
FW_FLOWC_MNEM_UOSTATE = 10,
|
||||
FW_FLOWC_MNEM_EOSTATE = 10,
|
||||
FW_FLOWC_MNEM_SCHEDCLASS = 11,
|
||||
FW_FLOWC_MNEM_DCBPRIO = 12,
|
||||
};
|
||||
@@ -3525,6 +3574,15 @@ enum fw_caps_config_fcoe {
|
||||
FW_CAPS_CONFIG_POFCOE_TARGET = 0x00000010,
|
||||
};
|
||||
|
||||
enum fw_memtype_cf {
|
||||
FW_MEMTYPE_CF_EDC0 = FW_MEMTYPE_EDC0,
|
||||
FW_MEMTYPE_CF_EDC1 = FW_MEMTYPE_EDC1,
|
||||
FW_MEMTYPE_CF_EXTMEM = FW_MEMTYPE_EXTMEM,
|
||||
FW_MEMTYPE_CF_FLASH = FW_MEMTYPE_FLASH,
|
||||
FW_MEMTYPE_CF_INTERNAL = FW_MEMTYPE_INTERNAL,
|
||||
FW_MEMTYPE_CF_EXTMEM1 = FW_MEMTYPE_EXTMEM1,
|
||||
};
|
||||
|
||||
struct fw_caps_config_cmd {
|
||||
__be32 op_to_write;
|
||||
__be32 cfvalid_to_len16;
|
||||
@@ -3612,6 +3670,7 @@ enum fw_params_param_dev {
|
||||
FW_PARAMS_PARAM_DEV_INTFVER_FCOEPDU = 0x15,
|
||||
FW_PARAMS_PARAM_DEV_MCINIT = 0x16,
|
||||
FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
|
||||
FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -3691,14 +3750,19 @@ enum fw_params_param_dev_bypass {
|
||||
FW_PARAMS_PARAM_DEV_BYPASS_BYPASS = 0x2,
|
||||
};
|
||||
|
||||
enum fw_params_phyfw_actions {
|
||||
FW_PARAMS_PARAM_PHYFW_DOWNLOAD = 0x00,
|
||||
FW_PARAMS_PARAM_PHYFW_VERSION = 0x01,
|
||||
enum fw_params_param_dev_phyfw {
|
||||
FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
|
||||
FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
|
||||
};
|
||||
|
||||
enum fw_params_param_dev_diag {
|
||||
FW_PARAM_DEV_DIAG_TMP = 0x00,
|
||||
FW_PARAM_DEV_DIAG_VDD = 0x01,
|
||||
FW_PARAM_DEV_DIAG_TMP = 0x00,
|
||||
FW_PARAM_DEV_DIAG_VDD = 0x01,
|
||||
};
|
||||
|
||||
enum fw_params_param_dev_fwcache {
|
||||
FW_PARAM_DEV_FWCACHE_FLUSH = 0x00,
|
||||
FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01,
|
||||
};
|
||||
|
||||
#define S_FW_PARAMS_MNEM 24
|
||||
@@ -4553,7 +4617,7 @@ struct fw_eq_eth_cmd {
|
||||
__be32 fetchszm_to_iqid;
|
||||
__be32 dcaen_to_eqsize;
|
||||
__be64 eqaddr;
|
||||
__be32 viid_pkd;
|
||||
__be32 autoequiqe_to_viid;
|
||||
__be32 r8_lo;
|
||||
__be64 r9;
|
||||
};
|
||||
@@ -4728,6 +4792,20 @@ struct fw_eq_eth_cmd {
|
||||
#define G_FW_EQ_ETH_CMD_EQSIZE(x) \
|
||||
(((x) >> S_FW_EQ_ETH_CMD_EQSIZE) & M_FW_EQ_ETH_CMD_EQSIZE)
|
||||
|
||||
#define S_FW_EQ_ETH_CMD_AUTOEQUIQE 31
|
||||
#define M_FW_EQ_ETH_CMD_AUTOEQUIQE 0x1
|
||||
#define V_FW_EQ_ETH_CMD_AUTOEQUIQE(x) ((x) << S_FW_EQ_ETH_CMD_AUTOEQUIQE)
|
||||
#define G_FW_EQ_ETH_CMD_AUTOEQUIQE(x) \
|
||||
(((x) >> S_FW_EQ_ETH_CMD_AUTOEQUIQE) & M_FW_EQ_ETH_CMD_AUTOEQUIQE)
|
||||
#define F_FW_EQ_ETH_CMD_AUTOEQUIQE V_FW_EQ_ETH_CMD_AUTOEQUIQE(1U)
|
||||
|
||||
#define S_FW_EQ_ETH_CMD_AUTOEQUEQE 30
|
||||
#define M_FW_EQ_ETH_CMD_AUTOEQUEQE 0x1
|
||||
#define V_FW_EQ_ETH_CMD_AUTOEQUEQE(x) ((x) << S_FW_EQ_ETH_CMD_AUTOEQUEQE)
|
||||
#define G_FW_EQ_ETH_CMD_AUTOEQUEQE(x) \
|
||||
(((x) >> S_FW_EQ_ETH_CMD_AUTOEQUEQE) & M_FW_EQ_ETH_CMD_AUTOEQUEQE)
|
||||
#define F_FW_EQ_ETH_CMD_AUTOEQUEQE V_FW_EQ_ETH_CMD_AUTOEQUEQE(1U)
|
||||
|
||||
#define S_FW_EQ_ETH_CMD_VIID 16
|
||||
#define M_FW_EQ_ETH_CMD_VIID 0xfff
|
||||
#define V_FW_EQ_ETH_CMD_VIID(x) ((x) << S_FW_EQ_ETH_CMD_VIID)
|
||||
@@ -5680,18 +5758,19 @@ enum fw_port_action {
|
||||
FW_PORT_ACTION_L1_LOW_PWR_EN = 0x0011,
|
||||
FW_PORT_ACTION_L2_WOL_MODE_EN = 0x0012,
|
||||
FW_PORT_ACTION_LPBK_TO_NORMAL = 0x0020,
|
||||
FW_PORT_ACTION_L1_SS_LPBK_ASIC = 0x0021,
|
||||
FW_PORT_ACTION_MAC_LPBK = 0x0022,
|
||||
FW_PORT_ACTION_L1_WS_LPBK_ASIC = 0x0023,
|
||||
FW_PORT_ACTION_L1_EXT_LPBK = 0x0026,
|
||||
FW_PORT_ACTION_LPBK_SS_ASIC = 0x0022,
|
||||
FW_PORT_ACTION_LPBK_WS_ASIC = 0x0023,
|
||||
FW_PORT_ACTION_LPBK_WS_EXT_PHY = 0x0025,
|
||||
FW_PORT_ACTION_LPBK_SS_EXT = 0x0026,
|
||||
FW_PORT_ACTION_DIAGNOSTICS = 0x0027,
|
||||
FW_PORT_ACTION_PCS_LPBK = 0x0028,
|
||||
FW_PORT_ACTION_LPBK_SS_EXT_PHY = 0x0028,
|
||||
FW_PORT_ACTION_PHY_RESET = 0x0040,
|
||||
FW_PORT_ACTION_PMA_RESET = 0x0041,
|
||||
FW_PORT_ACTION_PCS_RESET = 0x0042,
|
||||
FW_PORT_ACTION_PHYXS_RESET = 0x0043,
|
||||
FW_PORT_ACTION_DTEXS_REEST = 0x0044,
|
||||
FW_PORT_ACTION_AN_RESET = 0x0045,
|
||||
|
||||
};
|
||||
|
||||
enum fw_port_l2cfg_ctlbf {
|
||||
@@ -5704,6 +5783,20 @@ enum fw_port_l2cfg_ctlbf {
|
||||
FW_PORT_L2_CTLBF_MTU = 0x40
|
||||
};
|
||||
|
||||
enum fw_dcb_app_tlv_sf {
|
||||
FW_DCB_APP_SF_ETHERTYPE,
|
||||
FW_DCB_APP_SF_SOCKET_TCP,
|
||||
FW_DCB_APP_SF_SOCKET_UDP,
|
||||
FW_DCB_APP_SF_SOCKET_ALL,
|
||||
};
|
||||
|
||||
enum fw_port_dcb_versions {
|
||||
FW_PORT_DCB_VER_CEE1D0,
|
||||
FW_PORT_DCB_VER_CEE1D01,
|
||||
FW_PORT_DCB_VER_IEEE,
|
||||
FW_PORT_DCB_VER_UNKNOWN=7
|
||||
};
|
||||
|
||||
enum fw_port_dcb_cfg {
|
||||
FW_PORT_DCB_CFG_PG = 0x01,
|
||||
FW_PORT_DCB_CFG_PFC = 0x02,
|
||||
@@ -5724,10 +5817,18 @@ enum fw_port_dcb_type {
|
||||
FW_PORT_DCB_TYPE_CONTROL = 0x05,
|
||||
};
|
||||
|
||||
enum fw_port_dcb_feature_state {
|
||||
FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
|
||||
FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
|
||||
FW_PORT_DCB_FEATURE_STATE_ERROR = 0x2,
|
||||
FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
|
||||
};
|
||||
|
||||
enum fw_port_diag_ops {
|
||||
FW_PORT_DIAGS_TEMP = 0x00,
|
||||
FW_PORT_DIAGS_TX_POWER = 0x01,
|
||||
FW_PORT_DIAGS_RX_POWER = 0x02,
|
||||
FW_PORT_DIAGS_TX_DIS = 0x03,
|
||||
};
|
||||
|
||||
struct fw_port_cmd {
|
||||
@@ -5760,7 +5861,9 @@ struct fw_port_cmd {
|
||||
__be16 mtu;
|
||||
__u8 cbllen;
|
||||
__u8 auxlinfo;
|
||||
__be32 r8;
|
||||
__u8 dcbxdis_pkd;
|
||||
__u8 r8_lo;
|
||||
__be16 lpcap;
|
||||
__be64 r9;
|
||||
} info;
|
||||
struct fw_port_diags {
|
||||
@@ -5792,7 +5895,8 @@ struct fw_port_cmd {
|
||||
struct fw_port_dcb_pfc {
|
||||
__u8 type;
|
||||
__u8 pfcen;
|
||||
__be16 r10[3];
|
||||
__u8 r10[5];
|
||||
__u8 max_pfc_tcs;
|
||||
__be64 r11;
|
||||
} pfc;
|
||||
struct fw_port_app_priority {
|
||||
@@ -5807,8 +5911,9 @@ struct fw_port_cmd {
|
||||
struct fw_port_dcb_control {
|
||||
__u8 type;
|
||||
__u8 all_syncd_pkd;
|
||||
__be16 r10_lo[3];
|
||||
__be64 r11;
|
||||
__be16 pfc_state_to_app_state;
|
||||
__be32 r11;
|
||||
__be64 r12;
|
||||
} control;
|
||||
} dcb;
|
||||
} u;
|
||||
@@ -5953,6 +6058,13 @@ struct fw_port_cmd {
|
||||
#define G_FW_PORT_CMD_MODTYPE(x) \
|
||||
(((x) >> S_FW_PORT_CMD_MODTYPE) & M_FW_PORT_CMD_MODTYPE)
|
||||
|
||||
#define S_FW_PORT_CMD_DCBXDIS 7
|
||||
#define M_FW_PORT_CMD_DCBXDIS 0x1
|
||||
#define V_FW_PORT_CMD_DCBXDIS(x) ((x) << S_FW_PORT_CMD_DCBXDIS)
|
||||
#define G_FW_PORT_CMD_DCBXDIS(x) \
|
||||
(((x) >> S_FW_PORT_CMD_DCBXDIS) & M_FW_PORT_CMD_DCBXDIS)
|
||||
#define F_FW_PORT_CMD_DCBXDIS V_FW_PORT_CMD_DCBXDIS(1U)
|
||||
|
||||
#define S_FW_PORT_CMD_APPLY 7
|
||||
#define M_FW_PORT_CMD_APPLY 0x1
|
||||
#define V_FW_PORT_CMD_APPLY(x) ((x) << S_FW_PORT_CMD_APPLY)
|
||||
@@ -5967,10 +6079,32 @@ struct fw_port_cmd {
|
||||
(((x) >> S_FW_PORT_CMD_ALL_SYNCD) & M_FW_PORT_CMD_ALL_SYNCD)
|
||||
#define F_FW_PORT_CMD_ALL_SYNCD V_FW_PORT_CMD_ALL_SYNCD(1U)
|
||||
|
||||
#define S_FW_PORT_CMD_PFC_STATE 8
|
||||
#define M_FW_PORT_CMD_PFC_STATE 0xf
|
||||
#define V_FW_PORT_CMD_PFC_STATE(x) ((x) << S_FW_PORT_CMD_PFC_STATE)
|
||||
#define G_FW_PORT_CMD_PFC_STATE(x) \
|
||||
(((x) >> S_FW_PORT_CMD_PFC_STATE) & M_FW_PORT_CMD_PFC_STATE)
|
||||
|
||||
#define S_FW_PORT_CMD_ETS_STATE 4
|
||||
#define M_FW_PORT_CMD_ETS_STATE 0xf
|
||||
#define V_FW_PORT_CMD_ETS_STATE(x) ((x) << S_FW_PORT_CMD_ETS_STATE)
|
||||
#define G_FW_PORT_CMD_ETS_STATE(x) \
|
||||
(((x) >> S_FW_PORT_CMD_ETS_STATE) & M_FW_PORT_CMD_ETS_STATE)
|
||||
|
||||
#define S_FW_PORT_CMD_APP_STATE 0
|
||||
#define M_FW_PORT_CMD_APP_STATE 0xf
|
||||
#define V_FW_PORT_CMD_APP_STATE(x) ((x) << S_FW_PORT_CMD_APP_STATE)
|
||||
#define G_FW_PORT_CMD_APP_STATE(x) \
|
||||
(((x) >> S_FW_PORT_CMD_APP_STATE) & M_FW_PORT_CMD_APP_STATE)
|
||||
|
||||
/*
|
||||
* These are configured into the VPD and hence tools that generate
|
||||
* VPD may use this enumeration.
|
||||
* extPHY #lanes T4_I2C extI2C BP_Eq BP_ANEG Speed
|
||||
*
|
||||
* REMEMBER:
|
||||
* Update the Common Code t4_hw.c:t4_get_port_type_description()
|
||||
* with any new Firmware Port Technology Types!
|
||||
*/
|
||||
enum fw_port_type {
|
||||
FW_PORT_TYPE_FIBER_XFI = 0, /* Y, 1, N, Y, N, N, 10G */
|
||||
@@ -7657,6 +7791,17 @@ enum pcie_fw_eval {
|
||||
(((x) >> S_PCIE_FW_REGISTERED) & M_PCIE_FW_REGISTERED)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* P C I E F W P F 0 R E G I S T E R
|
||||
**********************************************/
|
||||
|
||||
/*
|
||||
* this register is available as 32-bit of persistent storage (accross
|
||||
* PL_RST based chip-reset) for boot drivers (i.e. firmware and driver
|
||||
* will not write it)
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* B I N A R Y H E A D E R F O R M A T
|
||||
**********************************************/
|
||||
@@ -7720,13 +7865,13 @@ enum fw_hdr_chip {
|
||||
|
||||
enum {
|
||||
T4FW_VERSION_MAJOR = 0x01,
|
||||
T4FW_VERSION_MINOR = 0x09,
|
||||
T4FW_VERSION_MICRO = 0x0c,
|
||||
T4FW_VERSION_MINOR = 0x0b,
|
||||
T4FW_VERSION_MICRO = 0x1b,
|
||||
T4FW_VERSION_BUILD = 0x00,
|
||||
|
||||
T5FW_VERSION_MAJOR = 0x01,
|
||||
T5FW_VERSION_MINOR = 0x09,
|
||||
T5FW_VERSION_MICRO = 0x0c,
|
||||
T5FW_VERSION_MINOR = 0x0b,
|
||||
T5FW_VERSION_MICRO = 0x1b,
|
||||
T5FW_VERSION_BUILD = 0x00,
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
# Chelsio T5 Factory Default configuration file.
|
||||
#
|
||||
# Copyright (C) 2010-2013 Chelsio Communications. All rights reserved.
|
||||
# Copyright (C) 2010-2014 Chelsio Communications. All rights reserved.
|
||||
#
|
||||
# DO NOT MODIFY THIS FILE UNDER ANY CIRCUMSTANCES. MODIFICATION OF
|
||||
# THIS FILE WILL RESULT IN A NON-FUNCTIONAL T4 ADAPTER AND MAY RESULT
|
||||
@@ -177,6 +177,9 @@
|
||||
# TP_GLOBAL_CONFIG
|
||||
reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable
|
||||
|
||||
# TP_PC_CONFIG
|
||||
reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError
|
||||
|
||||
# TP_PARA_REG0
|
||||
reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6
|
||||
|
||||
@@ -433,7 +436,7 @@
|
||||
pmask = all # access to all four ports ...
|
||||
nserver = 16
|
||||
nhash = 2048
|
||||
tp_l2t = 1024
|
||||
tp_l2t = 1020
|
||||
protocol = iscsi_initiator_fofld
|
||||
tp_ddp_iscsi = 2
|
||||
iscsi_ntask = 2048
|
||||
@@ -454,6 +457,7 @@
|
||||
cmask = all # access to all channels
|
||||
pmask = all # access to all four ports ...
|
||||
nhash = 2048
|
||||
tp_l2t = 4
|
||||
protocol = fcoe_initiator
|
||||
tp_ddp = 2
|
||||
fcoe_nfcf = 16
|
||||
@@ -544,6 +548,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "1"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -552,6 +559,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "2"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -560,6 +570,9 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[port "3"]
|
||||
dcb = ppp, dcbx
|
||||
@@ -568,10 +581,13 @@
|
||||
hwm = 30
|
||||
lwm = 15
|
||||
dwm = 30
|
||||
dcb_app_tlv[0] = 0x8906, ethertype, 3
|
||||
dcb_app_tlv[1] = 0x8914, ethertype, 3
|
||||
dcb_app_tlv[2] = 3260, socketnum, 5
|
||||
|
||||
[fini]
|
||||
version = 0x14250013
|
||||
checksum = 0xd66f5b23
|
||||
version = 0x14250016
|
||||
checksum = 0x5d740273
|
||||
|
||||
# Total resources used by above allocations:
|
||||
# Virtual Interfaces: 104
|
||||
|
||||
+17
-10
@@ -1469,22 +1469,22 @@ get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int total, int flags)
|
||||
/* copy data to mbuf */
|
||||
bcopy(payload, mtod(m, caddr_t), len);
|
||||
|
||||
} else if (sd->nmbuf * MSIZE < cll->region1) {
|
||||
} else if (sd->nimbuf * MSIZE < cll->region1) {
|
||||
|
||||
/*
|
||||
* There's spare room in the cluster for an mbuf. Create one
|
||||
* and associate it with the payload that's in the cluster too.
|
||||
* and associate it with the payload that's in the cluster.
|
||||
*/
|
||||
|
||||
MPASS(clm != NULL);
|
||||
m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE);
|
||||
m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE);
|
||||
/* No bzero required */
|
||||
if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE))
|
||||
return (NULL);
|
||||
fl->mbuf_inlined++;
|
||||
m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free,
|
||||
swz->zone, sd->cl);
|
||||
sd->nmbuf++;
|
||||
sd->nimbuf++;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -1498,10 +1498,11 @@ get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int total, int flags)
|
||||
if (m == NULL)
|
||||
return (NULL);
|
||||
fl->mbuf_allocated++;
|
||||
if (clm != NULL)
|
||||
if (clm != NULL) {
|
||||
m_extaddref(m, payload, padded_len, &clm->refcount,
|
||||
rxb_free, swz->zone, sd->cl);
|
||||
else {
|
||||
sd->nembuf++;
|
||||
} else {
|
||||
m_cljset(m, sd->cl, swz->type);
|
||||
sd->cl = NULL; /* consumed, not a recycle candidate */
|
||||
}
|
||||
@@ -2596,7 +2597,7 @@ eth_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
|
||||
V_FW_EQ_ETH_CMD_VFN(0));
|
||||
c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_ALLOC |
|
||||
F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c));
|
||||
c.viid_pkd = htobe32(V_FW_EQ_ETH_CMD_VIID(pi->viid));
|
||||
c.autoequiqe_to_viid = htobe32(V_FW_EQ_ETH_CMD_VIID(pi->viid));
|
||||
c.fetchszm_to_iqid =
|
||||
htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
|
||||
V_FW_EQ_ETH_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO |
|
||||
@@ -3024,7 +3025,7 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int nbufs)
|
||||
|
||||
if (sd->cl != NULL) {
|
||||
|
||||
if (sd->nmbuf == 0) {
|
||||
if (sd->nimbuf + sd->nembuf == 0) {
|
||||
/*
|
||||
* Fast recycle without involving any atomics on
|
||||
* the cluster's metadata (if the cluster has
|
||||
@@ -3033,6 +3034,11 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int nbufs)
|
||||
* fit within a single mbuf each.
|
||||
*/
|
||||
fl->cl_fast_recycled++;
|
||||
#ifdef INVARIANTS
|
||||
clm = cl_metadata(sc, fl, &sd->cll, sd->cl);
|
||||
if (clm != NULL)
|
||||
MPASS(clm->refcount == 1);
|
||||
#endif
|
||||
goto recycled_fast;
|
||||
}
|
||||
|
||||
@@ -3078,7 +3084,8 @@ recycled:
|
||||
#endif
|
||||
clm->refcount = 1;
|
||||
}
|
||||
sd->nmbuf = 0;
|
||||
sd->nimbuf = 0;
|
||||
sd->nembuf = 0;
|
||||
recycled_fast:
|
||||
fl->pending++;
|
||||
fl->needed--;
|
||||
@@ -3147,7 +3154,7 @@ free_fl_sdesc(struct adapter *sc, struct sge_fl *fl)
|
||||
|
||||
cll = &sd->cll;
|
||||
clm = cl_metadata(sc, fl, cll, sd->cl);
|
||||
if (sd->nmbuf == 0 ||
|
||||
if (sd->nimbuf + sd->nembuf == 0 ||
|
||||
(clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) {
|
||||
uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl);
|
||||
}
|
||||
|
||||
@@ -2745,7 +2745,6 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, struct sbp_status *sbp_status)
|
||||
struct sbp_ocb *ocb;
|
||||
struct sbp_ocb *next;
|
||||
int s = splfw(), order = 0;
|
||||
int flags;
|
||||
|
||||
SBP_DEBUG(1)
|
||||
device_printf(sdev->target->sbp->fd.dev,
|
||||
@@ -2759,7 +2758,6 @@ END_DEBUG
|
||||
SBP_LOCK(sdev->target->sbp);
|
||||
for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) {
|
||||
next = STAILQ_NEXT(ocb, ocb);
|
||||
flags = ocb->flags;
|
||||
if (OCB_MATCH(ocb, sbp_status)) {
|
||||
/* found */
|
||||
STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb);
|
||||
|
||||
@@ -657,10 +657,8 @@ static void
|
||||
my_setmode_mii(struct my_softc * sc, int media)
|
||||
{
|
||||
u_int16_t bmcr;
|
||||
struct ifnet *ifp;
|
||||
|
||||
MY_LOCK_ASSERT(sc);
|
||||
ifp = sc->my_ifp;
|
||||
/*
|
||||
* If an autoneg session is in progress, stop it.
|
||||
*/
|
||||
|
||||
@@ -1376,15 +1376,12 @@ nfe_free_rx_ring(struct nfe_softc *sc, struct nfe_rx_ring *ring)
|
||||
{
|
||||
struct nfe_rx_data *data;
|
||||
void *desc;
|
||||
int i, descsize;
|
||||
int i;
|
||||
|
||||
if (sc->nfe_flags & NFE_40BIT_ADDR) {
|
||||
if (sc->nfe_flags & NFE_40BIT_ADDR)
|
||||
desc = ring->desc64;
|
||||
descsize = sizeof (struct nfe_desc64);
|
||||
} else {
|
||||
else
|
||||
desc = ring->desc32;
|
||||
descsize = sizeof (struct nfe_desc32);
|
||||
}
|
||||
|
||||
for (i = 0; i < NFE_RX_RING_COUNT; i++) {
|
||||
data = &ring->data[i];
|
||||
|
||||
@@ -487,11 +487,7 @@ oce_hw_start(POCE_SOFTC sc)
|
||||
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
|
||||
}
|
||||
|
||||
if (link.mac_speed > 0 && link.mac_speed < 5)
|
||||
sc->link_speed = link.mac_speed;
|
||||
else
|
||||
sc->link_speed = 0;
|
||||
|
||||
sc->link_speed = link.phys_port_speed;
|
||||
sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10;
|
||||
|
||||
rc = oce_start_mq(sc->mq);
|
||||
|
||||
+31
-10
@@ -1023,7 +1023,7 @@ struct mbx_hdr {
|
||||
#define OCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status)
|
||||
#define OCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status)
|
||||
|
||||
/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG */
|
||||
/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG_V1 */
|
||||
struct mbx_query_common_link_config {
|
||||
struct mbx_hdr hdr;
|
||||
union {
|
||||
@@ -1032,16 +1032,37 @@ struct mbx_query_common_link_config {
|
||||
} req;
|
||||
|
||||
struct {
|
||||
/* dw 0 */
|
||||
uint8_t physical_port;
|
||||
uint8_t mac_duplex;
|
||||
uint8_t mac_speed;
|
||||
uint8_t mac_fault;
|
||||
/* dw 1 */
|
||||
uint8_t mgmt_mac_duplex;
|
||||
uint8_t mgmt_mac_speed;
|
||||
#ifdef _BIG_ENDIAN
|
||||
uint32_t physical_port_fault:8;
|
||||
uint32_t physical_port_speed:8;
|
||||
uint32_t link_duplex:8;
|
||||
uint32_t pt:2;
|
||||
uint32_t port_number:6;
|
||||
|
||||
uint16_t qos_link_speed;
|
||||
uint32_t logical_link_status;
|
||||
uint16_t rsvd0;
|
||||
|
||||
uint32_t rsvd1:21;
|
||||
uint32_t phys_fcv:1;
|
||||
uint32_t phys_rxf:1;
|
||||
uint32_t phys_txf:1;
|
||||
uint32_t logical_link_status:8;
|
||||
#else
|
||||
uint32_t port_number:6;
|
||||
uint32_t pt:2;
|
||||
uint32_t link_duplex:8;
|
||||
uint32_t physical_port_speed:8;
|
||||
uint32_t physical_port_fault:8;
|
||||
|
||||
uint16_t rsvd0;
|
||||
uint16_t qos_link_speed;
|
||||
|
||||
uint32_t logical_link_status:8;
|
||||
uint32_t phys_txf:1;
|
||||
uint32_t phys_rxf:1;
|
||||
uint32_t phys_fcv:1;
|
||||
uint32_t rsvd1:21;
|
||||
#endif
|
||||
} rsp;
|
||||
} params;
|
||||
};
|
||||
|
||||
+26
-12
@@ -828,6 +828,21 @@ oce_media_status(struct ifnet *ifp, struct ifmediareq *req)
|
||||
req->ifm_active |= IFM_10G_SR | IFM_FDX;
|
||||
sc->speed = 10000;
|
||||
break;
|
||||
case 5: /* 20 Gbps */
|
||||
req->ifm_active |= IFM_10G_SR | IFM_FDX;
|
||||
sc->speed = 20000;
|
||||
break;
|
||||
case 6: /* 25 Gbps */
|
||||
req->ifm_active |= IFM_10G_SR | IFM_FDX;
|
||||
sc->speed = 25000;
|
||||
break;
|
||||
case 7: /* 40 Gbps */
|
||||
req->ifm_active |= IFM_40G_SR4 | IFM_FDX;
|
||||
sc->speed = 40000;
|
||||
break;
|
||||
default:
|
||||
sc->speed = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1940,7 +1955,6 @@ done:
|
||||
/* Is there atleast one eq that needs to be modified? */
|
||||
if(num)
|
||||
oce_mbox_eqd_modify_periodic(sc, set_eqd, num);
|
||||
|
||||
}
|
||||
|
||||
static void oce_detect_hw_error(POCE_SOFTC sc)
|
||||
@@ -2140,11 +2154,6 @@ process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe)
|
||||
sc->link_status = ASYNC_EVENT_LINK_DOWN;
|
||||
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
|
||||
}
|
||||
|
||||
/* Update speed */
|
||||
sc->link_speed = acqe->u0.s.speed;
|
||||
sc->qos_link_speed = (uint32_t) acqe->u0.s.qos_link_speed * 10;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2218,13 +2227,16 @@ setup_max_queues_want(POCE_SOFTC sc)
|
||||
(sc->function_mode & FNM_UMC_MODE) ||
|
||||
(sc->function_mode & FNM_VNIC_MODE) ||
|
||||
(!is_rss_enabled(sc)) ||
|
||||
(sc->flags & OCE_FLAGS_BE2)) {
|
||||
IS_BE2(sc)) {
|
||||
sc->nrqs = 1;
|
||||
sc->nwqs = 1;
|
||||
} else {
|
||||
sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1;
|
||||
sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs);
|
||||
}
|
||||
|
||||
if (IS_BE2(sc) && is_rss_enabled(sc))
|
||||
sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -2238,6 +2250,9 @@ update_queues_got(POCE_SOFTC sc)
|
||||
sc->nrqs = 1;
|
||||
sc->nwqs = 1;
|
||||
}
|
||||
|
||||
if (IS_BE2(sc))
|
||||
sc->nwqs = 1;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -2329,18 +2344,17 @@ oce_get_config(POCE_SOFTC sc)
|
||||
max_rss = OCE_MAX_RSS;
|
||||
|
||||
if (!IS_BE(sc)) {
|
||||
rc = oce_get_func_config(sc);
|
||||
rc = oce_get_profile_config(sc, max_rss);
|
||||
if (rc) {
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rc = oce_get_profile_config(sc);
|
||||
else { /* For BE3 don't rely on fw for determining the resources */
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1;
|
||||
if (rc)
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->max_vlans = MAX_VLANFILTER_SIZE;
|
||||
}
|
||||
}
|
||||
+8
-10
@@ -759,14 +759,9 @@ struct oce_rq {
|
||||
};
|
||||
|
||||
struct link_status {
|
||||
uint8_t physical_port;
|
||||
uint8_t mac_duplex;
|
||||
uint8_t mac_speed;
|
||||
uint8_t mac_fault;
|
||||
uint8_t mgmt_mac_duplex;
|
||||
uint8_t mgmt_mac_speed;
|
||||
uint8_t phys_port_speed;
|
||||
uint8_t logical_link_status;
|
||||
uint16_t qos_link_speed;
|
||||
uint32_t logical_link_status;
|
||||
};
|
||||
|
||||
|
||||
@@ -882,8 +877,8 @@ typedef struct oce_softc {
|
||||
uint8_t hw_error;
|
||||
uint16_t qnq_debug_event;
|
||||
uint16_t qnqid;
|
||||
uint16_t pvid;
|
||||
uint16_t max_vlans;
|
||||
uint32_t pvid;
|
||||
uint32_t max_vlans;
|
||||
|
||||
} OCE_SOFTC, *POCE_SOFTC;
|
||||
|
||||
@@ -1055,7 +1050,7 @@ int oce_mbox_cq_create(struct oce_cq *cq, uint32_t ncoalesce,
|
||||
int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num);
|
||||
void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd,
|
||||
int num);
|
||||
int oce_get_profile_config(POCE_SOFTC sc);
|
||||
int oce_get_profile_config(POCE_SOFTC sc, uint32_t max_rss);
|
||||
int oce_get_func_config(POCE_SOFTC sc);
|
||||
void mbx_common_req_hdr_init(struct mbx_hdr *hdr,
|
||||
uint8_t dom,
|
||||
@@ -1099,6 +1094,9 @@ extern uint32_t oce_max_rsp_handled; /* max responses */
|
||||
#define OCE_ONE_PORT_EXT_LOOPBACK 0x2
|
||||
#define OCE_NO_LOOPBACK 0xff
|
||||
|
||||
#undef IFM_40G_SR4
|
||||
#define IFM_40G_SR4 28
|
||||
|
||||
#define atomic_inc_32(x) atomic_add_32(x, 1)
|
||||
#define atomic_dec_32(x) atomic_subtract_32(x, 1)
|
||||
|
||||
|
||||
+15
-8
@@ -935,7 +935,7 @@ oce_get_link_status(POCE_SOFTC sc, struct link_status *link)
|
||||
|
||||
bzero(&mbx, sizeof(struct oce_mbx));
|
||||
|
||||
IS_XE201(sc) ? (version = OCE_MBX_VER_V1) : (version = OCE_MBX_VER_V0);
|
||||
IS_BE2(sc) ? (version = OCE_MBX_VER_V0) : (version = OCE_MBX_VER_V1);
|
||||
|
||||
fwcmd = (struct mbx_query_common_link_config *)&mbx.payload;
|
||||
mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0,
|
||||
@@ -961,9 +961,9 @@ oce_get_link_status(POCE_SOFTC sc, struct link_status *link)
|
||||
goto error;
|
||||
}
|
||||
/* interpret response */
|
||||
bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status));
|
||||
link->logical_link_status = HOST_32(link->logical_link_status);
|
||||
link->qos_link_speed = HOST_16(link->qos_link_speed);
|
||||
link->qos_link_speed = HOST_16(fwcmd->params.rsp.qos_link_speed);
|
||||
link->phys_port_speed = fwcmd->params.rsp.physical_port_speed;
|
||||
link->logical_link_status = fwcmd->params.rsp.logical_link_status;
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
@@ -2025,7 +2025,7 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd,
|
||||
}
|
||||
|
||||
int
|
||||
oce_get_profile_config(POCE_SOFTC sc)
|
||||
oce_get_profile_config(POCE_SOFTC sc, uint32_t max_rss)
|
||||
{
|
||||
struct oce_mbx mbx;
|
||||
struct mbx_common_get_profile_config *fwcmd;
|
||||
@@ -2050,7 +2050,7 @@ oce_get_profile_config(POCE_SOFTC sc)
|
||||
fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_profile_config);
|
||||
bzero(fwcmd, sizeof(struct mbx_common_get_profile_config));
|
||||
|
||||
if (IS_BE3(sc))
|
||||
if (!IS_XE201(sc))
|
||||
version = OCE_MBX_VER_V1;
|
||||
else
|
||||
version = OCE_MBX_VER_V0;
|
||||
@@ -2102,13 +2102,20 @@ oce_get_profile_config(POCE_SOFTC sc)
|
||||
goto error;
|
||||
}
|
||||
else {
|
||||
sc->max_vlans = nic_desc->vlan_count;
|
||||
sc->nwqs = HOST_32(nic_desc->txq_count);
|
||||
sc->max_vlans = HOST_16(nic_desc->vlan_count);
|
||||
sc->nwqs = HOST_16(nic_desc->txq_count);
|
||||
if (sc->nwqs)
|
||||
sc->nwqs = MIN(sc->nwqs, OCE_MAX_WQ);
|
||||
else
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
|
||||
sc->nrssqs = HOST_16(nic_desc->rssq_count);
|
||||
if (sc->nrssqs)
|
||||
sc->nrssqs = MIN(sc->nrssqs, max_rss);
|
||||
else
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1; /* 1 for def RX */;
|
||||
|
||||
}
|
||||
error:
|
||||
oce_dma_free(sc, &dma);
|
||||
|
||||
@@ -44,6 +44,7 @@ static void copy_stats_to_sc_xe201(POCE_SOFTC sc);
|
||||
static void copy_stats_to_sc_be3(POCE_SOFTC sc);
|
||||
static void copy_stats_to_sc_be2(POCE_SOFTC sc);
|
||||
static int oce_sysctl_loopback(SYSCTL_HANDLER_ARGS);
|
||||
static int oce_sys_aic_enable(SYSCTL_HANDLER_ARGS);
|
||||
static int oce_be3_fwupgrade(POCE_SOFTC sc, const struct firmware *fw);
|
||||
static int oce_skyhawk_fwupgrade(POCE_SOFTC sc, const struct firmware *fw);
|
||||
static int oce_sys_fwupgrade(SYSCTL_HANDLER_ARGS);
|
||||
@@ -131,6 +132,10 @@ oce_add_sysctls(POCE_SOFTC sc)
|
||||
CTLTYPE_STRING | CTLFLAG_RW, (void *)sc, 0,
|
||||
oce_sys_fwupgrade, "A", "Firmware ufi file");
|
||||
|
||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "aic_enable",
|
||||
CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 1,
|
||||
oce_sys_aic_enable, "I", "aic flags");
|
||||
|
||||
/*
|
||||
* Dumps Transceiver data
|
||||
* "sysctl dev.oce.0.sfp_vpd_dump=0"
|
||||
@@ -169,6 +174,35 @@ oce_loopback_test(struct oce_softc *sc, uint8_t loopback_type)
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
oce_sys_aic_enable(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int value = 0;
|
||||
uint32_t status, vector;
|
||||
POCE_SOFTC sc = (struct oce_softc *)arg1;
|
||||
struct oce_aic_obj *aic;
|
||||
|
||||
status = sysctl_handle_int(oidp, &value, 0, req);
|
||||
if (status || !req->newptr)
|
||||
return status;
|
||||
|
||||
for (vector = 0; vector < sc->intr_count; vector++) {
|
||||
aic = &sc->aic_obj[vector];
|
||||
|
||||
if (value == 0){
|
||||
aic->max_eqd = aic->min_eqd = aic->et_eqd = 0;
|
||||
aic->enable = 0;
|
||||
}
|
||||
else {
|
||||
aic->max_eqd = OCE_MAX_EQD;
|
||||
aic->min_eqd = OCE_MIN_EQD;
|
||||
aic->et_eqd = OCE_MIN_EQD;
|
||||
aic->enable = TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
oce_sysctl_loopback(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
||||
@@ -1739,12 +1739,10 @@ static void
|
||||
siba_pcicore_init(struct siba_pci *spc)
|
||||
{
|
||||
struct siba_dev_softc *sd = spc->spc_dev;
|
||||
struct siba_softc *siba;
|
||||
|
||||
if (sd == NULL)
|
||||
return;
|
||||
|
||||
siba = sd->sd_bus;
|
||||
if (!siba_dev_isup_sub(sd))
|
||||
siba_dev_up_sub(sd, 0);
|
||||
|
||||
|
||||
@@ -1617,11 +1617,9 @@ sis_tick(void *xsc)
|
||||
{
|
||||
struct sis_softc *sc;
|
||||
struct mii_data *mii;
|
||||
struct ifnet *ifp;
|
||||
|
||||
sc = xsc;
|
||||
SIS_LOCK_ASSERT(sc);
|
||||
ifp = sc->sis_ifp;
|
||||
|
||||
mii = device_get_softc(sc->sis_miibus);
|
||||
mii_tick(mii);
|
||||
|
||||
@@ -2877,13 +2877,11 @@ static void
|
||||
sk_txeof(sc_if)
|
||||
struct sk_if_softc *sc_if;
|
||||
{
|
||||
struct sk_softc *sc;
|
||||
struct sk_txdesc *txd;
|
||||
struct sk_tx_desc *cur_tx;
|
||||
struct ifnet *ifp;
|
||||
u_int32_t idx, sk_ctl;
|
||||
|
||||
sc = sc_if->sk_softc;
|
||||
ifp = sc_if->sk_ifp;
|
||||
|
||||
txd = STAILQ_FIRST(&sc_if->sk_cdata.sk_txbusyq);
|
||||
|
||||
@@ -1150,12 +1150,10 @@ epic_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
epic_softc_t *sc;
|
||||
struct mii_data *mii;
|
||||
struct ifmedia *ifm;
|
||||
|
||||
sc = ifp->if_softc;
|
||||
mii = device_get_softc(sc->miibus);
|
||||
EPIC_LOCK(sc);
|
||||
ifm = &mii->mii_media;
|
||||
|
||||
/* Nothing should be selected if interface is down. */
|
||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||
|
||||
+146
-130
@@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2013 Kevin Lo
|
||||
* Copyright (c) 2013-2014 Kevin Lo
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -66,17 +66,22 @@ static const STRUCT_USB_HOST_ID axge_devs[] = {
|
||||
#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
|
||||
AXGE_DEV(ASIX, AX88178A),
|
||||
AXGE_DEV(ASIX, AX88179),
|
||||
/* AXGE_DEV(SITECOMEU, LN032), */
|
||||
AXGE_DEV(DLINK, DUB1312),
|
||||
AXGE_DEV(SITECOMEU, LN032),
|
||||
#undef AXGE_DEV
|
||||
};
|
||||
|
||||
static const struct {
|
||||
unsigned char ctrl, timer_l, timer_h, size, ifg;
|
||||
} AX88179_BULKIN_SIZE[] = {
|
||||
{7, 0x4f, 0, 0x12, 0xff},
|
||||
{7, 0x20, 3, 0x16, 0xff},
|
||||
{7, 0xae, 7, 0x18, 0xff},
|
||||
{7, 0xcc, 0x4c, 0x18, 8},
|
||||
uint8_t ctrl;
|
||||
uint8_t timer_l;
|
||||
uint8_t timer_h;
|
||||
uint8_t size;
|
||||
uint8_t ifg;
|
||||
} axge_bulk_size[] = {
|
||||
{ 7, 0x4f, 0x00, 0x12, 0xff },
|
||||
{ 7, 0x20, 0x03, 0x16, 0xff },
|
||||
{ 7, 0xae, 0x07, 0x18, 0xff },
|
||||
{ 7, 0xcc, 0x4c, 0x18, 0x08 }
|
||||
};
|
||||
|
||||
/* prototypes */
|
||||
@@ -104,10 +109,11 @@ static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t,
|
||||
uint16_t, void *, int);
|
||||
static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t,
|
||||
uint16_t, void *, int);
|
||||
static uint8_t axge_read_cmd_1(struct axge_softc *, uint8_t, uint16_t);
|
||||
static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t,
|
||||
uint16_t);
|
||||
static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t,
|
||||
uint16_t, uint8_t);
|
||||
uint8_t);
|
||||
static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t,
|
||||
uint16_t, uint16_t);
|
||||
static void axge_chip_init(struct axge_softc *);
|
||||
@@ -117,9 +123,9 @@ static int axge_attach_post_sub(struct usb_ether *);
|
||||
static int axge_ifmedia_upd(struct ifnet *);
|
||||
static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
static int axge_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
|
||||
static int axge_rxeof(struct usb_ether *, struct usb_page_cache *,
|
||||
unsigned int, unsigned int, struct axge_csum_hdr *);
|
||||
static void axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
|
||||
static void axge_rxeof(struct usb_ether *, struct usb_page_cache *,
|
||||
unsigned int, unsigned int, uint32_t);
|
||||
static void axge_csum_cfg(struct usb_ether *);
|
||||
|
||||
#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP)
|
||||
@@ -138,7 +144,7 @@ static const struct usb_config axge_config[AXGE_N_TRANSFER] = {
|
||||
.endpoint = UE_ADDR_ANY,
|
||||
.direction = UE_DIR_OUT,
|
||||
.frames = 16,
|
||||
.bufsize = 16 * (MCLBYTES + 16),
|
||||
.bufsize = 16 * MCLBYTES,
|
||||
.flags = {.pipe_bof = 1,.force_short_xfer = 1,},
|
||||
.callback = axge_bulk_write_callback,
|
||||
.timeout = 10000, /* 10 seconds */
|
||||
@@ -233,6 +239,15 @@ axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index,
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
axge_read_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg)
|
||||
{
|
||||
uint8_t val;
|
||||
|
||||
axge_read_mem(sc, cmd, 1, reg, &val, 1);
|
||||
return (val);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index,
|
||||
uint16_t reg)
|
||||
@@ -244,10 +259,9 @@ axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index,
|
||||
}
|
||||
|
||||
static void
|
||||
axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index,
|
||||
uint16_t reg, uint8_t val)
|
||||
axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg, uint8_t val)
|
||||
{
|
||||
axge_write_mem(sc, cmd, index, reg, &val, 1);
|
||||
axge_write_mem(sc, cmd, 1, reg, &val, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -307,6 +321,7 @@ axge_miibus_statchg(device_t dev)
|
||||
struct axge_softc *sc;
|
||||
struct mii_data *mii;
|
||||
struct ifnet *ifp;
|
||||
uint8_t link_status, tmp[5];
|
||||
uint16_t val;
|
||||
int locked;
|
||||
|
||||
@@ -339,26 +354,41 @@ axge_miibus_statchg(device_t dev)
|
||||
if ((sc->sc_flags & AXGE_FLAG_LINK) == 0)
|
||||
goto done;
|
||||
|
||||
link_status = axge_read_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PLSR);
|
||||
|
||||
val = 0;
|
||||
if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) {
|
||||
val |= AXGE_MEDIUM_FULL_DUPLEX;
|
||||
val |= MSR_FD;
|
||||
if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0)
|
||||
val |= AXGE_MEDIUM_TXFLOW_CTRLEN;
|
||||
val |= MSR_TFC;
|
||||
if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0)
|
||||
val |= AXGE_MEDIUM_RXFLOW_CTRLEN;
|
||||
val |= MSR_RFC;
|
||||
}
|
||||
val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE;
|
||||
val |= MSR_RE;
|
||||
switch (IFM_SUBTYPE(mii->mii_media_active)) {
|
||||
case IFM_1000_T:
|
||||
val |= AXGE_MEDIUM_GIGAMODE;
|
||||
val |= MSR_GM | MSR_EN_125MHZ;
|
||||
if (link_status & PLSR_USB_SS)
|
||||
memcpy(tmp, &axge_bulk_size[0], 5);
|
||||
else if (link_status & PLSR_USB_HS)
|
||||
memcpy(tmp, &axge_bulk_size[1], 5);
|
||||
else
|
||||
memcpy(tmp, &axge_bulk_size[3], 5);
|
||||
break;
|
||||
case IFM_100_TX:
|
||||
val |= AXGE_MEDIUM_PS;
|
||||
val |= MSR_PS;
|
||||
if (link_status & (PLSR_USB_SS | PLSR_USB_HS))
|
||||
memcpy(tmp, &axge_bulk_size[2], 5);
|
||||
else
|
||||
memcpy(tmp, &axge_bulk_size[3], 5);
|
||||
break;
|
||||
case IFM_10_T:
|
||||
/* Doesn't need to be handled. */
|
||||
memcpy(tmp, &axge_bulk_size[3], 5);
|
||||
break;
|
||||
}
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val);
|
||||
|
||||
/* Rx bulk configuration. */
|
||||
axge_write_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val);
|
||||
done:
|
||||
if (!locked)
|
||||
AXGE_UNLOCK(sc);
|
||||
@@ -368,11 +398,10 @@ static void
|
||||
axge_chip_init(struct axge_softc *sc)
|
||||
{
|
||||
/* Power up ethernet PHY. */
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL,
|
||||
AXGE_PHYPWR_RSTCTL_IPRL);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, 0);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, EPPRCR_IPRL);
|
||||
uether_pause(&sc->sc_ue, hz / 4);
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT,
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CLK_SELECT,
|
||||
AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS);
|
||||
uether_pause(&sc->sc_ue, hz / 10);
|
||||
}
|
||||
@@ -401,17 +430,13 @@ static void
|
||||
axge_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct axge_softc *sc;
|
||||
uint8_t tmp[5];
|
||||
|
||||
sc = uether_getsc(ue);
|
||||
sc->sc_phyno = 3;
|
||||
|
||||
/* Initialize controller and get station address. */
|
||||
axge_chip_init(sc);
|
||||
|
||||
memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5);
|
||||
axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5);
|
||||
axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID,
|
||||
axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR,
|
||||
ue->ue_eaddr, ETHER_ADDR_LEN);
|
||||
}
|
||||
|
||||
@@ -439,7 +464,7 @@ axge_attach_post_sub(struct usb_ether *ue)
|
||||
mtx_lock(&Giant);
|
||||
error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp,
|
||||
uether_ifmedia_upd, ue->ue_methods->ue_mii_sts,
|
||||
BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0);
|
||||
BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE);
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
return (error);
|
||||
@@ -608,9 +633,7 @@ axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error)
|
||||
struct usb_page_cache *pc;
|
||||
struct mbuf *m;
|
||||
uint32_t txhdr;
|
||||
uint32_t txhdr2;
|
||||
int nframes;
|
||||
int frm_len;
|
||||
int nframes, pos;
|
||||
|
||||
sc = usbd_xfer_softc(xfer);
|
||||
ifp = uether_getifp(&sc->sc_ue);
|
||||
@@ -637,26 +660,18 @@ tr_setup:
|
||||
break;
|
||||
usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES,
|
||||
nframes);
|
||||
frm_len = 0;
|
||||
pos = 0;
|
||||
pc = usbd_xfer_get_frame(xfer, nframes);
|
||||
|
||||
txhdr = m->m_pkthdr.len;
|
||||
txhdr = htole32(txhdr);
|
||||
txhdr = htole32(m->m_pkthdr.len);
|
||||
usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr));
|
||||
frm_len += sizeof(txhdr);
|
||||
|
||||
txhdr2 = 0;
|
||||
if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) %
|
||||
usbd_xfer_max_framelen(xfer) == 0) {
|
||||
txhdr2 |= 0x80008000;
|
||||
}
|
||||
txhdr2 = htole32(txhdr2);
|
||||
usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2));
|
||||
frm_len += sizeof(txhdr2);
|
||||
|
||||
/* Next copy in the actual packet. */
|
||||
usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len);
|
||||
frm_len += m->m_pkthdr.len;
|
||||
txhdr = 0;
|
||||
txhdr = htole32(txhdr);
|
||||
usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr));
|
||||
pos += 8;
|
||||
usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len);
|
||||
pos += m->m_pkthdr.len;
|
||||
if ((pos % usbd_xfer_max_framelen(xfer)) == 0)
|
||||
txhdr |= 0x80008000;
|
||||
|
||||
/*
|
||||
* XXX
|
||||
@@ -678,7 +693,7 @@ tr_setup:
|
||||
m_freem(m);
|
||||
|
||||
/* Set frame length. */
|
||||
usbd_xfer_set_frame_len(xfer, nframes, frm_len);
|
||||
usbd_xfer_set_frame_len(xfer, nframes, pos);
|
||||
}
|
||||
if (nframes != 0) {
|
||||
usbd_xfer_set_frames(xfer, nframes);
|
||||
@@ -733,13 +748,13 @@ axge_setmulti(struct usb_ether *ue)
|
||||
h = 0;
|
||||
AXGE_LOCK_ASSERT(sc, MA_OWNED);
|
||||
|
||||
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL);
|
||||
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR);
|
||||
if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
|
||||
rxmode |= AXGE_RX_CTL_AMALL;
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode);
|
||||
rxmode |= RCR_AMALL;
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
|
||||
return;
|
||||
}
|
||||
rxmode &= ~AXGE_RX_CTL_AMALL;
|
||||
rxmode &= ~RCR_AMALL;
|
||||
|
||||
if_maddr_rlock(ifp);
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
@@ -751,9 +766,8 @@ axge_setmulti(struct usb_ether *ue)
|
||||
}
|
||||
if_maddr_runlock(ifp);
|
||||
|
||||
axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY,
|
||||
(void *)&hashtbl, 8);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode);
|
||||
axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MFA, (void *)&hashtbl, 8);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -765,14 +779,14 @@ axge_setpromisc(struct usb_ether *ue)
|
||||
|
||||
sc = uether_getsc(ue);
|
||||
ifp = uether_getifp(ue);
|
||||
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL);
|
||||
rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR);
|
||||
|
||||
if (ifp->if_flags & IFF_PROMISC)
|
||||
rxmode |= AXGE_RX_CTL_PRO;
|
||||
rxmode |= RCR_PRO;
|
||||
else
|
||||
rxmode &= ~AXGE_RX_CTL_PRO;
|
||||
rxmode &= ~RCR_PRO;
|
||||
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
|
||||
axge_setmulti(ue);
|
||||
}
|
||||
|
||||
@@ -811,27 +825,31 @@ axge_init(struct usb_ether *ue)
|
||||
axge_reset(sc);
|
||||
|
||||
/* Set MAC address. */
|
||||
axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID,
|
||||
axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR,
|
||||
IF_LLADDR(ifp), ETHER_ADDR_LEN);
|
||||
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34);
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH,
|
||||
0x52);
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLLR, 0x34);
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLHR, 0x52);
|
||||
|
||||
/* Configure TX/RX checksum offloading. */
|
||||
axge_csum_cfg(ue);
|
||||
|
||||
/* Configure RX settings. */
|
||||
rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START);
|
||||
rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE);
|
||||
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
|
||||
rxmode |= RCR_IPE;
|
||||
|
||||
/* If we want promiscuous mode, set the allframes bit. */
|
||||
if (ifp->if_flags & IFF_PROMISC)
|
||||
rxmode |= AXGE_RX_CTL_PRO;
|
||||
rxmode |= RCR_PRO;
|
||||
|
||||
if (ifp->if_flags & IFF_BROADCAST)
|
||||
rxmode |= AXGE_RX_CTL_AB;
|
||||
rxmode |= RCR_AB;
|
||||
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode);
|
||||
axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode);
|
||||
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR,
|
||||
MMSR_PME_TYPE | MMSR_PME_POL | MMSR_RWMP);
|
||||
|
||||
/* Load the multicast filter. */
|
||||
axge_setmulti(ue);
|
||||
@@ -907,53 +925,60 @@ axge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
|
||||
{
|
||||
struct axge_softc *sc;
|
||||
struct axge_csum_hdr csum_hdr;
|
||||
int error, len, pos;
|
||||
int pkt_cnt;
|
||||
uint32_t pos;
|
||||
uint32_t pkt_cnt;
|
||||
uint32_t rxhdr;
|
||||
uint16_t hdr_off;
|
||||
uint16_t pktlen;
|
||||
uint32_t pkt_hdr;
|
||||
uint32_t hdr_off;
|
||||
uint32_t pktlen;
|
||||
|
||||
/* verify we have enough data */
|
||||
if (actlen < (int)sizeof(rxhdr))
|
||||
return;
|
||||
|
||||
sc = uether_getsc(ue);
|
||||
pos = 0;
|
||||
len = 0;
|
||||
error = 0;
|
||||
|
||||
usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr));
|
||||
actlen -= sizeof(rxhdr);
|
||||
rxhdr = le32toh(rxhdr);
|
||||
|
||||
pkt_cnt = (uint16_t)rxhdr;
|
||||
hdr_off = (uint16_t)(rxhdr >> 16);
|
||||
|
||||
usbd_copy_out(pc, pos + hdr_off, &csum_hdr, sizeof(csum_hdr));
|
||||
csum_hdr.len = le16toh(csum_hdr.len);
|
||||
csum_hdr.cstatus = le16toh(csum_hdr.cstatus);
|
||||
|
||||
while (pkt_cnt--) {
|
||||
if (actlen <= sizeof(csum_hdr) + sizeof(struct ether_header)) {
|
||||
error = EINVAL;
|
||||
/* verify the header offset */
|
||||
if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) {
|
||||
DPRINTF("End of packet headers\n");
|
||||
break;
|
||||
}
|
||||
pktlen = AXGE_CSUM_RXBYTES(csum_hdr.len);
|
||||
if ((int)pos >= actlen) {
|
||||
DPRINTF("Data position reached end\n");
|
||||
break;
|
||||
}
|
||||
usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr));
|
||||
|
||||
if (pkt_cnt == 0)
|
||||
/* Skip the 2-byte IP alignment header. */
|
||||
axge_rxeof(ue, pc, 2, pktlen - 2, &csum_hdr);
|
||||
pkt_hdr = le32toh(pkt_hdr);
|
||||
pktlen = (pkt_hdr >> 16) & 0x1fff;
|
||||
if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) {
|
||||
DPRINTF("Dropped a packet\n");
|
||||
ue->ue_ifp->if_ierrors++;
|
||||
}
|
||||
if (pktlen >= 2 && (int)(pos + pktlen) <= actlen) {
|
||||
axge_rxeof(ue, pc, pos + 2, pktlen - 2, pkt_hdr);
|
||||
} else {
|
||||
DPRINTF("Invalid packet pos=%d len=%d\n",
|
||||
(int)pos, (int)pktlen);
|
||||
}
|
||||
pos += (pktlen + 7) & ~7;
|
||||
hdr_off += sizeof(pkt_hdr);
|
||||
}
|
||||
|
||||
if (error != 0)
|
||||
ue->ue_ifp->if_ierrors++;
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc,
|
||||
unsigned int offset, unsigned int len, struct axge_csum_hdr *csum_hdr)
|
||||
unsigned int offset, unsigned int len, uint32_t pkt_hdr)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
@@ -961,42 +986,34 @@ axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc,
|
||||
ifp = ue->ue_ifp;
|
||||
if (len < ETHER_HDR_LEN || len > MCLBYTES - ETHER_ALIGN) {
|
||||
ifp->if_ierrors++;
|
||||
return (EINVAL);
|
||||
return;
|
||||
}
|
||||
|
||||
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
|
||||
if (m == NULL) {
|
||||
ifp->if_iqdrops++;
|
||||
return (ENOMEM);
|
||||
return;
|
||||
}
|
||||
m->m_len = m->m_pkthdr.len = MCLBYTES;
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_len = m->m_pkthdr.len = len + ETHER_ALIGN;
|
||||
m_adj(m, ETHER_ALIGN);
|
||||
|
||||
usbd_copy_out(pc, offset, mtod(m, uint8_t *), len);
|
||||
|
||||
ifp->if_ipackets++;
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = len;
|
||||
|
||||
if (csum_hdr != NULL &&
|
||||
csum_hdr->cstatus & AXGE_CSUM_HDR_L3_TYPE_IPV4) {
|
||||
if ((csum_hdr->cstatus & (AXGE_CSUM_HDR_L4_CSUM_ERR |
|
||||
AXGE_RXHDR_L4CSUM_ERR)) == 0) {
|
||||
m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED |
|
||||
CSUM_IP_VALID;
|
||||
if ((csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) ==
|
||||
AXGE_CSUM_HDR_L4_TYPE_TCP ||
|
||||
(csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) ==
|
||||
AXGE_CSUM_HDR_L4_TYPE_UDP) {
|
||||
m->m_pkthdr.csum_flags |=
|
||||
CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
|
||||
m->m_pkthdr.csum_data = 0xffff;
|
||||
}
|
||||
#if 0
|
||||
if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) {
|
||||
if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) ==
|
||||
AXGE_RXHDR_L4_TYPE_TCP ||
|
||||
(pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) ==
|
||||
AXGE_RXHDR_L4_TYPE_UDP) {
|
||||
m->m_pkthdr.csum_flags |= CSUM_DATA_VALID |
|
||||
CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID;
|
||||
m->m_pkthdr.csum_data = 0xffff;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
_IF_ENQUEUE(&ue->ue_rxq, m);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1012,12 +1029,11 @@ axge_csum_cfg(struct usb_ether *ue)
|
||||
|
||||
csum = 0;
|
||||
if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
|
||||
csum |= AXGE_TXCOE_IP | AXGE_TXCOE_TCP | AXGE_TXCOE_UDP;
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_TXCOE_CTL, csum);
|
||||
csum |= CTCR_IP | CTCR_TCP | CTCR_UDP;
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CTCR, csum);
|
||||
|
||||
csum = 0;
|
||||
if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
|
||||
csum |= AXGE_RXCOE_IP | AXGE_RXCOE_TCP | AXGE_RXCOE_UDP |
|
||||
AXGE_RXCOE_ICMP | AXGE_RXCOE_IGMP;
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_RXCOE_CTL, csum);
|
||||
csum |= CRCR_IP | CRCR_TCP | CRCR_UDP;
|
||||
axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CRCR, csum);
|
||||
}
|
||||
+87
-126
@@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2013 Kevin Lo
|
||||
* Copyright (c) 2013-2014 Kevin Lo
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -26,13 +26,6 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define AX88179_PHY_ID 0x03
|
||||
#define AXGE_MCAST_FILTER_SIZE 8
|
||||
#define AXGE_MAXGE_MCAST 64
|
||||
#define AXGE_EEPROM_LEN 0x40
|
||||
#define AXGE_RX_CHECKSUM 1
|
||||
#define AXGE_TX_CHECKSUM 2
|
||||
|
||||
#define AXGE_ACCESS_MAC 0x01
|
||||
#define AXGE_ACCESS_PHY 0x02
|
||||
#define AXGE_ACCESS_WAKEUP 0x03
|
||||
@@ -43,74 +36,73 @@
|
||||
#define AXGE_WRITE_EFUSE_DIS 0x0A
|
||||
#define AXGE_ACCESS_MFAB 0x10
|
||||
|
||||
#define AXGE_LINK_STATUS 0x02
|
||||
#define AXGE_LINK_STATUS_USB_FS 0x01
|
||||
#define AXGE_LINK_STATUS_USB_HS 0x02
|
||||
#define AXGE_LINK_STATUS_USB_SS 0x04
|
||||
/* Physical link status register */
|
||||
#define AXGE_PLSR 0x02
|
||||
#define PLSR_USB_FS 0x01
|
||||
#define PLSR_USB_HS 0x02
|
||||
#define PLSR_USB_SS 0x04
|
||||
|
||||
#define AXGE_SROM_ADDR 0x07
|
||||
#define AXGE_SROM_DATA_LOW 0x08
|
||||
#define AXGE_SROM_DATA_HIGH 0x09
|
||||
#define AXGE_SROM_CMD 0x0a
|
||||
#define AXGE_SROM_CMD_RD 0x04 /* EEprom read command */
|
||||
#define AXGE_SROM_CMD_WR 0x08 /* EEprom write command */
|
||||
#define AXGE_SROM_CMD_BUSY 0x10 /* EEprom access module busy */
|
||||
/* EEPROM address register */
|
||||
#define AXGE_EAR 0x07
|
||||
|
||||
#define AXGE_RX_CTL 0x0b
|
||||
#define AXGE_RX_CTL_DROPCRCERR 0x0100 /* Drop CRC error packet */
|
||||
#define AXGE_RX_CTL_IPE 0x0200 /* 4-byte IP header alignment */
|
||||
#define AXGE_RX_CTL_TXPADCRC 0x0400 /* Csum value in rx header 3 */
|
||||
#define AXGE_RX_CTL_START 0x0080 /* Ethernet MAC start */
|
||||
#define AXGE_RX_CTL_AP 0x0020 /* Accept physical address from
|
||||
multicast array */
|
||||
#define AXGE_RX_CTL_AM 0x0010
|
||||
#define AXGE_RX_CTL_AB 0x0008
|
||||
#define AXGE_RX_CTL_HA8B 0x0004
|
||||
#define AXGE_RX_CTL_AMALL 0x0002 /* Accept all multicast frames */
|
||||
#define AXGE_RX_CTL_PRO 0x0001 /* Promiscuous Mode */
|
||||
#define AXGE_RX_CTL_STOP 0x0000 /* Stop MAC */
|
||||
/* EEPROM data low register */
|
||||
#define AXGE_EDLR 0x08
|
||||
|
||||
#define AXGE_NODE_ID 0x10
|
||||
#define AXGE_MULTI_FILTER_ARRY 0x16
|
||||
/* EEPROM data high register */
|
||||
#define AXGE_EDHR 0x09
|
||||
|
||||
#define AXGE_MEDIUM_STATUS_MODE 0x22
|
||||
#define AXGE_MEDIUM_GIGAMODE 0x0001
|
||||
#define AXGE_MEDIUM_FULL_DUPLEX 0x0002
|
||||
#define AXGE_MEDIUM_ALWAYS_ONE 0x0004
|
||||
#define AXGE_MEDIUM_EN_125MHZ 0x0008
|
||||
#define AXGE_MEDIUM_RXFLOW_CTRLEN 0x0010
|
||||
#define AXGE_MEDIUM_TXFLOW_CTRLEN 0x0020
|
||||
#define AXGE_MEDIUM_RECEIVE_EN 0x0100
|
||||
#define AXGE_MEDIUM_PS 0x0200
|
||||
#define AXGE_MEDIUM_JUMBO_EN 0x8040
|
||||
/* EEPROM command register */
|
||||
#define AXGE_ECR 0x0a
|
||||
|
||||
#define AXGE_MONITOR_MODE 0x24
|
||||
#define AXGE_MONITOR_MODE_RWLC 0x02
|
||||
#define AXGE_MONITOR_MODE_RWMP 0x04
|
||||
#define AXGE_MONITOR_MODE_RWWF 0x08
|
||||
#define AXGE_MONITOR_MODE_RW_FLAG 0x10
|
||||
#define AXGE_MONITOR_MODE_PMEPOL 0x20
|
||||
#define AXGE_MONITOR_MODE_PMETYPE 0x40
|
||||
/* Rx control register */
|
||||
#define AXGE_RCR 0x0b
|
||||
#define RCR_STOP 0x0000
|
||||
#define RCR_PRO 0x0001
|
||||
#define RCR_AMALL 0x0002
|
||||
#define RCR_AB 0x0008
|
||||
#define RCR_AM 0x0010
|
||||
#define RCR_AP 0x0020
|
||||
#define RCR_SO 0x0080
|
||||
#define RCR_DROP_CRCE 0x0100
|
||||
#define RCR_IPE 0x0200
|
||||
#define RCR_TX_CRC_PAD 0x0400
|
||||
|
||||
#define AXGE_GPIO_CTRL 0x25
|
||||
#define AXGE_GPIO_CTRL_GPIO3EN 0x80
|
||||
#define AXGE_GPIO_CTRL_GPIO2EN 0x40
|
||||
#define AXGE_GPIO_CTRL_GPIO1EN 0x20
|
||||
/* Node id register */
|
||||
#define AXGE_NIDR 0x10
|
||||
|
||||
#define AXGE_PHYPWR_RSTCTL 0x26
|
||||
#define AXGE_PHYPWR_RSTCTL_BZ 0x0010
|
||||
#define AXGE_PHYPWR_RSTCTL_IPRL 0x0020
|
||||
#define AXGE_PHYPWR_RSTCTL_AUTODETACH 0x1000
|
||||
/* Multicast filter array */
|
||||
#define AXGE_MFA 0x16
|
||||
|
||||
/* Medium status register */
|
||||
#define AXGE_MSR 0x22
|
||||
#define MSR_GM 0x0001
|
||||
#define MSR_FD 0x0002
|
||||
#define MSR_EN_125MHZ 0x0008
|
||||
#define MSR_RFC 0x0010
|
||||
#define MSR_TFC 0x0020
|
||||
#define MSR_RE 0x0100
|
||||
#define MSR_PS 0x0200
|
||||
|
||||
/* Monitor mode status register */
|
||||
#define AXGE_MMSR 0x24
|
||||
#define MMSR_RWLC 0x02
|
||||
#define MMSR_RWMP 0x04
|
||||
#define MMSR_RWWF 0x08
|
||||
#define MMSR_RW_FLAG 0x10
|
||||
#define MMSR_PME_POL 0x20
|
||||
#define MMSR_PME_TYPE 0x40
|
||||
#define MMSR_PME_IND 0x80
|
||||
|
||||
/* GPIO control/status register */
|
||||
#define AXGE_GPIOCR 0x25
|
||||
|
||||
/* Ethernet PHY power & reset control register */
|
||||
#define AXGE_EPPRCR 0x26
|
||||
#define EPPRCR_BZ 0x0010
|
||||
#define EPPRCR_IPRL 0x0020
|
||||
#define EPPRCR_AUTODETACH 0x1000
|
||||
|
||||
#define AXGE_RX_BULKIN_QCTRL 0x2e
|
||||
#define AXGE_RX_BULKIN_QCTRL_TIME 0x01
|
||||
#define AXGE_RX_BULKIN_QCTRL_IFG 0x02
|
||||
#define AXGE_RX_BULKIN_QCTRL_SIZE 0x04
|
||||
|
||||
#define AXGE_RX_BULKIN_QTIMR_LOW 0x2f
|
||||
#define AXGE_RX_BULKIN_QTIMR_HIGH 0x30
|
||||
#define AXGE_RX_BULKIN_QSIZE 0x31
|
||||
#define AXGE_RX_BULKIN_QIFG 0x32
|
||||
|
||||
#define AXGE_CLK_SELECT 0x33
|
||||
#define AXGE_CLK_SELECT_BCS 0x01
|
||||
@@ -118,75 +110,44 @@
|
||||
#define AXGE_CLK_SELECT_ACSREQ 0x10
|
||||
#define AXGE_CLK_SELECT_ULR 0x08
|
||||
|
||||
#define AXGE_RXCOE_CTL 0x34
|
||||
#define AXGE_RXCOE_IP 0x01
|
||||
#define AXGE_RXCOE_TCP 0x02
|
||||
#define AXGE_RXCOE_UDP 0x04
|
||||
#define AXGE_RXCOE_ICMP 0x08
|
||||
#define AXGE_RXCOE_IGMP 0x10
|
||||
#define AXGE_RXCOE_TCPV6 0x20
|
||||
#define AXGE_RXCOE_UDPV6 0x40
|
||||
#define AXGE_RXCOE_ICMV6 0x80
|
||||
/* COE Rx control register */
|
||||
#define AXGE_CRCR 0x34
|
||||
#define CRCR_IP 0x01
|
||||
#define CRCR_TCP 0x02
|
||||
#define CRCR_UDP 0x04
|
||||
#define CRCR_ICMP 0x08
|
||||
#define CRCR_IGMP 0x10
|
||||
#define CRCR_TCPV6 0x20
|
||||
#define CRCR_UDPV6 0x40
|
||||
#define CRCR_ICMPV6 0x80
|
||||
|
||||
#define AXGE_TXCOE_CTL 0x35
|
||||
#define AXGE_TXCOE_IP 0x01
|
||||
#define AXGE_TXCOE_TCP 0x02
|
||||
#define AXGE_TXCOE_UDP 0x04
|
||||
#define AXGE_TXCOE_ICMP 0x08
|
||||
#define AXGE_TXCOE_IGMP 0x10
|
||||
#define AXGE_TXCOE_TCPV6 0x20
|
||||
#define AXGE_TXCOE_UDPV6 0x40
|
||||
#define AXGE_TXCOE_ICMV6 0x80
|
||||
/* COE Tx control register */
|
||||
#define AXGE_CTCR 0x35
|
||||
#define CTCR_IP 0x01
|
||||
#define CTCR_TCP 0x02
|
||||
#define CTCR_UDP 0x04
|
||||
#define CTCR_ICMP 0x08
|
||||
#define CTCR_IGMP 0x10
|
||||
#define CTCR_TCPV6 0x20
|
||||
#define CTCR_UDPV6 0x40
|
||||
#define CTCR_ICMPV6 0x80
|
||||
|
||||
#define AXGE_PAUSE_WATERLVL_HIGH 0x54
|
||||
#define AXGE_PAUSE_WATERLVL_LOW 0x55
|
||||
/* Pause water level high register */
|
||||
#define AXGE_PWLHR 0x54
|
||||
|
||||
#define AXGE_EEP_EFUSE_CORRECT 0x00
|
||||
#define AX88179_EEPROM_MAGIC 0x17900b95
|
||||
/* Pause water level low register */
|
||||
#define AXGE_PWLLR 0x55
|
||||
|
||||
#define AXGE_CONFIG_IDX 0 /* config number 1 */
|
||||
#define AXGE_IFACE_IDX 0
|
||||
|
||||
#define AXGE_RXHDR_CRC_ERR 0x80000000
|
||||
#define AXGE_RXHDR_L4_ERR (1 << 8)
|
||||
#define AXGE_RXHDR_L3_ERR (1 << 9)
|
||||
|
||||
#define AXGE_RXHDR_L4_TYPE_ICMP 2
|
||||
#define AXGE_RXHDR_L4_TYPE_IGMP 3
|
||||
#define AXGE_RXHDR_L4_TYPE_TCMPV6 5
|
||||
|
||||
#define AXGE_RXHDR_L3_TYPE_IP 1
|
||||
#define AXGE_RXHDR_L3_TYPE_IPV6 2
|
||||
|
||||
#define AXGE_RXHDR_L4_TYPE_MASK 0x1c
|
||||
#define AXGE_RXHDR_L4CSUM_ERR 1
|
||||
#define AXGE_RXHDR_L3CSUM_ERR 2
|
||||
#define AXGE_RXHDR_L4_TYPE_UDP 4
|
||||
#define AXGE_RXHDR_L4_TYPE_TCP 16
|
||||
#define AXGE_RXHDR_L3CSUM_ERR 2
|
||||
#define AXGE_RXHDR_L4CSUM_ERR 1
|
||||
#define AXGE_RXHDR_CRC_ERR 0x80000000
|
||||
#define AXGE_RXHDR_DROP_ERR 0x40000000
|
||||
|
||||
struct axge_csum_hdr {
|
||||
uint16_t cstatus;
|
||||
#define AXGE_CSUM_HDR_L4_CSUM_ERR 0x0001
|
||||
#define AXGE_CSUM_HDR_L3_CSUM_ERR 0x0002
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_UDP 0x0004
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_ICMP 0x0008
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_IGMP 0x000C
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_TCP 0x0010
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_TCPV6 0x0014
|
||||
#define AXGE_CSUM_HDR_L4_TYPE_MASK 0x001C
|
||||
#define AXGE_CSUM_HDR_L3_TYPE_IPV4 0x0020
|
||||
#define AXGE_CSUM_HDR_L3_TYPE_IPV6 0x0040
|
||||
#define AXGE_CSUM_HDR_VLAN_MASK 0x0700
|
||||
uint16_t len;
|
||||
#define AXGE_CSUM_HDR_LEN_MASK 0x1FFF
|
||||
#define AXGE_CSUM_HDR_CRC_ERR 0x2000
|
||||
#define AXGE_CSUM_HDR_MII_ERR 0x4000
|
||||
#define AXGE_CSUM_HDR_DROP 0x8000
|
||||
} __packed;
|
||||
|
||||
#define AXGE_CSUM_RXBYTES(x) ((x) & AXGE_CSUM_HDR_LEN_MASK)
|
||||
#define AXGE_RXHDR_CRC_ERR 0x20000000
|
||||
#define AXGE_RXHDR_DROP_ERR 0x80000000
|
||||
|
||||
#define GET_MII(sc) uether_getmii(&(sc)->sc_ue)
|
||||
|
||||
|
||||
@@ -558,8 +558,6 @@ uhso_attach(device_t self)
|
||||
mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF);
|
||||
ucom_ref(&sc->sc_super_ucom);
|
||||
|
||||
sc->sc_ucom = NULL;
|
||||
sc->sc_ttys = 0;
|
||||
sc->sc_radio = 1;
|
||||
|
||||
id = usbd_get_interface_descriptor(uaa->iface);
|
||||
@@ -679,9 +677,6 @@ uhso_detach(device_t self)
|
||||
UHSO_CTRL_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
free(sc->sc_tty, M_USBDEV);
|
||||
free(sc->sc_ucom, M_USBDEV);
|
||||
}
|
||||
|
||||
if (sc->sc_ifp != NULL) {
|
||||
@@ -709,6 +704,8 @@ static void
|
||||
uhso_free_softc(struct uhso_softc *sc)
|
||||
{
|
||||
if (ucom_unref(&sc->sc_super_ucom)) {
|
||||
free(sc->sc_tty, M_USBDEV);
|
||||
free(sc->sc_ucom, M_USBDEV);
|
||||
mtx_destroy(&sc->sc_mtx);
|
||||
device_free_softc(sc);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ ucom_uninit(void *arg)
|
||||
|
||||
mtx_destroy(&ucom_mtx);
|
||||
}
|
||||
SYSUNINIT(ucom_uninit, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_uninit, NULL);
|
||||
SYSUNINIT(ucom_uninit, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_uninit, NULL);
|
||||
|
||||
/*
|
||||
* Mark a unit number (the X in cuaUX) as in use.
|
||||
|
||||
@@ -195,7 +195,7 @@ struct ucom_softc {
|
||||
#define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx)
|
||||
#define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx)
|
||||
#define UCOM_UNLOAD_DRAIN(x) \
|
||||
SYSUNINIT(var, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_drain_all, 0)
|
||||
SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0)
|
||||
|
||||
#define ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \
|
||||
usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)
|
||||
|
||||
@@ -1614,6 +1614,7 @@ product DLINK DSB650TX 0x4002 10/100 Ethernet
|
||||
product DLINK DSB650TX_PNA 0x4003 1/10/100 Ethernet
|
||||
product DLINK DSB650TX3 0x400b 10/100 Ethernet
|
||||
product DLINK DSB650TX2 0x4102 10/100 Ethernet
|
||||
product DLINK DUB1312 0x4a00 10/100/1000 Ethernet
|
||||
product DLINK DSB650 0xabc1 10/100 Ethernet
|
||||
product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub
|
||||
product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode
|
||||
@@ -4091,6 +4092,7 @@ product SITECOMEU RT3072_6 0x004d RT3072
|
||||
product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU
|
||||
product SITECOMEU RTL8188CU_2 0x005c RTL8188CU
|
||||
product SITECOMEU RTL8192CU 0x0061 RTL8192CU
|
||||
product SITECOMEU LN032 0x0072 LN-032
|
||||
product SITECOMEU LN028 0x061c LN-028
|
||||
product SITECOMEU WL113 0x9071 WL-113
|
||||
product SITECOMEU ZD1211B 0x9075 ZD1211B
|
||||
|
||||
@@ -984,7 +984,6 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx, const char *provider)
|
||||
G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file,
|
||||
provider, name);
|
||||
g_eli_crypto_hmac_update(ctx, data, size);
|
||||
bzero(data, size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1133,6 +1132,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
|
||||
g_eli_keyfiles_clear(pp->name);
|
||||
return (NULL);
|
||||
}
|
||||
g_eli_keyfiles_clear(pp->name);
|
||||
G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1045,6 +1045,11 @@ sbcreatecontrol(caddr_t p, int size, int type, int level)
|
||||
m->m_len = 0;
|
||||
KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m),
|
||||
("sbcreatecontrol: short mbuf"));
|
||||
/*
|
||||
* Don't leave the padding between the msg header and the
|
||||
* cmsg data and the padding after the cmsg data un-initialized.
|
||||
*/
|
||||
bzero(cp, CMSG_SPACE((u_int)size));
|
||||
if (p != NULL)
|
||||
(void)memcpy(CMSG_DATA(cp), p, size);
|
||||
m->m_len = CMSG_SPACE(size);
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
./etc/defaults/rc.conf
|
||||
./etc/devd
|
||||
./etc/devd/asus.conf
|
||||
./etc/gnats
|
||||
./etc/gnats/freefall
|
||||
./etc/gss
|
||||
./etc/gss/mech
|
||||
./etc/gss/qop
|
||||
|
||||
@@ -17,7 +17,7 @@ FIRMWS += ${F}:${F:C/.txt//}:1.0.0.0
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
T4FW_VER = 1.9.12.0
|
||||
T4FW_VER = 1.11.27.0
|
||||
FIRMWS += t4fw.fw:t4fw:${T4FW_VER}
|
||||
CLEANFILES += t4fw.fw
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ FIRMWS += ${F}:${F:C/.txt//}:1.0.0.0
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
T5FW_VER = 1.9.12.0
|
||||
T5FW_VER = 1.11.27.0
|
||||
FIRMWS += t5fw.fw:t5fw:${T5FW_VER}
|
||||
CLEANFILES += t5fw.fw
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ To use it:
|
||||
It's early days yet, folks -- You'll probably have trouble getting 100%
|
||||
functionality out of most things (specifically, poll() on a socket doesn't
|
||||
look like it works at the moment, so Netscape doesn't work (among other
|
||||
things)). Patches will be appreciated (use send-pr).
|
||||
things)). Patches will be appreciated.
|
||||
|
||||
- Mark Newton
|
||||
[email protected]
|
||||
|
||||
@@ -1889,14 +1889,22 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
* this is boundall or subset bound w/ASCONF allowed
|
||||
*/
|
||||
|
||||
/* first, make sure it's a good address family */
|
||||
/* first, make sure that the address is IPv4 or IPv6 and not jailed */
|
||||
switch (ifa->address.sa.sa_family) {
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin6.sin6_addr) != 0) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin.sin_addr) != 0) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -2122,6 +2130,10 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
/* we skip unspecifed addresses */
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
if (stcb->asoc.scope.local_scope == 0) {
|
||||
continue;
|
||||
@@ -2152,6 +2164,10 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
/* we skip unspecifed addresses */
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (stcb->asoc.scope.ipv4_local_scope == 0 &&
|
||||
IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) {
|
||||
continue;
|
||||
@@ -2465,6 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tcb *stcb, int addr_locked)
|
||||
/* skip unspecifed addresses */
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (stcb->asoc.scope.ipv4_local_scope == 0 &&
|
||||
IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))
|
||||
continue;
|
||||
@@ -2498,6 +2518,10 @@ sctp_find_valid_localaddr(struct sctp_tcb *stcb, int addr_locked)
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (stcb->asoc.scope.local_scope == 0 &&
|
||||
IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
|
||||
continue;
|
||||
@@ -3112,6 +3136,10 @@ sctp_check_address_list_all(struct sctp_tcb *stcb, struct mbuf *m, int offset,
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
sin = (struct sockaddr_in *)&sctp_ifa->address.sin;
|
||||
if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((ipv4_scope == 0) &&
|
||||
(IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
|
||||
/* private address not in scope */
|
||||
@@ -3122,6 +3150,10 @@ sctp_check_address_list_all(struct sctp_tcb *stcb, struct mbuf *m, int offset,
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6;
|
||||
if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((local_scope == 0) &&
|
||||
(IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) {
|
||||
continue;
|
||||
@@ -3407,6 +3439,10 @@ sctp_asconf_send_nat_state_update(struct sctp_tcb *stcb,
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
to = &sctp_ifap->address.sin;
|
||||
if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&to->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN4_ISPRIVATE_ADDRESS(&to->sin_addr)) {
|
||||
continue;
|
||||
}
|
||||
@@ -3418,6 +3454,10 @@ sctp_asconf_send_nat_state_update(struct sctp_tcb *stcb,
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
to6 = &sctp_ifap->address.sin6;
|
||||
if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&to6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LOOPBACK(&to6->sin6_addr)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1790,6 +1790,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication,
|
||||
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
auth = mtod(m_notify, struct sctp_authkey_event *);
|
||||
memset(auth, 0, sizeof(struct sctp_authkey_event));
|
||||
auth->auth_type = SCTP_AUTHENTICATION_EVENT;
|
||||
auth->auth_flags = 0;
|
||||
auth->auth_length = sizeof(*auth);
|
||||
|
||||
@@ -250,6 +250,11 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
|
||||
|
||||
/* We need a CMSG header followed by the struct */
|
||||
cmh = mtod(ret, struct cmsghdr *);
|
||||
/*
|
||||
* Make sure that there is no un-initialized padding between the
|
||||
* cmsg header and cmsg data and after the cmsg data.
|
||||
*/
|
||||
memset(cmh, 0, len);
|
||||
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
|
||||
cmh->cmsg_level = IPPROTO_SCTP;
|
||||
cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo));
|
||||
|
||||
+152
-6
@@ -2060,6 +2060,20 @@ sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
continue;
|
||||
}
|
||||
LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifap->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifap->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifap->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifap->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (sctp_is_addr_restricted(stcb, sctp_ifap)) {
|
||||
continue;
|
||||
}
|
||||
@@ -2089,6 +2103,20 @@ skip_count:
|
||||
continue;
|
||||
}
|
||||
LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifap->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifap->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifap->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifap->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (sctp_is_addr_restricted(stcb, sctp_ifap)) {
|
||||
continue;
|
||||
}
|
||||
@@ -2453,6 +2481,20 @@ sctp_choose_boundspecific_inp(struct sctp_inpcb *inp,
|
||||
if (sctp_ifn) {
|
||||
/* is a preferred one on the interface we route out? */
|
||||
LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
@@ -2576,6 +2618,20 @@ sctp_choose_boundspecific_stcb(struct sctp_inpcb *inp,
|
||||
if (sctp_ifn) {
|
||||
/* first try for a preferred address on the ep */
|
||||
LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
if (sctp_is_addr_in_ep(inp, sctp_ifa)) {
|
||||
@@ -2596,6 +2652,20 @@ sctp_choose_boundspecific_stcb(struct sctp_inpcb *inp,
|
||||
}
|
||||
/* next try for an acceptable address on the ep */
|
||||
LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
if (sctp_is_addr_in_ep(inp, sctp_ifa)) {
|
||||
@@ -2700,6 +2770,7 @@ sctp_from_the_top2:
|
||||
|
||||
static struct sctp_ifa *
|
||||
sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
|
||||
struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb,
|
||||
int non_asoc_addr_ok,
|
||||
uint8_t dest_is_loop,
|
||||
@@ -2721,6 +2792,20 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
|
||||
}
|
||||
#endif /* INET6 */
|
||||
LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
@@ -2806,6 +2891,7 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
|
||||
|
||||
static int
|
||||
sctp_count_num_preferred_boundall(struct sctp_ifn *ifn,
|
||||
struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb,
|
||||
int non_asoc_addr_ok,
|
||||
uint8_t dest_is_loop,
|
||||
@@ -2816,6 +2902,21 @@ sctp_count_num_preferred_boundall(struct sctp_ifn *ifn,
|
||||
int num_eligible_addr = 0;
|
||||
|
||||
LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(stcb != NULL) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0)) {
|
||||
continue;
|
||||
@@ -2847,7 +2948,8 @@ sctp_count_num_preferred_boundall(struct sctp_ifn *ifn,
|
||||
}
|
||||
|
||||
static struct sctp_ifa *
|
||||
sctp_choose_boundall(struct sctp_tcb *stcb,
|
||||
sctp_choose_boundall(struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net,
|
||||
sctp_route_t * ro,
|
||||
uint32_t vrf_id,
|
||||
@@ -2902,7 +3004,7 @@ sctp_choose_boundall(struct sctp_tcb *stcb,
|
||||
cur_addr_num = net->indx_of_eligible_next_to_use;
|
||||
}
|
||||
num_preferred = sctp_count_num_preferred_boundall(sctp_ifn,
|
||||
stcb,
|
||||
inp, stcb,
|
||||
non_asoc_addr_ok,
|
||||
dest_is_loop,
|
||||
dest_is_priv, fam);
|
||||
@@ -2929,7 +3031,7 @@ sctp_choose_boundall(struct sctp_tcb *stcb,
|
||||
*/
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "cur_addr_num:%d\n", cur_addr_num);
|
||||
|
||||
sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop,
|
||||
sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop,
|
||||
dest_is_priv, cur_addr_num, fam, ro);
|
||||
|
||||
/* if sctp_ifa is NULL something changed??, fall to plan b. */
|
||||
@@ -2960,7 +3062,7 @@ bound_all_plan_b:
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "already seen\n");
|
||||
continue;
|
||||
}
|
||||
num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, stcb, non_asoc_addr_ok,
|
||||
num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok,
|
||||
dest_is_loop, dest_is_priv, fam);
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2,
|
||||
"Found ifn:%p %d preferred source addresses\n",
|
||||
@@ -2982,7 +3084,7 @@ bound_all_plan_b:
|
||||
if (cur_addr_num >= num_preferred) {
|
||||
cur_addr_num = 0;
|
||||
}
|
||||
sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop,
|
||||
sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop,
|
||||
dest_is_priv, cur_addr_num, fam, ro);
|
||||
if (sifa == NULL)
|
||||
continue;
|
||||
@@ -3010,6 +3112,22 @@ again_with_private_addresses_allowed:
|
||||
}
|
||||
LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) {
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa);
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0)) {
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n");
|
||||
@@ -3060,6 +3178,20 @@ plan_d:
|
||||
continue;
|
||||
}
|
||||
LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
@@ -3110,6 +3242,20 @@ out:
|
||||
LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
|
||||
struct sctp_ifa *tmp_sifa;
|
||||
|
||||
#ifdef INET
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
|
||||
(prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin.sin_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
|
||||
(prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sctp_ifa->address.sin6.sin6_addr) != 0)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
|
||||
(non_asoc_addr_ok == 0))
|
||||
continue;
|
||||
@@ -3295,7 +3441,7 @@ sctp_source_address_selection(struct sctp_inpcb *inp,
|
||||
/*
|
||||
* Bound all case
|
||||
*/
|
||||
answer = sctp_choose_boundall(stcb, net, ro, vrf_id,
|
||||
answer = sctp_choose_boundall(inp, stcb, net, ro, vrf_id,
|
||||
dest_is_priv, dest_is_loop,
|
||||
non_asoc_addr_ok, fam);
|
||||
SCTP_IPI_ADDR_RUNLOCK();
|
||||
|
||||
+82
-13
@@ -898,6 +898,10 @@ sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
|
||||
IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) {
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) {
|
||||
SCTP_IPI_ADDR_RUNLOCK();
|
||||
return (1);
|
||||
@@ -913,6 +917,10 @@ sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
|
||||
|
||||
sin6 = &sctp_ifa->address.sin6;
|
||||
rsin6 = (struct sockaddr_in6 *)to;
|
||||
if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
if (local_scope == 0)
|
||||
continue;
|
||||
@@ -1060,6 +1068,39 @@ sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from,
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
switch (to->sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
{
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
sin = (struct sockaddr_in *)to;
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
{
|
||||
struct sockaddr_in6 *sin6;
|
||||
|
||||
sin6 = (struct sockaddr_in6 *)to;
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
if (inp->def_vrf_id != vrf_id) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
@@ -1628,23 +1669,45 @@ sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head,
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) &&
|
||||
(inp->sctp_lport == lport)) {
|
||||
/* got it */
|
||||
switch (nam->sa_family) {
|
||||
#ifdef INET
|
||||
if ((nam->sa_family == AF_INET) &&
|
||||
(inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(inp)) {
|
||||
/* IPv4 on a IPv6 socket with ONLY IPv6 set */
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
case AF_INET:
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(inp)) {
|
||||
/*
|
||||
* IPv4 on a IPv6 socket with ONLY
|
||||
* IPv6 set
|
||||
*/
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
/* A V6 address and the endpoint is NOT bound V6 */
|
||||
if (nam->sa_family == AF_INET6 &&
|
||||
(inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
case AF_INET6:
|
||||
/*
|
||||
* A V6 address and the endpoint is NOT
|
||||
* bound V6
|
||||
*/
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
SCTP_INP_RUNLOCK(inp);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* does a VRF id match? */
|
||||
fnd = 0;
|
||||
if (inp->def_vrf_id == vrf_id)
|
||||
@@ -2403,6 +2466,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
/* setup socket pointers */
|
||||
inp->sctp_socket = so;
|
||||
inp->ip_inp.inp.inp_socket = so;
|
||||
inp->ip_inp.inp.inp_cred = crhold(so->so_cred);
|
||||
#ifdef INET6
|
||||
if (INP_SOCKAF(so) == AF_INET6) {
|
||||
if (MODULE_GLOBAL(ip6_auto_flowlabel)) {
|
||||
@@ -2421,6 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
/* init the small hash table we use to track asocid <-> tcb */
|
||||
inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark);
|
||||
if (inp->sctp_asocidhash == NULL) {
|
||||
crfree(inp->ip_inp.inp.inp_cred);
|
||||
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
|
||||
SCTP_INP_INFO_WUNLOCK();
|
||||
return (ENOBUFS);
|
||||
@@ -2435,6 +2500,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
((struct in6pcb *)(&inp->ip_inp.inp))->in6p_sp = pcb_sp;
|
||||
}
|
||||
if (error != 0) {
|
||||
crfree(inp->ip_inp.inp.inp_cred);
|
||||
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
|
||||
SCTP_INP_INFO_WUNLOCK();
|
||||
return error;
|
||||
@@ -2465,6 +2531,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
*/
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP);
|
||||
so->so_pcb = NULL;
|
||||
crfree(inp->ip_inp.inp.inp_cred);
|
||||
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
@@ -2484,6 +2551,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n");
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS);
|
||||
so->so_pcb = NULL;
|
||||
crfree(inp->ip_inp.inp.inp_cred);
|
||||
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
|
||||
return (ENOBUFS);
|
||||
}
|
||||
@@ -3630,6 +3698,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
|
||||
inp->sctp_tcbhash = NULL;
|
||||
}
|
||||
/* Now we must put the ep memory back into the zone pool */
|
||||
crfree(inp->ip_inp.inp.inp_cred);
|
||||
INP_LOCK_DESTROY(&inp->ip_inp.inp);
|
||||
SCTP_INP_LOCK_DESTROY(inp);
|
||||
SCTP_INP_READ_DESTROY(inp);
|
||||
|
||||
@@ -252,6 +252,10 @@ copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct s
|
||||
sin = (struct sockaddr_in *)&sctp_ifa->address.sa;
|
||||
if (sin->sin_addr.s_addr == 0)
|
||||
continue;
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)))
|
||||
continue;
|
||||
} else {
|
||||
@@ -267,6 +271,10 @@ copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct s
|
||||
sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa;
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))
|
||||
continue;
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
if (local_scope == 0)
|
||||
continue;
|
||||
|
||||
+68
-24
@@ -1197,6 +1197,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp,
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((ipv4_local_scope == 0) &&
|
||||
(IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
|
||||
continue;
|
||||
@@ -1238,6 +1242,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp,
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
if (local_scope == 0)
|
||||
continue;
|
||||
@@ -5239,6 +5247,43 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
error = EINVAL;
|
||||
goto out_of_it;
|
||||
}
|
||||
} else {
|
||||
switch (sspp->sspp_addr.ss_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
{
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
sin = (struct sockaddr_in *)&sspp->sspp_addr;
|
||||
if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
goto out_of_it;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
{
|
||||
struct sockaddr_in6 *sin6;
|
||||
|
||||
sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr;
|
||||
if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
goto out_of_it;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
goto out_of_it;
|
||||
}
|
||||
}
|
||||
if (sctp_set_primary_ip_address_sa(stcb,
|
||||
(struct sockaddr *)&sspp->sspp_addr) != 0) {
|
||||
@@ -5597,7 +5642,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id);
|
||||
net = NULL;
|
||||
if (stcb) {
|
||||
net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_assoc_id);
|
||||
net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address);
|
||||
} else {
|
||||
/*
|
||||
* We increment here since
|
||||
@@ -5608,7 +5653,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
*/
|
||||
SCTP_INP_INCR_REF(inp);
|
||||
stcb = sctp_findassociation_ep_addr(&inp,
|
||||
(struct sockaddr *)&thlds->spt_assoc_id,
|
||||
(struct sockaddr *)&thlds->spt_address,
|
||||
&net, NULL, NULL);
|
||||
if (stcb == NULL) {
|
||||
SCTP_INP_DECR_REF(inp);
|
||||
@@ -5617,7 +5662,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
if (stcb && (net == NULL)) {
|
||||
struct sockaddr *sa;
|
||||
|
||||
sa = (struct sockaddr *)&thlds->spt_assoc_id;
|
||||
sa = (struct sockaddr *)&thlds->spt_address;
|
||||
#ifdef INET
|
||||
if (sa->sa_family == AF_INET) {
|
||||
|
||||
@@ -6053,30 +6098,29 @@ sctp_listen(struct socket *so, int backlog, struct thread *p)
|
||||
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) {
|
||||
/* See if we have a listener */
|
||||
struct sctp_inpcb *tinp;
|
||||
union sctp_sockstore store, *sp;
|
||||
union sctp_sockstore store;
|
||||
|
||||
sp = &store;
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
|
||||
/* not bound all */
|
||||
struct sctp_laddr *laddr;
|
||||
|
||||
LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
|
||||
memcpy(&store, &laddr->ifa->address, sizeof(store));
|
||||
switch (sp->sa.sa_family) {
|
||||
switch (store.sa.sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
sp->sin.sin_port = inp->sctp_lport;
|
||||
store.sin.sin_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
sp->sin6.sin6_port = inp->sctp_lport;
|
||||
store.sin6.sin6_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id);
|
||||
tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
|
||||
if (tinp && (tinp != inp) &&
|
||||
((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) &&
|
||||
((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) &&
|
||||
@@ -6094,20 +6138,6 @@ sctp_listen(struct socket *so, int backlog, struct thread *p)
|
||||
} else {
|
||||
/* Setup a local addr bound all */
|
||||
memset(&store, 0, sizeof(store));
|
||||
switch (sp->sa.sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
store.sin.sin_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
sp->sin6.sin6_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#ifdef INET6
|
||||
if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
|
||||
store.sa.sa_family = AF_INET6;
|
||||
@@ -6120,7 +6150,21 @@ sctp_listen(struct socket *so, int backlog, struct thread *p)
|
||||
store.sa.sa_len = sizeof(struct sockaddr_in);
|
||||
}
|
||||
#endif
|
||||
tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id);
|
||||
switch (store.sa.sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
store.sin.sin_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
store.sin6.sin6_port = inp->sctp_lport;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
|
||||
if (tinp && (tinp != inp) &&
|
||||
((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) &&
|
||||
((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) &&
|
||||
|
||||
+36
-27
@@ -2622,6 +2622,7 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb,
|
||||
}
|
||||
SCTP_BUF_NEXT(m_notify) = NULL;
|
||||
sac = mtod(m_notify, struct sctp_assoc_change *);
|
||||
memset(sac, 0, notif_len);
|
||||
sac->sac_type = SCTP_ASSOC_CHANGE;
|
||||
sac->sac_flags = 0;
|
||||
sac->sac_length = sizeof(struct sctp_assoc_change);
|
||||
@@ -2835,21 +2836,21 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error,
|
||||
if (m_notify == NULL)
|
||||
/* no space left */
|
||||
return;
|
||||
length += chk->send_size;
|
||||
length -= sizeof(struct sctp_data_chunk);
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) {
|
||||
ssfe = mtod(m_notify, struct sctp_send_failed_event *);
|
||||
memset(ssfe, 0, length);
|
||||
ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT;
|
||||
if (sent) {
|
||||
ssfe->ssfe_flags = SCTP_DATA_SENT;
|
||||
} else {
|
||||
ssfe->ssfe_flags = SCTP_DATA_UNSENT;
|
||||
}
|
||||
length += chk->send_size;
|
||||
length -= sizeof(struct sctp_data_chunk);
|
||||
ssfe->ssfe_length = length;
|
||||
ssfe->ssfe_error = error;
|
||||
/* not exactly what the user sent in, but should be close :) */
|
||||
bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info));
|
||||
ssfe->ssfe_info.snd_sid = chk->rec.data.stream_number;
|
||||
ssfe->ssfe_info.snd_flags = chk->rec.data.rcv_flags;
|
||||
ssfe->ssfe_info.snd_ppid = chk->rec.data.payloadtype;
|
||||
@@ -2859,12 +2860,15 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error,
|
||||
SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event);
|
||||
} else {
|
||||
ssf = mtod(m_notify, struct sctp_send_failed *);
|
||||
memset(ssf, 0, length);
|
||||
ssf->ssf_type = SCTP_SEND_FAILED;
|
||||
if (sent) {
|
||||
ssf->ssf_flags = SCTP_DATA_SENT;
|
||||
} else {
|
||||
ssf->ssf_flags = SCTP_DATA_UNSENT;
|
||||
}
|
||||
length += chk->send_size;
|
||||
length -= sizeof(struct sctp_data_chunk);
|
||||
ssf->ssf_length = length;
|
||||
ssf->ssf_error = error;
|
||||
/* not exactly what the user sent in, but should be close :) */
|
||||
@@ -2948,16 +2952,16 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error,
|
||||
/* no space left */
|
||||
return;
|
||||
}
|
||||
length += sp->length;
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) {
|
||||
ssfe = mtod(m_notify, struct sctp_send_failed_event *);
|
||||
memset(ssfe, 0, length);
|
||||
ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT;
|
||||
ssfe->ssfe_flags = SCTP_DATA_UNSENT;
|
||||
length += sp->length;
|
||||
ssfe->ssfe_length = length;
|
||||
ssfe->ssfe_error = error;
|
||||
/* not exactly what the user sent in, but should be close :) */
|
||||
bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info));
|
||||
ssfe->ssfe_info.snd_sid = sp->stream;
|
||||
if (sp->some_taken) {
|
||||
ssfe->ssfe_info.snd_flags = SCTP_DATA_LAST_FRAG;
|
||||
@@ -2971,12 +2975,13 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error,
|
||||
SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event);
|
||||
} else {
|
||||
ssf = mtod(m_notify, struct sctp_send_failed *);
|
||||
memset(ssf, 0, length);
|
||||
ssf->ssf_type = SCTP_SEND_FAILED;
|
||||
ssf->ssf_flags = SCTP_DATA_UNSENT;
|
||||
length += sp->length;
|
||||
ssf->ssf_length = length;
|
||||
ssf->ssf_error = error;
|
||||
/* not exactly what the user sent in, but should be close :) */
|
||||
bzero(&ssf->ssf_info, sizeof(ssf->ssf_info));
|
||||
ssf->ssf_info.sinfo_stream = sp->stream;
|
||||
ssf->ssf_info.sinfo_ssn = 0;
|
||||
if (sp->some_taken) {
|
||||
@@ -3038,6 +3043,7 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
|
||||
return;
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
sai = mtod(m_notify, struct sctp_adaptation_event *);
|
||||
memset(sai, 0, sizeof(struct sctp_adaptation_event));
|
||||
sai->sai_type = SCTP_ADAPTATION_INDICATION;
|
||||
sai->sai_flags = 0;
|
||||
sai->sai_length = sizeof(struct sctp_adaptation_event);
|
||||
@@ -3093,6 +3099,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
|
||||
return;
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
pdapi = mtod(m_notify, struct sctp_pdapi_event *);
|
||||
memset(pdapi, 0, sizeof(struct sctp_pdapi_event));
|
||||
pdapi->pdapi_type = SCTP_PARTIAL_DELIVERY_EVENT;
|
||||
pdapi->pdapi_flags = 0;
|
||||
pdapi->pdapi_length = sizeof(struct sctp_pdapi_event);
|
||||
@@ -3202,6 +3209,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb)
|
||||
/* no space left */
|
||||
return;
|
||||
sse = mtod(m_notify, struct sctp_shutdown_event *);
|
||||
memset(sse, 0, sizeof(struct sctp_shutdown_event));
|
||||
sse->sse_type = SCTP_SHUTDOWN_EVENT;
|
||||
sse->sse_flags = 0;
|
||||
sse->sse_length = sizeof(struct sctp_shutdown_event);
|
||||
@@ -3252,6 +3260,7 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb,
|
||||
}
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
event = mtod(m_notify, struct sctp_sender_dry_event *);
|
||||
memset(event, 0, sizeof(struct sctp_sender_dry_event));
|
||||
event->sender_dry_type = SCTP_SENDER_DRY_EVENT;
|
||||
event->sender_dry_flags = 0;
|
||||
event->sender_dry_length = sizeof(struct sctp_sender_dry_event);
|
||||
@@ -3284,7 +3293,6 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t
|
||||
struct mbuf *m_notify;
|
||||
struct sctp_queued_to_read *control;
|
||||
struct sctp_stream_change_event *stradd;
|
||||
int len;
|
||||
|
||||
if ((stcb == NULL) ||
|
||||
(sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) {
|
||||
@@ -3297,25 +3305,20 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t
|
||||
return;
|
||||
}
|
||||
stcb->asoc.peer_req_out = 0;
|
||||
m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA);
|
||||
m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_stream_change_event), 0, M_DONTWAIT, 1, MT_DATA);
|
||||
if (m_notify == NULL)
|
||||
/* no space left */
|
||||
return;
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
len = sizeof(struct sctp_stream_change_event);
|
||||
if (len > M_TRAILINGSPACE(m_notify)) {
|
||||
/* never enough room */
|
||||
sctp_m_freem(m_notify);
|
||||
return;
|
||||
}
|
||||
stradd = mtod(m_notify, struct sctp_stream_change_event *);
|
||||
memset(stradd, 0, sizeof(struct sctp_stream_change_event));
|
||||
stradd->strchange_type = SCTP_STREAM_CHANGE_EVENT;
|
||||
stradd->strchange_flags = flag;
|
||||
stradd->strchange_length = len;
|
||||
stradd->strchange_length = sizeof(struct sctp_stream_change_event);
|
||||
stradd->strchange_assoc_id = sctp_get_associd(stcb);
|
||||
stradd->strchange_instrms = numberin;
|
||||
stradd->strchange_outstrms = numberout;
|
||||
SCTP_BUF_LEN(m_notify) = len;
|
||||
SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_stream_change_event);
|
||||
SCTP_BUF_NEXT(m_notify) = NULL;
|
||||
if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) {
|
||||
/* no space */
|
||||
@@ -3346,32 +3349,26 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32
|
||||
struct mbuf *m_notify;
|
||||
struct sctp_queued_to_read *control;
|
||||
struct sctp_assoc_reset_event *strasoc;
|
||||
int len;
|
||||
|
||||
if ((stcb == NULL) ||
|
||||
(sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) {
|
||||
/* event not enabled */
|
||||
return;
|
||||
}
|
||||
m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA);
|
||||
m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_assoc_reset_event), 0, M_DONTWAIT, 1, MT_DATA);
|
||||
if (m_notify == NULL)
|
||||
/* no space left */
|
||||
return;
|
||||
SCTP_BUF_LEN(m_notify) = 0;
|
||||
len = sizeof(struct sctp_assoc_reset_event);
|
||||
if (len > M_TRAILINGSPACE(m_notify)) {
|
||||
/* never enough room */
|
||||
sctp_m_freem(m_notify);
|
||||
return;
|
||||
}
|
||||
strasoc = mtod(m_notify, struct sctp_assoc_reset_event *);
|
||||
memset(strasoc, 0, sizeof(struct sctp_assoc_reset_event));
|
||||
strasoc->assocreset_type = SCTP_ASSOC_RESET_EVENT;
|
||||
strasoc->assocreset_flags = flag;
|
||||
strasoc->assocreset_length = len;
|
||||
strasoc->assocreset_length = sizeof(struct sctp_assoc_reset_event);
|
||||
strasoc->assocreset_assoc_id = sctp_get_associd(stcb);
|
||||
strasoc->assocreset_local_tsn = sending_tsn;
|
||||
strasoc->assocreset_remote_tsn = recv_tsn;
|
||||
SCTP_BUF_LEN(m_notify) = len;
|
||||
SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_reset_event);
|
||||
SCTP_BUF_NEXT(m_notify) = NULL;
|
||||
if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) {
|
||||
/* no space */
|
||||
@@ -3424,6 +3421,7 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb,
|
||||
return;
|
||||
}
|
||||
strreset = mtod(m_notify, struct sctp_stream_reset_event *);
|
||||
memset(strreset, 0, len);
|
||||
strreset->strreset_type = SCTP_STREAM_RESET_EVENT;
|
||||
strreset->strreset_flags = flag;
|
||||
strreset->strreset_length = len;
|
||||
@@ -6236,9 +6234,12 @@ sctp_soreceive(struct socket *so,
|
||||
fromlen = 0;
|
||||
}
|
||||
|
||||
if (filling_sinfo) {
|
||||
memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo));
|
||||
}
|
||||
error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp,
|
||||
(struct sctp_sndrcvinfo *)&sinfo, filling_sinfo);
|
||||
if ((controlp) && (filling_sinfo)) {
|
||||
if (controlp != NULL) {
|
||||
/* copy back the sinfo in a CMSG format */
|
||||
if (filling_sinfo)
|
||||
*controlp = sctp_build_ctl_nchunk(inp,
|
||||
@@ -6693,6 +6694,10 @@ sctp_local_addr_count(struct sctp_tcb *stcb)
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin->sin_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((ipv4_local_scope == 0) &&
|
||||
(IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
|
||||
continue;
|
||||
@@ -6713,6 +6718,10 @@ sctp_local_addr_count(struct sctp_tcb *stcb)
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
|
||||
continue;
|
||||
}
|
||||
if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
|
||||
&sin6->sin6_addr) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
if (local_scope == 0)
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
* in the range 5 to 9.
|
||||
*/
|
||||
#undef __FreeBSD_version
|
||||
#define __FreeBSD_version 902512 /* Master, propagated to newvers */
|
||||
#define __FreeBSD_version 903000 /* Master, propagated to newvers */
|
||||
|
||||
/*
|
||||
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
|
||||
|
||||
@@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UINT8 Source)
|
||||
case ACPI_MADT_POLARITY_ACTIVE_HIGH:
|
||||
return (INTR_POLARITY_HIGH);
|
||||
case ACPI_MADT_POLARITY_ACTIVE_LOW:
|
||||
return (INTR_POLARITY_LOW);
|
||||
break;
|
||||
default:
|
||||
panic("Bogus Interrupt Polarity");
|
||||
printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW");
|
||||
}
|
||||
return (INTR_POLARITY_LOW);
|
||||
}
|
||||
|
||||
static enum intr_trigger
|
||||
@@ -325,10 +326,13 @@ interrupt_trigger(UINT16 IntiFlags, UINT8 Source)
|
||||
case ACPI_MADT_TRIGGER_EDGE:
|
||||
return (INTR_TRIGGER_EDGE);
|
||||
case ACPI_MADT_TRIGGER_LEVEL:
|
||||
return (INTR_TRIGGER_LEVEL);
|
||||
break;
|
||||
default:
|
||||
panic("Bogus Interrupt Trigger Mode");
|
||||
printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger.");
|
||||
|
||||
break;
|
||||
}
|
||||
return (INTR_TRIGGER_LEVEL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -139,6 +139,7 @@ SUBDIR= alias \
|
||||
rwall \
|
||||
script \
|
||||
sed \
|
||||
send-pr \
|
||||
seq \
|
||||
shar \
|
||||
showmount \
|
||||
|
||||
+1
-1
@@ -336,7 +336,7 @@ procline(struct str *l, int nottext)
|
||||
}
|
||||
|
||||
/* One pass if we are not recording matches */
|
||||
if ((color == NULL && !oflag) || qflag || lflag)
|
||||
if (!wflag && ((color == NULL && !oflag) || qflag || lflag))
|
||||
break;
|
||||
|
||||
if (st == (size_t)pmatch.rm_so)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SCRIPTS= send-pr.sh
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
echo
|
||||
echo "FreeBSD has migrated away from GNATS for tracking bugs, and so send-pr"
|
||||
echo "is no longer used for submitting bug reports."
|
||||
echo "Please see https://www.freebsd.org/support.html for more information."
|
||||
echo
|
||||
exit 1
|
||||
@@ -49,7 +49,7 @@ msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-cr
|
||||
msg_astro_desc="Applications related to astronomy."
|
||||
msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces"
|
||||
msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces"
|
||||
msg_attempting_to_fetch_file_from_selected_media="Attempting to fetch %s file from selected media."
|
||||
msg_attempting_to_update_repository_catalogue="Attempting to update repository catalogue from selected media."
|
||||
msg_audio_desc="Audio utilities - most require a supported sound card."
|
||||
msg_australia="Australia"
|
||||
msg_austria="Austria"
|
||||
@@ -138,9 +138,12 @@ msg_ftp_desc="FTP client and server utilities."
|
||||
msg_ftp_passive="FTP Passive"
|
||||
msg_ftp_username="FTP username"
|
||||
msg_games_desc="Various games and sundry amusements."
|
||||
msg_generating_index_from_pkg_database="Generating INDEX from pkg(8) database\n(this can take a while)..."
|
||||
msg_geography_desc="Geography-related software."
|
||||
msg_german_desc="Ported software for Germanic countries."
|
||||
msg_germany="Germany"
|
||||
msg_getting_package_categories_via_pkg_rquery="Getting package categories via pkg-rquery(8)..."
|
||||
msg_getting_package_dependencies_via_pkg_rquery="Getting package dependencies via pkg-rquery(8)\n(this can take a while)..."
|
||||
msg_gnome_desc="Components of the Gnome Desktop environment."
|
||||
msg_gnustep_desc="Software for GNUstep desktop environment."
|
||||
msg_graphics_desc="Graphics libraries and utilities."
|
||||
@@ -176,7 +179,7 @@ msg_invalid_name_server_ip_address_specified="Invalid name server IP address spe
|
||||
msg_invalid_netmask_value="Invalid netmask value"
|
||||
msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir"
|
||||
msg_io_error_while_reading_in_the_package="I/O error while reading in the %s package."
|
||||
msg_io_or_format_error_on_index_file="I/O or format error on %s file.\nPlease verify media (or path to media) and try again."
|
||||
msg_io_or_format_error_on_index_file="I/O or format error on INDEX file.\nPlease verify media (or path to media) and try again."
|
||||
msg_ipv4_address="IPv4 Address"
|
||||
msg_ipv4_gateway="IPv4 Gateway"
|
||||
msg_ipv6="IPv6"
|
||||
@@ -246,6 +249,7 @@ msg_no_gateway_has_been_set="No gateway has been set. You will be unable to acce
|
||||
msg_no_network_devices="No network devices available!"
|
||||
msg_no_package_name_passed_in_package_variable="No package name passed in package variable"
|
||||
msg_no_packages_were_selected_for_extraction="No packages were selected for extraction."
|
||||
msg_no_pkg_database_found="No pkg(8) database found!"
|
||||
msg_no_such_file_or_directory="%s: %s: No such file or directory"
|
||||
msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)"
|
||||
msg_no_username="No username provided!"
|
||||
@@ -257,10 +261,8 @@ msg_ok="OK"
|
||||
msg_options="Options"
|
||||
msg_options_editor="Options Editor"
|
||||
msg_other="other"
|
||||
msg_pkg_delete_failed="Warning: pkg_delete of %s failed.\n Run with debugging for details."
|
||||
msg_package_is_needed_by_other_installed_packages="Warning: Package %s is needed by\n %d other installed package%s."
|
||||
msg_package_not_installed_cannot_delete="Warning: package %s not installed\n No package can be deleted."
|
||||
msg_package_read_successfully_waiting_for_pkg_add="Package %s read successfully - waiting for pkg_add(1)"
|
||||
msg_package_temp="Package Temp"
|
||||
msg_package_was_added_successfully="Package %s was added successfully"
|
||||
msg_packages="packages"
|
||||
@@ -270,7 +272,8 @@ msg_parallel_desc="Applications dealing with parallelism in computing."
|
||||
msg_pear_desc="Software related to the Pear PHP framework."
|
||||
msg_perl5_desc="Utilities/modules for the PERL5 language."
|
||||
msg_permission_denied="%s: %s: Permission denied"
|
||||
msg_pkg_add_apparently_did_not_like_the_package="pkg_add(1) apparently did not like the %s package."
|
||||
msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details."
|
||||
msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package."
|
||||
msg_plan9_desc="Software from the Plan9 operating system."
|
||||
msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n"
|
||||
msg_please_enter_password="Please enter your password for sudo(8):"
|
||||
@@ -373,9 +376,12 @@ msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not
|
||||
msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract."
|
||||
msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!"
|
||||
msg_unable_to_open="Unable to open %s"
|
||||
msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!"
|
||||
msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!"
|
||||
msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media."
|
||||
msg_uninstall="Uninstall"
|
||||
msg_uninstall_desc="Mark this package for deletion"
|
||||
msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg_delete(1)"
|
||||
msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)"
|
||||
msg_unknown="unknown"
|
||||
msg_unknown_user="Unknown user: %s"
|
||||
msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?"
|
||||
|
||||
@@ -60,7 +60,14 @@ FAILURE=1
|
||||
#
|
||||
export UNAME_S="$( uname -s )" # Operating System (i.e. FreeBSD)
|
||||
export UNAME_P="$( uname -p )" # Processor Architecture (i.e. i386)
|
||||
export UNAME_M="$( uname -m )" # Machine platform (i.e. i386)
|
||||
export UNAME_R="$( uname -r )" # Release Level (i.e. X.Y-RELEASE)
|
||||
if [ ! "${PKG_ABI+set}" ]; then
|
||||
export PKG_ABI="$(
|
||||
ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null |
|
||||
awk '$1=="ABI"{print $3;exit}'
|
||||
)"
|
||||
fi
|
||||
|
||||
#
|
||||
# Default behavior is to call f_debug_init() automatically when loaded.
|
||||
|
||||
@@ -77,7 +77,8 @@ f_dialog_menu_media_http()
|
||||
f_dialog_title_restore
|
||||
local prompt="$msg_please_select_the_site_closest_to_you_or_other"
|
||||
local menu_list="
|
||||
'$msg_main_site' 'ftp.freebsd.org'
|
||||
'dist $msg_main_site' 'ftp.freebsd.org'
|
||||
'pkg $msg_main_site' 'pkg.freebsd.org'
|
||||
'URL' '$msg_specify_some_other_http_site'
|
||||
" # END-QUOTE
|
||||
local hline="$msg_select_a_site_thats_close"
|
||||
@@ -322,7 +323,7 @@ f_media_set_http()
|
||||
device_http set type $DEVICE_TYPE_HTTP
|
||||
device_http set init f_media_init_http
|
||||
device_http set get f_media_get_http
|
||||
device_http set shutdown :
|
||||
device_http set shutdown f_media_shutdown_http
|
||||
device_http set private device_network
|
||||
f_struct_copy device_http device_media
|
||||
f_struct_free device_http
|
||||
@@ -453,6 +454,11 @@ f_media_init_http()
|
||||
local dev="$1"
|
||||
f_dprintf "Init routine called for HTTP device. dev=[%s]" "$dev"
|
||||
|
||||
if [ "$HTTP_INITIALIZED" ]; then
|
||||
f_dprintf "HTTP device already initialized."
|
||||
return $SUCCESS
|
||||
fi
|
||||
|
||||
#
|
||||
# First verify access
|
||||
#
|
||||
@@ -494,22 +500,31 @@ f_media_init_http()
|
||||
#
|
||||
local fdir hp
|
||||
f_getvar $VAR_HTTP_PATH%/ hp
|
||||
for fdir in $HTTP_DIRS; do
|
||||
setvar $VAR_HTTP_PATH "$hp/$fdir/$rel"
|
||||
if f_http_check_access; then
|
||||
http_found=$SUCCESS
|
||||
break
|
||||
fi
|
||||
done
|
||||
setvar $VAR_HTTP_PATH "$hp/$PKG_ABI/latest"
|
||||
if [ "$PKG_ABI" ] && f_http_check_access; then
|
||||
http_found=$SUCCESS
|
||||
setvar $VAR_HTTP_PATH "$hp"
|
||||
else
|
||||
for fdir in $HTTP_DIRS; do
|
||||
setvar $VAR_HTTP_PATH "$hp/$fdir/$rel"
|
||||
if f_http_check_access; then
|
||||
http_found=$SUCCESS
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
esac
|
||||
|
||||
[ $http_found -eq $SUCCESS ] && break
|
||||
if [ $http_found -eq $SUCCESS ]; then
|
||||
HTTP_INITIALIZED=YES
|
||||
break
|
||||
fi
|
||||
|
||||
f_getvar $VAR_HTTP_PATH http_path
|
||||
f_show_msg "$msg_please_check_the_url_and_try_again" \
|
||||
"$http_path"
|
||||
|
||||
unset $VAR_HTTP_PATH
|
||||
unset HTTP_INITIALIZED $VAR_HTTP_PATH
|
||||
f_media_set_http || break
|
||||
done
|
||||
|
||||
@@ -561,6 +576,11 @@ f_media_get_http()
|
||||
f_getvar $VAR_HTTP_HOST http_host
|
||||
f_getvar $VAR_HTTP_PORT http_port
|
||||
|
||||
if [ ! "$HTTP_INITIALIZED" ]; then
|
||||
f_dprintf "No HTTP connection open, can't get file %s" "$file"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
if ! {
|
||||
f_validate_ipaddr "$http_host" ||
|
||||
f_validate_ipaddr6 "$http_host" ||
|
||||
@@ -652,6 +672,18 @@ f_media_get_http()
|
||||
return $FAILURE
|
||||
}
|
||||
|
||||
# f_media_shutdown_http $device
|
||||
#
|
||||
# Shuts down the HTTP device. Return status should be ignored. Note that since
|
||||
# we don't maintain an open connection to the HTTP server, nothing to do.
|
||||
#
|
||||
f_media_shutdown_http()
|
||||
{
|
||||
[ "$HTTP_INITIALIZED" ] || return $SUCCESS
|
||||
|
||||
unset HTTP_INITIALIZED
|
||||
}
|
||||
|
||||
############################################################ MAIN
|
||||
|
||||
f_dprintf "%s: Successfully loaded." media/http.subr
|
||||
|
||||
@@ -43,24 +43,53 @@ f_include_lang $BSDCFG_LIBE/include/messages.subr
|
||||
PACKAGE_INDEX=
|
||||
_INDEX_INITTED=
|
||||
|
||||
#
|
||||
# Default path to pkg(8) repo-packagesite.sqlite database
|
||||
#
|
||||
SQLITE_REPO="/var/db/pkg/repo-packagesite.sqlite"
|
||||
|
||||
#
|
||||
# Default path to on-disk cache INDEX file
|
||||
#
|
||||
PACKAGES_INDEX_CACHEFILE="/var/run/bsdconfig/packages_INDEX.cache"
|
||||
|
||||
#
|
||||
# INDEX format for FreeBSD-6.0 or higher:
|
||||
#
|
||||
# package|port-origin|install-prefix|comment|port-desc-file|maintainer|
|
||||
# categories|build-deps|run-deps|www-site|reserve|reserve|reserve|disc
|
||||
#
|
||||
INDEX_FORMAT="%n-%v" # package
|
||||
INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o" # port-origin
|
||||
INDEX_FORMAT="$INDEX_FORMAT|%p" # install-prefix
|
||||
INDEX_FORMAT="$INDEX_FORMAT|%c" # comment
|
||||
INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o/pkg-descr" # port-desc-file
|
||||
INDEX_FORMAT="$INDEX_FORMAT|%m" # maintainer
|
||||
INDEX_FORMAT="$INDEX_FORMAT|@CATEGORIES@" # place-holder
|
||||
INDEX_FORMAT="$INDEX_FORMAT|" # build-deps
|
||||
INDEX_FORMAT="$INDEX_FORMAT|@RUNDEPS@" # place-holder
|
||||
INDEX_FORMAT="$INDEX_FORMAT|%w" # www-site
|
||||
INDEX_FORMAT="$INDEX_FORMAT|" # reserved
|
||||
INDEX_FORMAT="$INDEX_FORMAT|" # reserved
|
||||
INDEX_FORMAT="$INDEX_FORMAT|" # reserved
|
||||
INDEX_FORMAT="$INDEX_FORMAT|" # disc
|
||||
|
||||
############################################################ FUNCTIONS
|
||||
|
||||
# f_index_initialize $path [$var_to_set]
|
||||
# f_index_initialize [$var_to_set]
|
||||
#
|
||||
# Read and initialize the global index. $path is to be relative to the chosen
|
||||
# media (not necessarily the filesystem; e.g. FTP) -- this is usually going to
|
||||
# be `packages/INDEX'. Returns success unless media cannot be initialized for
|
||||
# any reason (e.g. user cancels media selection dialog) or an error occurs. The
|
||||
# index is sorted before being loaded into $var_to_set.
|
||||
# Read and initialize the global index. Returns success unless media cannot be
|
||||
# initialized for any reason (e.g. user cancels media selection dialog or an
|
||||
# error occurs). The index is sorted before being loaded into $var_to_set.
|
||||
#
|
||||
# NOTE: The index is processed with f_index_read() [below] after being loaded.
|
||||
#
|
||||
f_index_initialize()
|
||||
{
|
||||
local __path="$1" __var_to_set="${2:-PACKAGE_INDEX}"
|
||||
local __funcname=f_index_initialize
|
||||
local __var_to_set="${2:-PACKAGE_INDEX}"
|
||||
|
||||
[ "$_INDEX_INITTED" ] && return $SUCCESS
|
||||
[ "$__path" ] || return $FAILURE
|
||||
|
||||
# Got any media?
|
||||
f_media_verify || return $FAILURE
|
||||
@@ -68,20 +97,177 @@ f_index_initialize()
|
||||
# Does it move when you kick it?
|
||||
f_device_init device_media || return $FAILURE
|
||||
|
||||
f_show_info "$msg_attempting_to_fetch_file_from_selected_media" \
|
||||
"$__path"
|
||||
eval "$__var_to_set"='$( f_device_get device_media "$__path" )'
|
||||
if [ $? -ne $SUCCESS ]; then
|
||||
f_show_msg "$msg_unable_to_get_file_from_selected_media" \
|
||||
"$__path"
|
||||
f_show_info "$msg_attempting_to_update_repository_catalogue"
|
||||
|
||||
#
|
||||
# Generate $PACKAGESITE variable for pkg(8) based on media type
|
||||
#
|
||||
local __type __data __site
|
||||
device_media get type __type
|
||||
device_media get private __data
|
||||
case "$__type" in
|
||||
$DEVICE_TYPE_DIRECTORY)
|
||||
__site="file://$__data/packages/$PKG_ABI" ;;
|
||||
$DEVICE_TYPE_FLOPPY)
|
||||
__site="file://${__data:-$MOUNTPOINT}/packages/$PKG_ABI" ;;
|
||||
$DEVICE_TYPE_FTP)
|
||||
f_getvar $VAR_FTP_PATH __site
|
||||
__site="$__site/packages/$PKG_ABI" ;;
|
||||
$DEVICE_TYPE_HTTP)
|
||||
f_getvar $VAR_HTTP_PATH __site
|
||||
__site="$__site/$PKG_ABI/latest" ;;
|
||||
$DEVICE_TYPE_HTTP_PROXY)
|
||||
f_getvar $VAR_HTTP_PROXY_PATH __site
|
||||
__site="$__site/packages/$PKG_ABI" ;;
|
||||
$DEVICE_TYPE_CDROM)
|
||||
__site="file://$MOUNTPOINT/packages/$PKG_ABI"
|
||||
export REPOS_DIR="$MOUNTPOINT/packages/repos" ;;
|
||||
*) # UFS, DISK, CDROM, USB, DOS, NFS, etc.
|
||||
__site="file://$MOUNTPOINT/packages/$PKG_ABI"
|
||||
esac
|
||||
|
||||
export PACKAGESITE="$__site"
|
||||
f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE"
|
||||
if ! f_eval_catch $__funcname pkg "pkg update"; then
|
||||
f_show_err "$msg_unable_to_update_pkg_from_selected_media"
|
||||
f_device_shutdown device_media
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
#
|
||||
# Try to get contents from validated on-disk cache
|
||||
#
|
||||
|
||||
#
|
||||
# Calculate digest used to determine if the on-disk persistant cache
|
||||
# INDEX (containing this digest on the first line) is valid and can be
|
||||
# used to quickly populate the environment.
|
||||
#
|
||||
local __sqlite_digest
|
||||
if ! __sqlite_digest=$( md5 < "$SQLITE_REPO" 2> /dev/null ); then
|
||||
f_show_err "$msg_no_pkg_database_found"
|
||||
f_device_shutdown device_media
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
#
|
||||
# Check to see if the persistant cache INDEX file exists
|
||||
#
|
||||
if [ -f "$PACKAGES_INDEX_CACHEFILE" ]; then
|
||||
#
|
||||
# Attempt to populate the environment with the (soon to be)
|
||||
# validated on-disk cache. If validation fails, fall-back to
|
||||
# generating a fresh cache.
|
||||
#
|
||||
if eval $__var_to_set='$(
|
||||
( # Get digest as the first word on first line
|
||||
read digest rest_ignored
|
||||
|
||||
#
|
||||
# If the stored digest matches the calculated-
|
||||
# one populate the environment from the on-disk
|
||||
# cache and provide success exit status.
|
||||
#
|
||||
if [ "$digest" = "$__sqlite_digest" ]; then
|
||||
cat
|
||||
exit $SUCCESS
|
||||
else
|
||||
# Otherwise, return the current value
|
||||
eval echo \"\$__var_to_set\"
|
||||
exit $FAILURE
|
||||
fi
|
||||
) < "$PACKAGES_INDEX_CACHEFILE" 2> /dev/null
|
||||
)'; then
|
||||
f_show_info \
|
||||
"$msg_located_index_now_reading_package_data_from_it"
|
||||
if ! f_index_read "$__var_to_set"; then
|
||||
f_show_err \
|
||||
"$msg_io_or_format_error_on_index_file"
|
||||
return $FAILURE
|
||||
fi
|
||||
_INDEX_INITTED=1
|
||||
return $SUCCESS
|
||||
fi
|
||||
# Otherwise, fall-thru to create a fresh cache from scratch
|
||||
fi
|
||||
|
||||
#
|
||||
# If we reach this point, we need to generate the data from scratch
|
||||
#
|
||||
|
||||
f_show_info "$msg_getting_package_categories_via_pkg_rquery"
|
||||
if ! eval "$( pkg rquery "%n-%v %C" | awk '
|
||||
{ categories[$1] = categories[$1] " " $2 }
|
||||
END {
|
||||
for (package in categories)
|
||||
{
|
||||
cats = categories[package]
|
||||
sub(/^ /, "", cats)
|
||||
gsub(/[^[:alnum:]_]/, "_", package)
|
||||
printf "local _%s_categories=\"%s\";\n", package, cats
|
||||
}
|
||||
}' )"; then
|
||||
f_show_err "$msg_unable_to_pkg_rquery_package_dependencies"
|
||||
f_device_shutdown device_media
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
f_show_info "$msg_getting_package_dependencies_via_pkg_rquery"
|
||||
if ! eval "$( pkg rquery "%n-%v %dn-%dv" | awk '
|
||||
{ rundeps[$1] = rundeps[$1] " " $2 }
|
||||
END {
|
||||
for (package in rundeps)
|
||||
{
|
||||
deps = rundeps[package]
|
||||
sub(/^ /, "", deps)
|
||||
gsub(/[^[:alnum:]_]/, "_", package)
|
||||
printf "local _%s_rundeps=\"%s\";\n", package, deps
|
||||
}
|
||||
}' )"; then
|
||||
f_show_err "$msg_unable_to_pkg_rquery_package_dependencies"
|
||||
f_device_shutdown device_media
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
f_show_info "$msg_generating_index_from_pkg_database"
|
||||
eval "$__var_to_set"='$( pkg rquery "$INDEX_FORMAT" |
|
||||
while read LINE; do
|
||||
package="${LINE%%|*}";
|
||||
f_str2varname "$package" varpkg;
|
||||
eval f_replaceall \"\$LINE\" \"\|@CATEGORIES@\|\" \
|
||||
\"\|\$_${varpkg}_categories\|\" LINE
|
||||
eval f_replaceall \"\$LINE\" \"\|@RUNDEPS@\|\" \
|
||||
\"\|\$_${varpkg}_rundeps\|\" LINE
|
||||
echo "$LINE"
|
||||
done
|
||||
)' # always returns true (status of last item in pipe-chain)
|
||||
eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )'
|
||||
|
||||
#
|
||||
# Attempt to create the persistant on-disk cache
|
||||
#
|
||||
|
||||
# Create a new temporary file to write to
|
||||
local __tmpfile
|
||||
if f_eval_catch -dk __tmpfile $__funcname mktemp \
|
||||
'mktemp -t "%s"' "$pgm"
|
||||
then
|
||||
# Write the temporary file contents
|
||||
echo "$__sqlite_digest" > "$__tmpfile"
|
||||
debug= f_getvar "$__var_to_set" >> "$__tmpfile"
|
||||
|
||||
# Finally, move the temporary file into place
|
||||
case "$PACKAGES_INDEX_CACHEFILE" in
|
||||
*/*) f_eval_catch -d $__funcname mkdir \
|
||||
'mkdir -p "%s"' "${PACKAGES_INDEX_CACHEFILE%/*}"
|
||||
esac
|
||||
f_eval_catch -d $__funcname mv 'mv -f "%s" "%s"' \
|
||||
"$__tmpfile" "$PACKAGES_INDEX_CACHEFILE"
|
||||
fi
|
||||
|
||||
f_show_info "$msg_located_index_now_reading_package_data_from_it"
|
||||
if ! f_index_read "$__var_to_set"; then
|
||||
f_show_msg "$msg_io_or_format_error_on_index_file" "$__path"
|
||||
f_show_err "$msg_io_or_format_error_on_index_file"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ f_include_lang $BSDCFG_LIBE/include/messages.subr
|
||||
#
|
||||
# Package extensions to try
|
||||
#
|
||||
PACKAGE_EXTENSIONS=".tbz .tbz2 .tgz"
|
||||
PACKAGE_EXTENSIONS=".txz .tbz .tbz2 .tgz"
|
||||
|
||||
#
|
||||
# Variables used to track runtime states
|
||||
@@ -164,24 +164,13 @@ f_package_deselect()
|
||||
|
||||
# f_package_detect_installed
|
||||
#
|
||||
# Detect installed packages. Currently this searches /var/db/pkg for directory
|
||||
# Detect installed packages. Currently this uses pkg-query(8) for querying
|
||||
# entries and marks each entry as an installed/selected package.
|
||||
#
|
||||
f_package_detect_installed()
|
||||
{
|
||||
local installed package varpkg
|
||||
#
|
||||
# XXX KLUDGE ALERT! This makes evil assumptions about how XXX
|
||||
# packages register themselves and should *really* be done with
|
||||
# `pkg_info -e <name>' except that this is too slow for an
|
||||
# item check routine.. :-(
|
||||
#
|
||||
# NOTE: When transitioning to pkgng, make a single fork to `pkg' to
|
||||
# produce a list of all installed packages and parse _that_
|
||||
#
|
||||
installed=$( find -s /var/db/pkg -mindepth 1 -maxdepth 1 -type d |
|
||||
sed -e 's:/var/db/pkg/::' )
|
||||
for package in $installed; do
|
||||
local package varpkg
|
||||
for package in $( pkg query "%n-%v" ); do
|
||||
f_str2varname $package varpkg
|
||||
export _mark_$varpkg=X # exported for awk(1) ENVIRON[]
|
||||
f_package_select $package
|
||||
@@ -983,23 +972,31 @@ f_package_extract()
|
||||
f_getvar $VAR_PKG_TMPDIR:-/var/tmp tmpdir
|
||||
f_quietly mkdir -p -m 1777 "$tmpdir"
|
||||
|
||||
local path
|
||||
local path device_type
|
||||
$device get type device_type
|
||||
case "$name" in
|
||||
*/*) path="$name" ;;
|
||||
*)
|
||||
case "$name" in
|
||||
*-*|*_*) path="packages/All/$name" ;;
|
||||
*) path="packages/Latest/$name"
|
||||
esac
|
||||
if [ "$device_type" = "$DEVICE_TYPE_HTTP" ]; then
|
||||
path="$PKG_ABI/latest/All/$name"
|
||||
else
|
||||
path="packages/$PKG_ABI/All/$name"
|
||||
fi
|
||||
esac
|
||||
|
||||
# We have a path, call the device strategy routine to get the file
|
||||
# We have a path, call the device strategy routine to check the file
|
||||
local pkg_ext found=
|
||||
for pkg_ext in "" $PACKAGE_EXTENSIONS; do
|
||||
if f_device_get $device "$path$pkg_ext" $PROBE_EXIST; then
|
||||
path="$path$pkg_ext"
|
||||
f_dprintf "$funcname: found path=[%s] dev=[%s]" \
|
||||
"$path" "$device"
|
||||
found=1
|
||||
break
|
||||
elif [ "$device_type" = "$DEVICE_TYPE_HTTP" ] &&
|
||||
f_device_get $device \
|
||||
"packages/$PKG_ABI/All/$name$pkg_ext" $PROBE_EXIST
|
||||
then
|
||||
# Mirroring physical media over HTTP
|
||||
path="packages/$PKG_ABI/All/$name$pkg_ext"
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
@@ -1027,27 +1024,14 @@ f_package_extract()
|
||||
f_show_info "$msg_adding_package_from_media" "$name" "$devname"
|
||||
fi
|
||||
|
||||
# Get package data and pipe into pkg_add(1) while providing feedback
|
||||
{
|
||||
if ! f_device_get $device "$path"; then
|
||||
$alert "$msg_io_error_while_reading_in_the_package" \
|
||||
"$name" \
|
||||
>&$DIALOG_TERMINAL_PASSTHRU_FD 2> /dev/null
|
||||
[ "$no_confirm" ] && sleep 2
|
||||
else
|
||||
f_show_info \
|
||||
"$msg_package_read_successfully_waiting_for_pkg_add" \
|
||||
"$name" >&$DIALOG_TERMINAL_PASSTHRU_FD 2> /dev/null
|
||||
fi
|
||||
} | {
|
||||
if f_debugging; then
|
||||
/usr/sbin/pkg_add -v -
|
||||
else
|
||||
f_quietly /usr/sbin/pkg_add -
|
||||
fi
|
||||
}
|
||||
# Request the package be added via pkg-install(8)
|
||||
if f_debugging; then
|
||||
f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name"
|
||||
else
|
||||
f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name"
|
||||
fi
|
||||
if [ $? -ne $SUCCESS ]; then
|
||||
$alert "$msg_pkg_add_apparently_did_not_like_the_package" \
|
||||
$alert "$msg_pkg_install_apparently_did_not_like_the_package" \
|
||||
"$name"
|
||||
[ "$no_confirm" ] && sleep 2
|
||||
else
|
||||
@@ -1173,9 +1157,9 @@ f_package_delete()
|
||||
#
|
||||
f_show_info "$msg_uninstalling_package_waiting_for_pkg_delete" "$name"
|
||||
if f_debugging; then
|
||||
pkg_delete -v "$name"
|
||||
f_eval_catch $funcname pkg 'pkg -d delete -y "%s"' "$name"
|
||||
else
|
||||
f_quietly pkg_delete "$name"
|
||||
f_eval_catch $funcname pkg 'pkg delete -y "%s"' "$name"
|
||||
fi
|
||||
if [ $? -ne $SUCCESS ]; then
|
||||
f_show_msg "$msg_pkg_delete_failed" "$name"
|
||||
|
||||
@@ -205,7 +205,7 @@ f_netinteractive()
|
||||
f_getvar $VAR_NETINTERACTIVE value && [ "$value" ]
|
||||
}
|
||||
|
||||
# f_zfsinteractive()
|
||||
# f_zfsinteractive
|
||||
#
|
||||
# Has the user specifically requested the ZFS-portion of configuration and
|
||||
# setup to be performed interactively? Returns success if the user has asked
|
||||
|
||||
Reference in new issue
Block a user