Bug 218517 - ppp fails adding route with error Value too large to be stored in data type
Summary: ppp fails adding route with error Value too large to be stored in data type
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RELEASE
Hardware: i386 Any
: --- Affects Some People
Assignee: Eugene Grosbein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-10 01:42 UTC by Kris
Modified: 2018-11-10 10:07 UTC (History)
4 users (show)

See Also:


Attachments
Dtrace script to get more information (297 bytes, text/plain)
2017-04-11 17:47 UTC, Gleb Smirnoff
no flags Details
drace scripts output (4.73 KB, text/plain)
2017-04-12 11:17 UTC, Kris
no flags Details
save errno and fix buffer size for copies of ncpaddr_ntoa/ncprange_ntoa result (6.31 KB, patch)
2018-02-09 17:55 UTC, Eugene Grosbein
no flags Details | Diff
Fix for stable/10 after incomplete MFC r326012 (594 bytes, patch)
2018-02-24 05:15 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kris 2017-04-10 01:42:23 UTC
I've recently upgraded from FreeBSD 9.1 to FreeBSD 11.0 and took my FreeBSD 9.1 ppp.conf and relevant rc.conf settings and used it in FreeBSD 11.0

When connecting to my ADSL ISP via /usr/sbin/ppp using pppoe the "add default HISADDR" setting is not adding the route and failing with error message..

Warning: Add route failed: 0.0.0.0: errno: Value too large to be stored in data type

The only way I can get the route to add correctly is to use the following in /etc/ppp/ppp.linkup

 shell route del default
 shell route add default HISADDR


<pre>
Relevant entries in rc.conf

network_interfaces="em0 lo0"
ifconfig_em0="inet 10.0.0.254 netmask 255.255.255.0"
gateway_enable="yes"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="NO"
ppp_profile="iinet"
</pre>

<pre>
ppp.conf

default:
 set log Chat Connect Command tun Phase Warning IPCP CCP IPCP LQM Error Alert
 ident user-ppp VERSION (built COMPILATIONDATE)
 set mru 1492
 set mtu 1492
 enable lqr
 enable echo
 #enable dns 
 set timeout 0
 set redial 0 0
 nat enable no

iinet:
 set device PPPoE:em0:iinet
 set speed sync
 set ctsrts off
 set authname xxxxx@xxxx.net.au
 set authkey xxxxxxxx
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
 add default HISADDR                 
</pre>

<pre>
uname -a 

FreeBSD crusty 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #2: Mon Apr  3 10:59:13 AEST 2017     root@crusty:/usr/obj/usr/src/sys/CRUSTY  i386
</pre>

<pre>
custom kernel options

include PAE

device pf
device pflog
device pfsync
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_PRIQ
options ALTQ_NOPCC

options IPFIREWALL
options IPDIVERT
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPFIREWALL_VERBOSE

options IPFILTER
options DUMMYNET
options HZ=1000    

options         NETGRAPH
options         NETGRAPH_ETHER
options         NETGRAPH_PPPOE
options         NETGRAPH_SOCKET
</pre>

<pre>
Routing table

Internet:
Destination        Gateway            Flags     Netif Expire
default            150.101.32.92      US         tun0
10.0.0.0/24        link#1             U           em0
10.0.0.254         link#1             UHS         lo0
58.6.220.252       link#5             UHS         lo0
127.0.0.1          link#2             UH          lo0
150.101.32.92      link#5             UHS        tun0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%tun0/32                    fe80::223:24ff:fe92:8e73%tun0 UGS        tun0
</pre>

