From 5ad8d9d9e20f386c25fecf039052eca4e92b8daa Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 12 Oct 2001 06:43:42 +0000 Subject: As suggested by Hyung Sik Yoon , use 2 rather than 0 as the SAP on AIX if a SAP of 1537 doesn't work; he says that 2 works on Token Ring but 0 doesn't. --- CREDITS | 1 + pcap-dlpi.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CREDITS b/CREDITS index 66d139d..bf3de21 100644 --- a/CREDITS +++ b/CREDITS @@ -21,6 +21,7 @@ Additional people who have contributed patches: Darren Reed Franz Schaefer Greg Troxel + Hyung Sik Yoon Igor Khristophorov Jason R. Thorpe Javier Achirica diff --git a/pcap-dlpi.c b/pcap-dlpi.c index f2c9f58..d5e40e8 100644 --- a/pcap-dlpi.c +++ b/pcap-dlpi.c @@ -38,7 +38,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.70 2001-07-29 01:22:40 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.71 2001-10-12 06:43:43 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -379,14 +379,19 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf) ** However, we seem to get DL_BADADDR - "DLSAP addr in improper ** format or invalid" - errors if we use 1537 on the "tr0" ** device, which, given that its name starts with "tr" and that - ** it's IBM, probably means a Token Ring device. So if 1537 - ** fails, we try 0, in the hopes that it'll work (perhaps we - ** need to use 1537 on "/dev/dlpi/en" because that device is - ** for D/I/X Ethernet, the "SAP" is actually an Ethernet type, - ** and it rejects invalid Ethernet types). + ** it's IBM, probably means a Token Ring device. (Perhaps we + ** need to use 1537 on "/dev/dlpi/en" because that device is for + ** D/I/X Ethernet, the "SAP" is actually an Ethernet type, and + ** it rejects invalid Ethernet types.) + ** + ** So if 1537 fails, we try 2, as Hyung Sik Yoon of IBM Korea + ** says that works on Token Ring (he says that 0 does *not* + ** work; perhaps that's considered an invalid LLC SAP value - I + ** assume the SAP value in a DLPI bind is an LLC SAP for network + ** types that use 802.2 LLC). */ if ((dlbindreq(p->fd, 1537, ebuf) < 0 && - dlbindreq(p->fd, 0, ebuf) < 0) || + dlbindreq(p->fd, 2, ebuf) < 0) || #else if (dlbindreq(p->fd, 0, ebuf) < 0 || #endif -- cgit v1.2.3