<feed xmlns='http://www.w3.org/2005/Atom'>
<title>accel-ppp.git/accel-pppd/iprange.c, branch stable</title>
<subtitle>High performance PPTP/L2TP/SSTP/PPPoE/IPoE server for Linux (mirror of https://github.com/accel-ppp/accel-ppp.git)
</subtitle>
<id>https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=stable</id>
<link rel='self' href='https://git.amelek.net/accel-ppp/accel-ppp.git/atom?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/'/>
<updated>2018-12-08T04:51:37+00:00</updated>
<entry>
<title>iprange: rework range parsing using u_parse_*() functions</title>
<updated>2018-12-08T04:51:37+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-12-07T16:37:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=7951559fbc6d75e930ee50a0ed18da3912439e25'/>
<id>urn:sha1:7951559fbc6d75e930ee50a0ed18da3912439e25</id>
<content type='text'>
Now that we have primitives for parsing IPv4 ranges, let's use them to
simplify parse_iprange().

Try u_parse_ip4cidr() first. In case of failure, try u_parse_ip4range().
If any of them succeeds, verify that there aren't spurious data
following the range definition. If everything is valid, either load the
range or disable the module (if the range is 0.0.0.0/0).

The diff is a bit ugly, but the implementation should be much clearer.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>utils: rework u_parse_ip4addr()</title>
<updated>2018-12-08T04:51:34+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2018-12-07T16:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=0f2f775d644c4cd9007b5816c2cfa9e8d933ef6d'/>
<id>urn:sha1:0f2f775d644c4cd9007b5816c2cfa9e8d933ef6d</id>
<content type='text'>
Redefine u_parse_ip4addr() to match the behaviour of other u_parse_*()
functions:

  * Drop the err_msg parameter.
  * Return the number of bytes parsed instead of an error number.
  * Remove support for fancy IPv4 address notations.

There is currently only one user of u_parse_ip4addr() (in iprange.c).
Dropping the fancy IPv4 address representations is probably not going
to harm anyone (quite the opposite as many users don't realise that
leading 0 means octal and that plain integers can be considered IPv4
addresses).

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: warn before disabling module due to /0 network with non-null IP</title>
<updated>2016-05-11T11:45:56+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-11T11:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=d682a0aa8a142b0213a352b0057572fd1a3b76a4'/>
<id>urn:sha1:d682a0aa8a142b0213a352b0057572fd1a3b76a4</id>
<content type='text'>
Using a /0 prefix on an IP different from 0.0.0.0 is valid, but might
be a configuration mistake. Log warning message in this case so that
user can easily troubleshoot it.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: replace UINT32_MAX by INADDR_BROADCAST</title>
<updated>2016-05-11T11:45:54+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-11T11:13:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=ff2000c206059d029f0a0542863565dfcef7d077'/>
<id>urn:sha1:ff2000c206059d029f0a0542863565dfcef7d077</id>
<content type='text'>
This is equivalent, but INADDR_BROADCAST is more descriptive.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: don't warn about empty iprange config if no modules depend on it</title>
<updated>2016-05-11T10:26:02+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-09T19:41:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=f21ca06be19609f12584ddc96620d21b9a7b32a5'/>
<id>urn:sha1:f21ca06be19609f12584ddc96620d21b9a7b32a5</id>
<content type='text'>
Move warning messages to PPTP and L2TP modules. No other module
actually uses iprange, so it's perfectly valid to disable it, or at
least to not configure any range, when PPTP and L2TP aren't used.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: implement config reload</title>
<updated>2016-05-11T10:26:00+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-09T19:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=448d99b34e18c94cabe9c41e12fd678212acf103'/>
<id>urn:sha1:448d99b34e18c94cabe9c41e12fd678212acf103</id>
<content type='text'>
Protect conf_disable and client_ranges with a mutex.
Instead of directly setting conf_disable, load_ranges() now returns
a disable flag. The caller is in charge of propagating its value
in conf_disable.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>iprange: rework ip range parsing functions</title>
<updated>2016-05-11T10:25:13+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-05-09T19:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=7ae7712429737afe72068eec6b76f0632f1d8d55'/>
<id>urn:sha1:7ae7712429737afe72068eec6b76f0632f1d8d55</id>
<content type='text'>
The previous parsing functions had a few problems:

  * They did accept negative numbers in addresses (e.g. 192.0.2.-5).

  * They relied on C undefined behaviour for detecting /0 prefix
    length: "mask = htonl(~((1 &lt;&lt; (32 - m)) - 1)" was wrong for m = 0,
    because that resulted in a left shift of 32 bits, on a 32 bit wide
    value (the right operand of a bitwise shift operator must be
    strictly smaller than the width of the promoted left operand).

  * They misinterpreted /32 prefixes as disable requests. In fact, due
    to the undefined behaviour described above, /0 and /32 prefix
    lengths were represented in the same way by parse1(), that is, with
    an iprange_t structure where -&gt;begin == -&gt;end. Therefore
    load_ranges() had no way to distinguish between them and did
    disable the module in both cases.

This patch fixes these issues and brings the following improvements:

  * It uses getaddrinfo() to parse IP addresses, so it accept (almost)
    all IPv4 representations and is more easily extensible to IPv6 in
    the future.

  * It warns when the IP address used in CIDR notation is not the first
    address in the range (e.g. the first address of 192.0.2.1/24 is
    192.0.2.0, not 192.0.2.1).

  * It doesn't _exit() on parsing failures, thus making the functions
    usable in an EV_CONFIG_RELOAD handler.

While there, the unfinished tunnel_ranges code, which was already
commented, has been removed.

Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
</content>
</entry>
<entry>
<title>remove trailing whitespaces</title>
<updated>2014-11-22T05:56:40+00:00</updated>
<author>
<name>Dmitry Kozlov</name>
<email>xeb@mail.ru</email>
</author>
<published>2014-11-22T05:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=81ca3923a29ea9b67f7291be23b210019546aa5f'/>
<id>urn:sha1:81ca3923a29ea9b67f7291be23b210019546aa5f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>iprange: accept network with null mask (which actually disables iprange module)</title>
<updated>2012-07-07T12:14:54+00:00</updated>
<author>
<name>Kozlov Dmitry</name>
<email>xeb@mail.ru</email>
</author>
<published>2012-07-07T12:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=0ae39b3ccab604fadaa28918dc5ff717c73f5bd2'/>
<id>urn:sha1:0ae39b3ccab604fadaa28918dc5ff717c73f5bd2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rewrited initialization procedure (fix gcc-4.6 builds)</title>
<updated>2011-05-30T07:24:27+00:00</updated>
<author>
<name>Kozlov Dmitry</name>
<email>dima@server</email>
</author>
<published>2011-05-30T07:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/accel-ppp/accel-ppp.git/commit/?id=276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa'/>
<id>urn:sha1:276beb78cea777ff8d81d9f5a4cd107c5a3dc2aa</id>
<content type='text'>
</content>
</entry>
</feed>