<pre>
/var/log/ppp.log

Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: PPP Started (ddial mode).
Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: bundle: Establish
Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: deflink: closed -> opening
Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: deflink: Connected!
Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: deflink: opening -> dial
Apr  9 10:16:10 crusty ppp[2690]: tun0: Phase: deflink: dial -> carrier
Apr  9 10:16:11 crusty ppp[2690]: tun0: Phase: Received NGM_PPPOE_ACNAME (hook "qcz5-charlotte")
Apr  9 10:16:11 crusty ppp[2690]: tun0: Phase: Received NGM_PPPOE_SESSIONID
Apr  9 10:16:11 crusty ppp[2690]: tun0: Phase: Received NGM_PPPOE_SUCCESS
Apr  9 10:16:11 crusty ppp[2690]: tun0: Phase: deflink: carrier -> login
Apr  9 10:16:11 crusty ppp[2690]: tun0: Phase: deflink: login -> lcp
Apr  9 10:16:13 crusty ppp[2690]: tun0: LQM: deflink: Will send LQR every 30.00 secs
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: bundle: Authenticate
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: deflink: his = CHAP 0x05, mine = none
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: Chap Input: CHALLENGE (16 bytes from qcz5-charlotte)
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: Chap Output: RESPONSE (xxx@xxx.net.au)
Apr  9 10:16:13 crusty ppp[2690]: tun0: LQM: deflink: Will send LQR every 30.00 secs
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: deflink: his = CHAP 0x05, mine = none
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: Chap Input: CHALLENGE (16 bytes from bng1.bne4)
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: Chap Output: RESPONSE (xxx@xxx.net.au)
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: Chap Input: SUCCESS (CHAP authentication success, unit 6596)
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: Using trigger address 0.0.0.0
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: FSM: Using "deflink" as a transport
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: deflink: State change Initial --> Closed
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: deflink: LayerStart.
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: MPPE: Not usable without CHAP81
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: deflink: SendConfigReq(1) state = Closed
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP:  DEFLATE[4] win 15
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP:  PRED1[2] 
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: deflink: State change Closed --> Req-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: deflink: lcp -> open
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: bundle: Network
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: FSM: Using "deflink" as a transport
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: State change Initial --> Closed
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: LayerStart.
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: SendConfigReq(1) state = Closed
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 0.0.0.0
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  COMPPROTO[6] 16 VJ slots with slot compression
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: State change Closed --> Req-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: RecvConfigReq(29) state = Req-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 150.101.32.92
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: SendConfigAck(29) state = Req-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 150.101.32.92
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: State change Req-Sent --> Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: CCP: deflink: State change Req-Sent --> Stopped
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: RecvConfigRej(1) state = Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  COMPPROTO[6] 16 VJ slots with slot compression
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: SendConfigReq(2) state = Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 0.0.0.0
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: RecvConfigNak(2) state = Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 58.6.220.252
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] changing address: 0.0.0.0  --> 58.6.220.252
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: SendConfigReq(3) state = Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 58.6.220.252
Apr  9 10:16:13 crusty ppp[2690]: tun0: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: RecvConfigAck(3) state = Ack-Sent
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP:  IPADDR[6] 58.6.220.252
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: State change Ack-Sent --> Opened
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: deflink: LayerUp.
Apr  9 10:16:13 crusty ppp[2690]: tun0: IPCP: myaddr 58.6.220.252 hisaddr = 150.101.32.92
Apr  9 10:16:13 crusty ppp[2690]: tun0: Warning: Add route failed: 0.0.0.0: errno: Value too large to be stored in data type
Apr  9 10:16:13 crusty ppp[2690]: tun0: Command: iinet: add default HISADDR
Apr  9 10:16:13 crusty ppp[2690]: tun0: Warning: Add route failed: 0.0.0.0: errno: Value too large to be stored in data type
Apr  9 10:16:13 crusty ppp[2690]: tun0: Command: iinet: shell route del default
Apr  9 10:16:13 crusty ppp[2690]: tun0: Command: iinet: shell route add default HISADDR
Apr  9 10:16:13 crusty ppp[2690]: tun0: Warning: ff02::: Change route failed: errno: Value too large to be stored in data type
Apr  9 10:16:16 crusty ppp[2690]: tun0: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
</pre>
Comment 1 Gleb Smirnoff freebsd_committer 2017-04-11 17:47:56 UTC
Created attachment 181690 [details]
Dtrace script to get more information

Hi!

Can you please launch the following script, tracing ppp and error 84 and then ppp:

# kldload dtraceall
# ./kernel-error.d ppp 84

