Giter Club home page Giter Club logo

Comments (4)

busterb avatar busterb commented on July 30, 2024

True. IIRC the results vary over other OSes as well, which is why LibreSSL portable does not enable this test by default. I've thought about including the OpenBSD inet_pton in the compat layer for the sake of consistency.

from openbsd.

kinichiro avatar kinichiro commented on July 30, 2024

biotest results of other platforms, here.
I built biotest by ./configure --enable-extratests.

  • HP-UX 11i (both gcc and C/aC++)
    FAIL: test 2 ("1") success, want failure
    FAIL: test 3 ("1.2") success, want failure
    FAIL: test 4 ("1.2.3") success, want failure
    FAIL: test 11 ("imaps") failure, want success
    FAIL biotest (exit status: 1)
  • CentOS7
    FAIL: test 2 ("1") success, want failure
    FAIL: test 3 ("1.2") success, want failure
    FAIL: test 4 ("1.2.3") success, want failure
    FAIL: test 1 ("") success, want failure
    FAIL biotest (exit status: 1)
  • Solaris 11.2 i386
    FAIL: test 2 ("1") success, want failure
    FAIL: test 3 ("1.2") success, want failure
    FAIL: test 4 ("1.2.3") success, want failure
    FAIL: test 13 ("0xff.0xff.0xff.0xff") success, want failure
    FAIL: test 1 ("") success, want failure
    FAIL: test 11 ("imaps") failure, want success
  • Cygwin64
    FAIL: test 0 ("") success, want failure
    FAIL: test 1 ("") success, want failure
    FAIL biotest.exe (exit status: 1)
  • MinGW64
    FAIL: test 11 ("localhost") failure, want success
    FAIL: test 11 ("imaps") failure, want success

from openbsd.

Sp1l avatar Sp1l commented on July 30, 2024

The difference between OpenBSD's and FreeBSD's inet_pton4 is very small and both descend from isc/Paul Vixie's code.
POSIX states that the test should fail when there's fewer or more than 4 octets in the input and FreeBSD code indicates this behaviour as well.

The inet_pton() function does not accept other formats (such as the octal numbers, hexadecimal numbers, and fewer than four numbers...

FreeBSD inet_pton.c

@@ -92,16 +84,14 @@
                if ((pch = strchr(digits, ch)) != NULL) {
                        u_int new = *tp * 10 + (pch - digits);

-                       if (saw_digit && *tp == 0)
-                               return (0);
                        if (new > 255)
                                return (0);
-                       *tp = new;
-                       if (!saw_digit) {
+                       if (! saw_digit) {
                                if (++octets > 4)
                                        return (0);
                                saw_digit = 1;
                        }
+                       *tp = new;
                } else if (ch == '.' && saw_digit) {
                        if (octets == 4)
                                return (0);

from openbsd.

bob-beck avatar bob-beck commented on July 30, 2024

In a nutshell, the test requires a posix compliant inet_pton(). We will simply disable
the test on systems that do not have this.

from openbsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.