History log of /freebsd-current/sys/netgraph/ng_parse.c
Revision Date Author Comments
# 2ff63af9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/


# 63b6a08c 18-May-2021 Markus Stoff <markus@stoffdv.at>

ng_parse: IP address parsing in netgraph eating too many characters

Once the final component of the IP address has been parsed, the offset
on the input must not be advanced, as this would remove an unparsed
character from the input.

Submitted by: Markus Stoff
Reviewed by: donner
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D26489


# 662c1305 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

net: clean up empty lines in .c and .h files


# ac2fffa4 21-Jan-2018 Pedro F. Giffuni <pfg@FreeBSD.org>

Revert r327828, r327949, r327953, r328016-r328026, r328041:
Uses of mallocarray(9).

The use of mallocarray(9) has rocketed the required swap to build FreeBSD.
This is likely caused by the allocation size attributes which put extra pressure
on the compiler.

Given that most of these checks are superfluous we have to choose better
where to use mallocarray(9). We still have more uses of mallocarray(9) but
hopefully this is enough to bring swap usage to a reasonable level.

Reported by: wosch
PR: 225197


# 3b0a4e40 15-Jan-2018 Pedro F. Giffuni <pfg@FreeBSD.org>

netgraph: make some use of mallocarray(9).

Focus on code where we are doing multiplications within malloc(9). None of
these ire likely to overflow, however the change is still useful as some
static checkers can benefit from the allocation attributes we use for
mallocarray.

This initial sweep only covers malloc(9) calls with M_NOWAIT. No good
reason but I started doing the changes before r327796 and at that time it
was convenient to make sure the sorrounding code could handle NULL values.

X-Differential revision: https://reviews.freebsd.org/D13837


# 1bb25a82 30-Jan-2015 Dimitry Andric <dim@FreeBSD.org>

Fix a bunch of -Wcast-qual warnings in netgraph's ng_parse.c, by using
__DECONST. No functional change.

MFC after: 3 days


# dc9b4fca 15-Feb-2013 Gleb Smirnoff <glebius@FreeBSD.org>

Fix compilation warning.

Sponsored by: Nginx, Inc


# d745c852 06-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.

This means that their use is restricted to a single C file.


# 7a0b13ed 25-Jul-2011 Andriy Gapon <avg@FreeBSD.org>

remove RESTARTABLE_PANICS option

This is done per request/suggestion from John Baldwin
who introduced the option. Trying to resume normal
system operation after a panic is very unpredictable
and dangerous. It will become even more dangerous
when we allow a thread in panic(9) to penetrate all
lock contexts.
I understand that the only purpose of this option was
for testing scenarios potentially resulting in panic.

Suggested by: jhb
Reviewed by: attilio, jhb
X-MFC-After: never
Approved by: re (kib)


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 1ede983c 23-Oct-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 2a9a64c6 22-Jun-2007 Matt Jacob <mjacob@FreeBSD.org>

Fix various compilation warnings for gcc-4.2.

Approved by: re (bruce)


# 4006cd2b 18-Jan-2006 Ruslan Ermilov <ru@FreeBSD.org>

Fix two accesses to uninitialized variables that a revision 1.27
has introduced.

Found with: Coverity Prevent(tm)


# efa3bacc 14-Jan-2006 Gleb Smirnoff <glebius@FreeBSD.org>

Make code simplier fixing memory leak.

Found with: Coverity Prevent(tm)


# 222c1141 13-Jan-2006 Gleb Smirnoff <glebius@FreeBSD.org>

Fix two memory leakages.

Found with: Coverity Prevent(tm)


# 91b756f4 02-Aug-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fixed parsing of unsigned integers.


# f627a379 01-Mar-2005 Gleb Smirnoff <glebius@FreeBSD.org>

Replace NG_PARSE_APPEND() macro with ng_parse_append() function. Check
its return value and free resources if function returns error. Plug
several memory leaks with this change.

Submitted by: archie
Found by: Coverity Prevent analysis tool


# c398230b 06-Jan-2005 Warner Losh <imp@FreeBSD.org>