Then in other terminal launch ppp. Then terminate script with Ctrl-C. I need output from the script. The script will consume a lot machine resources. The machine will get unresponsive for several minutes after Ctrl-C, please be patient.
Comment 2 Kris 2017-04-12 11:17:08 UTC
Created attachment 181713 [details]
drace scripts output

stopped ppp, ran script, started ppp, waited for error, output attached.
Comment 3 Kris 2017-08-28 00:22:19 UTC
Can someone take a look at the previous output I provided?

Also, just updated from 11.0 to FreeBSD 11.1 Release and problem still exists.
Comment 4 Eugene Grosbein freebsd_committer 2017-11-06 13:26:26 UTC
Please provide output of commands:

uname -K
uname -U
file /usr/sbin/ppp
Comment 5 Kris 2017-11-07 00:21:06 UTC
# uname -K
1101001
# uname -U
1101001
# file /usr/sbin/ppp
/usr/sbin/ppp: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.1, FreeBSD-style, stripped
Comment 6 Eugene Grosbein freebsd_committer 2017-11-07 12:17:44 UTC
(In reply to Kris from comment #5)

The problem seems seems to be some kind of ABI incompatibility between ppp(8) binary and your kernel. However, your kernel and binaries seems to be in perfect sync, so the problem should be due to some kernel options.

Can you retry with GENERIC kernel for a test?
Comment 7 Kris 2017-11-10 04:07:21 UTC
I did have a custom kernel and I have since moved back to GENERIC (PAE enabled) kernel however I no longer have an ISP with PPPOE that can allow the use of ppp so unless there is a way to replicate this problem without actually having to allow ppp to make a successful PPPOE connection I will no longer be able to assist here.
Comment 8 Eugene Grosbein freebsd_committer 2017-11-10 06:55:51 UTC
Submitter is no more in position to reproduce the problem.
Comment 9 emikulic 2018-02-08 07:40:15 UTC
I'm seeing this also.

$ uname -K
1004501
$ uname -U
1004501

tun0: IPV6CP: deflink: State change Ack-Sent --> Opened
tun0: IPV6CP: deflink: LayerUp.
tun0: ID0: 2 = socket(28, 2, 0)
tun0: ID0: -1 = ioctl(2, 2156423451, 0x7fffffffd7a0)
tun0: Warning: iface add: ioctl(SIOCAIFADDR_IN6, fe80::5803:c63e:8883:3605 -> fe80::72e4:22ff:fe8b:d900): Value too large to be stored in data type
tun0: Error: ipv6cp_InterfaceUp: unable to set ipv6 address
tun0: IPV6CP: deflink: LayerDown: fe80::5803:c63e:8883:3605
tun0: ID0: 0x0 = fopen("/etc/ppp/ppp.linkdown", "r")
tun0: ID0: 0x0 = fopen("/etc/ppp/ppp.linkdown", "r")
tun0: IPV6CP: deflink: SendTerminateReq(2) state = Opened
tun0: IPV6CP: deflink: State change Opened --> Closing

kernel: ifa_add_loopback_route: insertion failed: 17 <----- ?

I wasn't seeing this problem with a 10-STABLE kernel+world from revision=305589
Comment 10 emikulic 2018-02-08 07:50:17 UTC
"Value too large to be stored in data type" is actually errno = 17 (File exists)

(I added a printf directly after ioctl())
Comment 11 Eugene Grosbein freebsd_committer 2018-02-08 09:25:04 UTC
Reopen as problem reproduced.
Comment 12 Eugene Grosbein freebsd_committer 2018-02-08 09:27:04 UTC
(In reply to emikulic from comment #9)

Please show your ppp confuration. Do you use GENERIC kernel?
Comment 13 emikulic 2018-02-08 11:45:03 UTC
Sorry to be a pain, this is a custom kernel (can we get ALTQ in GENERIC? ;) and -stable:

include GENERIC
nodevice                fdc
options         ALTQ
options         ALTQ_CBQ        # Class Based Queueing
options         ALTQ_RED        # Random Early Detection
options         ALTQ_RIO        # RED In/Out
options         ALTQ_CODEL      # CoDel Active Queueing
options         ALTQ_HFSC       # Hierarchical Packet Scheduler
options         ALTQ_FAIRQ      # Fair Packet Scheduler
options         ALTQ_CDNR       # Traffic conditioner
options         ALTQ_PRIQ

*** ppp.conf:

default:
  set log Phase Chat tun IPCP IPV6CP ID0
  set mru 1492
  enable lqr echo
  set echoperiod 30
  nat enable no
  set device PPPoE:re0
  add default HISADDR
  add default HISADDR6
  set authname blah
  set authkey blah
  set redial 5
Comment 14 Eugene Grosbein freebsd_committer 2018-02-08 11:52:09 UTC
(In reply to emikulic from comment #13)

Can you try to reproduce this with GENERIC kernel so we know if ALTQ breaks something here?
Comment 15 Eugene Grosbein freebsd_committer 2018-02-08 13:09:23 UTC
(In reply to emikulic from comment #10)

And please show the diff for your added printf because "Value too large to be stored in data type" should not be errno = 17
Comment 16 emikulic 2018-02-08 13:35:10 UTC
(In reply to Eugene Grosbein from comment #15)

--- a/usr.sbin/ppp/id.c
+++ b/usr.sbin/ppp/id.c
@@ -50,6 +50,7 @@
 #include <libutil.h>
 #endif
 #include <utmpx.h>
+#include <errno.h>
 
 #include "log.h"
 #include "main.h"
@@ -93,10 +94,14 @@ int
 ID0ioctl(int fd, unsigned long req, void *arg)
 {
   int ret;
+  int saved_errno;
 
   ID0set0();
   ret = ioctl(fd, req, arg);
+  saved_errno = errno;
   log_Printf(LogID0, "%d = ioctl(%d, %lu, %p)\n", ret, fd, req, arg);
+  log_Printf(LogID0, "bug 218517: errno = %d (%s)\n", saved_errno,
+    strerror(saved_errno));
   ID0setuser();
   return ret;
 }

Resulting in:

ppp[4390]: tun0: IPV6CP: deflink: LayerUp.
ppp[4390]: tun0: ID0: 2 = socket(28, 2, 0)
ppp[4390]: tun0: ID0: -1 = ioctl(2, 2156423451, 0x7fffffffd790)
ppp[4390]: tun0: ID0: bug 218517: errno = 17 (File exists)
ppp[4390]: tun0: Warning: iface add: ioctl(SIOCAIFADDR_IN6, fe80::a9df:fac8:17ee:204d -> fe80::5aac:78ff:fe22:8f00): Value too large to be stored in data type
ppp[4390]: tun0: Error: ipv6cp_InterfaceUp: unable to set ipv6 address
ppp[4390]: tun0: IPV6CP: deflink: LayerDown: fe80::a9df:fac8:17ee:204d

errno must be getting clobbered somewhere between ioctl() and the "iface add" log line.
Comment 17 Eugene Grosbein freebsd_committer 2018-02-08 14:02:13 UTC
(In reply to emikulic from comment #16)

Could you please look at comment #1 and use directions of glebius@ to collect DTrace information?
Comment 18 emikulic 2018-02-08 15:20:27 UTC
I ran "./kernel-error.d ppp 84" followed by ppp, but it didn't produce any output.

I think the actual errno is 17, but "./kernel-error.d ppp 17" mostly produces "Returning 17 from _rw_runlock_cookie+0x12e", e.g.:

  2  42896        _rw_runlock_cookie:return Returning 17 from _rw_runlock_cookie+0x12e
              kernel`ifioctl+0x2f8
              kernel`kern_ioctl+0x25f
              kernel`sys_ioctl+0x140
              kernel`amd64_syscall+0x452
              kernel`0xffffffff80d95b7b

Running ppp under truss:

 8711: 5.695770520 sendto(7,"<30>Feb  9 01:24:57 ppp[8711]: tun0: IPV6CP: deflink: LayerUp.",62,0x0,NULL,0x0) = 62 (0x3e)
 8711: 5.695952875 socket(PF_INET6,SOCK_DGRAM,0) = 2 (0x2)
 8711: 5.697504600 ioctl(2,SIOCAIFADDR_IN6,0xffffd200) ERR#17 'File exists'
 8711: 5.697701621 sendto(7,"<30>Feb  9 01:24:57 ppp[8711]: tun0: ID0: -1 = ioctl(2, 2156423451, 0x7fffffffd200)",83,0x0,NULL,0x0) = 83 (0x53)
 8711: 5.697964153 sendto(7,"<30>Feb  9 01:24:57 ppp[8711]: tun0: ID0: bug 218517: errno = 17 (File exists)",78,0x0,NULL,0x0) = 78 (0x4e)
 8711: 5.698235484 sendto(7,"<28>Feb  9 01:24:57 ppp[8711]: tun0: Warning: iface add: ioctl(SIOCAIFADDR_IN6, fe80::f43e:9675:fb45:aa33 -> fe80::72e4:22ff:fe8b:df00): Value too large to be stored in data type",178,0x0,NULL,0x0) = 178 (0xb2)

(note ERR#17)
Comment 19 emikulic 2018-02-09 12:26:38 UTC
This version kernel works:

# uname -K
1003507

Log looks weird though:

ppp[440]: tun0: IPV6CP: deflink: LayerUp.
ppp[440]: tun0: ID0: 2 = socket(28, 2, 0)
ppp[440]: tun0: ID0: 0 = ioctl(2, 2166384921, 0x7fffffffd900)
ppp[440]: tun0: ID0: bug 218517: errno = 4 (Interrupted system call)
ppp[440]: tun0: ID0: 0 = ioctl(2, 2156423451, 0x7fffffffd370)
ppp[440]: tun0: ID0: bug 218517: errno = 4 (Interrupted system call)
ppp[440]: tun0: ID0: 2 = socket(17, 3, 0)
ppp[440]: tun0: ID0: -1 = write(2, data, 248)
ppp[440]: tun0: ID0: 248 = write(2, data, 248)
ppp[440]: tun0: ID0: 2 = socket(17, 3, 0)
ppp[440]: tun0: ID0: -1 = write(2, data, 200)
ppp[440]: tun0: ID0: 200 = write(2, data, 200)
ppp[440]: tun0: ID0: 2 = socket(17, 3, 0)
ppp[440]: tun0: ID0: -1 = write(2, data, 248)
ppp[440]: tun0: ID0: 248 = write(2, data, 248)
ppp[440]: tun0: ID0: 2 = socket(2, 2, 0)
ppp[440]: tun0: ID0: 0 = ioctl(2, 3223349521, 0x7fffffffdd40)
ppp[440]: tun0: ID0: bug 218517: errno = 17 (File exists)
ppp[440]: tun0: ID0: 0 = ioctl(2, 2149607696, 0x7fffffffdd40)
ppp[440]: tun0: ID0: bug 218517: errno = 17 (File exists)
ppp[440]: tun0: IPV6CP: myaddr XXXX hisaddr = XXXX
Comment 20 emikulic 2018-02-09 15:02:50 UTC
Bisecting:

revision=326006 works
revision=326012 doesn't

https://svnweb.freebsd.org/base?view=revision&revision=326012
Comment 21 Eugene Grosbein freebsd_committer 2018-02-09 17:55:11 UTC
Created attachment 190463 [details]
save errno and fix buffer size for copies of ncpaddr_ntoa/ncprange_ntoa result
Comment 22 Eugene Grosbein freebsd_committer 2018-02-09 17:59:18 UTC
(In reply to emikulic from comment #20)

Please try a patch for /usr/sbin/ppp I've just attached that fixes cosmetic problem preventing clobbering errno value while producing logs.

To apply:

cd /usr/src
patch < /path/to/path
cd usr.sbin/ppp
make obj depend && make all install
Comment 23 Eugene Grosbein freebsd_committer 2018-02-09 18:24:01 UTC
(In reply to emikulic from comment #9)

Do you actually use IPv6 within this system? If not, does ppp actually work for IPv4 connectivity, so that is just bad logging problem?

If you do actually use IPv6, you seem to be already having mentioned IPv6 address, right?
Comment 24 emikulic 2018-02-10 03:01:54 UTC
(In reply to Eugene Grosbein from comment #23)

Yes, I actually use IPv6 over PPPoE. :) I suspect my situation is the same as Kris's in #1.

I'm not sure what the correct solution is. For now I pull remotes/origin/stable/10 and git revert the r326012 commit. This gets me a 10-STABLE system with working IPv6.
Comment 25 emikulic 2018-02-10 03:10:01 UTC
(In reply to Eugene Grosbein from comment #22)

I applied the patch but it doesn't produce anything useful with a working kernel. I can try it later with a not-working kernel but I'm pretty sure you're going to get the same results as #16 and #18: where errno=17.

Your patch fixes a real logging bug in PPP so I hope it gets committed to mainline.
Comment 26 Eugene Grosbein freebsd_committer 2018-02-10 11:57:04 UTC
(In reply to emikulic from comment #24)

> Yes, I actually use IPv6 over PPPoE.

I need more details then. Please attach 1) output of "netstat -rn" before starting ppp, 2) repeat it after successfull start of ppp with patched kernel, 3) error log of patched ppp with unpatched kernel.
Comment 27 emikulic 2018-02-10 13:45:02 UTC
(In reply to Eugene Grosbein from comment #26)

> 1) output of "netstat -rn" before starting ppp

# netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags      Netif Expire
127.0.0.1          link#2             UH          lo0
192.168.1.0/24     link#1             U           re0
192.168.1.2        link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::aaaa:bbbb:cccc:dddd%re0     link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
ff01::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff02::%lo0/32                     ::1                           U           lo0

> 2) repeat it after successfull start of ppp with patched kernel

--- ppp started, dhcp6c not running ---

# netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags      Netif Expire
default            150.xxx.yy.z1      UGS        tun0
59.xxx.yyy.zz2     link#3             UHS         lo0
127.0.0.1          link#2             UH          lo0
150.xxx.yy.z1      link#3             UH         tun0
192.168.1.0/24     link#1             U           re0
192.168.1.2        link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
default                           fe80::5aac:78ff:fe22:8f00%tun0 UGS        tun0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::aaaa:bbbb:cccc:dddd%re0     link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
fe80::%tun0/64                    link#3                        US         tun0
fe80::aaaa:bbbb:cccc:dddd%tun0    link#3                        UHS         lo0
ff01::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff01::%lo0/32                     ::1                           U           lo0
ff01::%tun0/32                    fe80::aaaa:bbbb:cccc:dddd%tun0 US         tun0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff02::%lo0/32                     ::1                           U           lo0
ff02::%tun0/32                    fe80::aaaa:bbbb:cccc:dddd%tun0 US         tun0

--- dhcp6c running, everything working ---

# netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags      Netif Expire
default            150.xxx.yy.z1      UGS        tun0
59.xxx.yyy.zz2     link#3             UHS         lo0
127.0.0.1          link#2             UH          lo0
150.xxx.yy.z1      link#3             UH         tun0
192.168.1.0/24     link#1             U           re0
192.168.1.2        link#1             UHS         lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
default                           fe80::5aac:78ff:fe22:8f00%tun0 UGS        tun0
::1                               link#2                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2001:eee2:fff2:1234::/64          link#1                        U           re0
2001:eee2:fff2:1234:aaaa:bbbb:cccc:dddd link#1                        UHS         lo0
2001:eeee:ffff:5678::/64          link#1                        U           re0
2001:eeee:ffff:5678:aaaa:bbbb:cccc:dddd link#1                        UHS         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        U           re0
fe80::aaaa:bbbb:cccc:dddd%re0     link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
fe80::%tun0/64                    link#3                        US         tun0
fe80::aaaa:bbbb:cccc:dddd%tun0    link#3                        UHS         lo0
ff01::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff01::%lo0/32                     ::1                           U           lo0
ff01::%tun0/32                    fe80::aaaa:bbbb:cccc:dddd%tun0 US         tun0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     fe80::aaaa:bbbb:cccc:dddd%re0 U           re0
ff02::%lo0/32                     ::1                           U           lo0
ff02::%tun0/32                    fe80::aaaa:bbbb:cccc:dddd%tun0 US         tun0
Comment 28 commit-hook freebsd_committer 2018-02-10 17:10:18 UTC
A commit references this bug:

Author: eugen
Date: Sat Feb 10 17:09:52 UTC 2018
New revision: 329105
URL: https://svnweb.freebsd.org/changeset/base/329105

Log:
  ppp(8): fix code producing debugging logs

  Fix several cases when long buffer is copied to shorter one
  using snprintf that results in contents truncation and
  clobbering unsaved errno value and creation of misleading logs.

  PR:		218517
  Approved by:	avg (mentor)
  MFC after:	1 month

Changes:
  head/usr.sbin/ppp/defs.h
  head/usr.sbin/ppp/iface.c
  head/usr.sbin/ppp/ip.c
  head/usr.sbin/ppp/ipv6cp.c
  head/usr.sbin/ppp/ncpaddr.c
  head/usr.sbin/ppp/route.c
Comment 29 Eugene Grosbein freebsd_committer 2018-02-11 17:20:03 UTC
(In reply to emikulic from comment #27)

I still wait for 3) error log of patched ppp with unpatched kernel.
Comment 30 Eugene Grosbein freebsd_committer 2018-02-24 05:15:35 UTC
Created attachment 190932 [details]
Fix for stable/10 after incomplete MFC r326012

Please re-test with this kernel patch applied.
Comment 31 Eugene Grosbein freebsd_committer 2018-03-12 12:16:40 UTC
(In reply to emikulic from comment #9)

Note that https://bugs.freebsd.org/bugzilla/attachment.cgi?id=190932 has already been merged to stable/10 with r329913. Please test and respond.
Comment 32 commit-hook freebsd_committer 2018-03-12 17:37:01 UTC
A commit references this bug:

Author: eugen
Date: Mon Mar 12 17:36:37 UTC 2018
New revision: 330804
URL: https://svnweb.freebsd.org/changeset/base/330804

Log:
  MFC r329105: ppp(8): fix code producing debugging logs

    ppp(8): fix code producing debugging logs

    Fix several cases when long buffer is copied to shorter one
    using snprintf that results in contents truncation and
    clobbering unsaved errno value and creation of misleading logs.

  PR:		218517
  Approved by:	mav (mentor)

Changes:
_U  stable/11/
  stable/11/usr.sbin/ppp/defs.h
  stable/11/usr.sbin/ppp/iface.c
  stable/11/usr.sbin/ppp/ip.c
  stable/11/usr.sbin/ppp/ipv6cp.c
  stable/11/usr.sbin/ppp/ncpaddr.c
  stable/11/usr.sbin/ppp/route.c
Comment 33 commit-hook freebsd_committer 2018-03-12 17:38:04 UTC
A commit references this bug:

Author: eugen
Date: Mon Mar 12 17:37:39 UTC 2018
New revision: 330805
URL: https://svnweb.freebsd.org/changeset/base/330805

Log:
  MFC r329105: ppp(8): fix code producing debugging logs

    ppp(8): fix code producing debugging logs

    Fix several cases when long buffer is copied to shorter one
    using snprintf that results in contents truncation and
    clobbering unsaved errno value and creation of misleading logs.

  PR:		218517
  Approved by:	mav (mentor)

Changes:
_U  stable/10/
  stable/10/usr.sbin/ppp/defs.h
  stable/10/usr.sbin/ppp/iface.c
  stable/10/usr.sbin/ppp/ip.c
  stable/10/usr.sbin/ppp/ipv6cp.c
  stable/10/usr.sbin/ppp/ncpaddr.c
  stable/10/usr.sbin/ppp/route.c
Comment 34 Eugene Grosbein freebsd_committer 2018-08-18 11:10:36 UTC
Is this problem still actual? If so, please try 11.2-RELEASE that has some relevant changes for the ppp(8) and the kernel and respond with results.
Comment 35 emikulic 2018-11-10 07:12:15 UTC
Sorry I wasn't more responsive on this bug.

I can confirm that 11.2-STABLE works fine! :D

$ uname -K
1102503

(-U is the same)