ppp receiving wrong device number (cuaa10 instead of cuaaa,
cuaa15 instead of cuaaf)
Alexander Lunyov
lan_mailing at startatom.ru
Mon May 17 10:17:55 PDT 2004
Hello Alexander,
Monday, May 17, 2004, 3:20:20 PM, you wrote:
Wrong device name comes from tty_Create() function in tty.c:
if (*p->name.full == '\0') {
physical_SetDevice(p, ttyname(p->fd));
log_Printf(LogDEBUG, "%s: Input is a tty (%s)\n",
p->link.name, p->name.full);
} else
[skip]
I checked this - it's ttyname(3) who return /dev/cuaa10 instead of
/dev/cuaaa. Why ttyname(3) is returning wrong device number? Device
with such name doesn't even exist:
# ls -l /dev/cuaa10
ls: /dev/cuaa10: No such file or directory
And all cuaa[0-v] devices are here:
# ls -l /dev/cuaa*
crw-rw---- 1 uucp dialer 28, 128 4 май 2003 /dev/cuaa0
crw-rw---- 1 uucp uucp 28, 129 17 май 17:10 /dev/cuaa1
crw-rw---- 1 uucp uucp 28, 130 17 май 16:54 /dev/cuaa2
crw-rw---- 1 uucp uucp 28, 131 17 май 20:30 /dev/cuaa3
crw------- 1 uucp uucp 28, 132 17 май 16:42 /dev/cuaa4
crw-rw---- 1 uucp uucp 28, 133 17 май 13:07 /dev/cuaa5
crw-rw---- 1 uucp uucp 28, 134 17 май 18:15 /dev/cuaa6
crw-rw---- 1 uucp uucp 28, 135 17 май 17:10 /dev/cuaa7
crw-rw---- 1 uucp uucp 28, 136 17 май 16:47 /dev/cuaa8
crw-rw---- 1 uucp uucp 28, 137 17 май 13:07 /dev/cuaa9
crw-rw---- 1 uucp uucp 28, 138 17 май 20:51 /dev/cuaaa
crw-rw---- 1 uucp uucp 28, 139 17 май 16:43 /dev/cuaab
crw-rw---- 1 uucp uucp 28, 140 17 май 17:25 /dev/cuaac
crw-rw---- 1 uucp uucp 28, 141 17 май 17:26 /dev/cuaad
crw------- 1 uucp uucp 28, 142 14 май 10:18 /dev/cuaae
crw-rw---- 1 uucp uucp 28, 143 17 май 17:22 /dev/cuaaf
crw-rw---- 1 uucp uucp 28, 144 17 май 20:41 /dev/cuaag
crw-rw---- 1 uucp uucp 28, 145 17 май 20:02 /dev/cuaah
crw------- 1 uucp uucp 28, 146 14 май 11:51 /dev/cuaai
crw-rw---- 1 uucp uucp 28, 147 17 май 19:15 /dev/cuaaj
crw-rw---- 1 uucp uucp 28, 148 17 май 16:52 /dev/cuaak
crw-rw---- 1 uucp uucp 28, 149 17 май 13:07 /dev/cuaal
crw-rw---- 1 uucp uucp 28, 150 17 май 17:28 /dev/cuaam
crw-rw---- 1 uucp uucp 28, 151 17 май 17:33 /dev/cuaan
crw-rw---- 1 uucp uucp 28, 152 17 май 17:24 /dev/cuaao
crw-rw---- 1 uucp uucp 28, 153 23 окт 2002 /dev/cuaap
crw-rw---- 1 uucp uucp 28, 154 23 окт 2002 /dev/cuaaq
crw-rw---- 1 uucp uucp 28, 155 23 окт 2002 /dev/cuaar
crw-rw---- 1 root wheel 28, 156 9 окт 2002 /dev/cuaas
crw-rw---- 1 root wheel 28, 157 9 окт 2002 /dev/cuaat
crw-rw---- 1 root wheel 28, 158 9 окт 2002 /dev/cuaau
crw-rw---- 1 root wheel 28, 159 9 окт 2002 /dev/cuaav
Maybe, this is not freebsd-net@ issue anymore? Which list should i go
to with this?
AL> We have a gateway for our inner clients, it is FreeBSD-4.8R-p14,
AL> three Cronyx Omega PCI multiport cards (24 ports in sum), mgetty
AL> listening on all those ports, and when user connects, mgetty run
AL> exppp (enchanced ppp incarnation, http://shs.sumy.ua).
AL> Freeradius handles authentication and accounting. When i've enable
AL> freeradius module rlm_ippool (ip addresses pooling module), dialup
AL> users start receiving error "server have not assign ip address"
AL> after connecting on some telephone numbers (not all, just some
AL> numbers), and when i dig some further, i found, that freeradius in
AL> such cases did not receive NAS-Port-Id attribute from exppp.
AL> Freeradius receive standard request, but without one attribute, in
AL> example:
AL> Service-Type = Framed-User
AL> User-Name = "bpv89"
AL> Framed-Protocol = PPP
AL> CHAP-Password = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AL> CHAP-Challenge = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AL> NAS-Identifier = "zeus.domain.ru"
AL> NAS-Port-Type = Async
AL> Then i started to watch for ppp connections. And i found strange thing. Look
AL> at this (ppp log):
AL> Phase: Using interface: tun9
AL> Phase: deflink: Created in closed state
AL> Command: default: set radius /etc/radius.conf
AL> Command: default: set dns 192.168.33.127
AL> Command: default: set local_ip 62.33.65.0/24
AL> Warning: Add local net: 62.33.65.0/24
AL> Command: default: accept dns
AL> Command: default: enable lqr
AL> Command: default: enable pap
AL> Command: default: enable chap
AL> Command: default: enable mschap
AL> Command: default: enable mschapv2
AL> Command: default: set rad_alive 20
AL> Command: default: disable acfcomp protocomp
AL> Command: default: deny acfcomp
AL> Command: dialup: set timeout 900
AL> Command: dialup: set mru 576
AL> Command: dialup: set mtu 576
AL> Phase: PPP Started (direct mode).
AL> Phase: bundle: Establish
AL> Phase: deflink: closed -> opening
AL> Phase: deflink: Connected!
AL> Phase: deflink: opening -> carrier
>> Phase: deflink: /dev/cuaa15: CD detected *** (1)
AL> Phase: deflink: carrier -> lcp
AL> Phase: bundle: Authenticate
AL> Phase: deflink: his = none, mine = CHAP 0x05
AL> Phase: Chap Output: CHALLENGE
AL> Phase: Chap Input: RESPONSE (16 bytes from rim74)
>> Error: NAS-Port-Id borken: -1 *** (2)
AL> Phase: Radius: Request sent
AL> Phase: Radius(auth): ACCEPT received
AL> Phase: Octets limit 292770808
AL> Phase: Chap Output: SUCCESS
AL> Phase: deflink: lcp -> open
AL> Phase: bundle: Network
AL> Then disconnection occures - freeradius didn't deliver ip address for
AL> this connection.
AL> (1) - But mgetty said that modem connects to /dev/cuaaf port! Where
AL> did come digit 15 from? This situation (decimal port number instead
AL> of hex) can also be seen on ports cuaa10 (cuaaa), cuaa11 (cuaab),
AL> cuaa12 (cuaac) etc till cuaa15 - port cuaag always comes in hex.
AL> (2) - This is my debug entry, that i insert in radius.c. Original
AL> code:
AL> if ((slot = physical_Slot(p)) >= 0)
AL> if (rad_put_int(rad, RAD_NAS_PORT, slot) != 0) {
AL> log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad));
AL> rad_close(rad);
AL> return 0;
AL> }
AL> I've added debug 'else' for first 'if' (2). Thus physical_Slot() from
AL> physical.c returning '-1'. In physical.c:
AL> int
AL> physical_Slot(struct physical *p)
AL> {
AL> if (p->handler && p->handler->slot)
AL> return (*p->handler->slot)(p);
AL> return -1;
AL> }
AL> And p->handler is coming from tty.c (if i'm not missed the trail)
AL> in tty_iov2device():
AL> memcpy(&dev->dev, &basettydevice, sizeof dev->dev);
AL> physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE);
AL> if (dev->Timer.state != TIMER_STOPPED) {
AL> dev->Timer.state = TIMER_STOPPED;
AL> p->handler = &dev->dev; /* For the benefit of StartTimer */
AL> tty_StartTimer(p);
AL> }
AL> return &dev->dev;
AL> And i don't know where should i dig further. Must be some place,
AL> where hex numbers returns as decimal, but i don't know, where is it.
--
Best regards,
Alexander mailto:lan_mailing at startatom.ru
More information about the freebsd-net
mailing list