/* -> /*- for license, minor formatting changes


# 445e045b 28-Jul-2004 Alexander Kabaev <kan@FreeBSD.org>

Avoid casts as lvalues.


# 327b288e 25-Jun-2004 Julian Elischer <julian@FreeBSD.org>

Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.


# 0a4a8041 28-Apr-2004 John Polstra <jdp@FreeBSD.org>

Fix a memory leak in ng_get_string_token. A dynamically-allocated
buffer wasn't freed if the function failed.

MFC after: 3 days


# 87e2c66a 26-Jan-2004 Hartmut Brandt <harti@FreeBSD.org>

Get rid of the deprecated *LEN constants in favour of the new
*SIZ constants that include the trailing \0 byte.


# 8c7e4101 16-Dec-2003 Ruslan Ermilov <ru@FreeBSD.org>

Made the Ethernet address parse type standard.

OK'ed by: archie


# 8214d60e 08-Nov-2002 John Baldwin <jhb@FreeBSD.org>

Use intptr_t to fix various sizeof(int) != sizeof(void *) warnings.


# f0184ff8 31-May-2002 Archie Cobbs <archie@FreeBSD.org>

Fix GCC warnings caused by initializing a zero length array. In the process,
simply things a bit by getting rid of 'struct ng_parse_struct_info' which
was useless because it only contained one field.

MFC after: 2 weeks


# 55be04ab 24-May-2002 Peter Wemm <peter@FreeBSD.org>

Fix warnings: deprecated use of label at end of compound statement


# 3cbeb975 12-Feb-2002 Archie Cobbs <archie@FreeBSD.org>

Fix bug in previous commit.

Submitted by: Harti Brandt <brandt@fokus.gmd.de>


# d9bfecab 31-Jan-2002 Archie Cobbs <archie@FreeBSD.org>

Some netgraph parse types (such as for the 'value' field in ng_ksocket's
'struct ng_ksocket_sockopt') like to peek into the ng_mesg header for
information. Make sure when generating default values that we provide
a valid header to peek into.

MFC after: 1 week


# 6e551fb6 10-Dec-2001 David E. O'Brien <obrien@FreeBSD.org>

Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.


# b40ce416 12-Sep-2001 Julian Elischer <julian@FreeBSD.org>

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


# a514569e 19-May-2001 John Polstra <jdp@FreeBSD.org>

Fix a range checking bug in ng_int32_parse which affected 64-bit
machines. The code formerly read:

long val;
if (val < (long)-0x80000000 || ...)
return EINVAL;

The constant 0x80000000 has type unsigned int. The unary `-'
operator does not change the type (or the value, in this case).
Therefore the promotion to long is done by 0-extension, giving
0x0000000080000000 instead of the desired 0xffffffff80000000. I
got rid of the `-' and changed the cast to (int32_t) to give proper
sign-extension on all architectures and to better reflect the fact
that we are range-checking a 32-bit value.

This commit also makes the analogous changes to ng_int{8,16}_parse
for consistency.

MFC after: 3 days


# 9c8c302f 10-Jan-2001 Julian Elischer <julian@FreeBSD.org>

Fix some memory leaks
Add memory leak detection assitance.


# 99cdf4cc 18-Nov-2000 David Malone <dwmalone@FreeBSD.org>

Add the use of M_ZERO to netgraph.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
Submitted by: archie
Approved by: archie


# 27121ab1 16-Nov-2000 Brian Somers <brian@FreeBSD.org>

Go back to using data_len in struct ngpppoe_init_data after discussions
with Julian and Archie.

Implement a new ``sizedstring'' parse type for dealing with field pairs
consisting of a uint16_t followed by a data field of that size, and use
this to deal with the data_len and data fields.

Written by: Archie with some input by me
Agreed in principle by: julian


# cc3bbd68 24-Oct-2000 Julian Elischer <julian@FreeBSD.org>

Since neither archie nor I work at Whistle any more, change our email
addresses to be the more usefu @freebsd.org ones
so we can keep getting bug-reports.
- man pages to follow..


# d99b0733 31-Aug-2000 Archie Cobbs <archie@FreeBSD.org>

Avoid free'ing a NULL pointer.


# 8db3c6cd 10-Aug-2000 Archie Cobbs <archie@FreeBSD.org>

- Add new unsigned and hex integer parse types; this allows simplifying
the bytearray parse type.
- Allocate (larger) temporary work buffer dynamically instead of on the
stack when comparing to the default value.


# c1b9e5f2 13-Mar-2000 Archie Cobbs <archie@FreeBSD.org>

Fix typo: "ng_parse_fixedsstring_info" -> "ng_parse_fixedstring_info"


# 647b86df 06-Dec-1999 Julian Elischer <julian@FreeBSD.org>

Remove a bunch of un-needed includes.
Submitted by: phk@freebsd.org


# 2076235a 03-Dec-1999 Archie Cobbs <archie@FreeBSD.org>

Fix bug parsing 32 bit integers on machines where sizeof(long) == 4.


# f8307e12 29-Nov-1999 Archie Cobbs <archie@FreeBSD.org>

Add two new generic control messages, NGM_ASCII2BINARY and
NGM_BINARY2ASCII, which convert control messages to ASCII and back.
This allows control messages to be sent and received in ASCII form
using ngctl(8), which makes ngctl a lot more useful.

This also allows all the type-specific debugging code in libnetgraph
to go away -- instead, we just ask the node itself to do the ASCII
translation for us.

Currently, all generic control messages are supported, as well as
messages associated with the following node types: async, cisco,
ksocket, and ppp.

See /usr/share/examples/netgraph/ngctl for an example of using this.

Also give ngctl(8) the ability to print out incoming data and
control messages at any time. Eventually nghook(8) may be subsumed.

Several other misc. bug fixes.

Reviewed by: julian