SOCK_PACKET corruption problems in 2.0.5

SOCK_PACKET corruption problems in 2.0.5

Post by Chris Underhi » Sat, 13 Jul 1996 04:00:00



-----BEGIN PGP SIGNED MESSAGE-----

Hi,

I'm trying to get my Linux box talking to our networked printer which
operates via some undocumented ethernet protocol. I've used tcpdump to
to get an idea of what the packet format is, and I'm now trying to
implement it using sockets etc...

So far, I haven't got very far - the first thing the client software
does is send out an ethernet broadcast message, to check if the
required printer is on-line. I know what the packet should look like,
so I open a socket with a line like

int sock=socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL);

I then store the header & contents of the packet in the variable
'packet', which gets sent to the network by the command:

sendto(sock, packet, len, 0, &sa, sizeof(sa));

where 'sa' is a struct sockaddr object whose sa_family element is set
to AF_INET.

Basically what I'm doing is using code from libpacket.c out of dosemu
to get this working.

Anyway, simultaneously running tcpdump to check that the packet has been
sent out correctly I get:

22:53:13.085910 0:60:8c:c2:64:9f Broadcast 8086 60:
                         0003 0000 0000 0700 4849 524f 5331 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000

22:53:13.095910 Broadcast 0:60:8c:c2:64:9f 8086 60:
                         0903 0000 0000 0053 3120 2020 202d 2d2d
                         2020 2020 2020 202d 2d2d 2020 2020 2020
                         2000 0000 0000 0000 0000 0000 0000

The top packet is correct, and is the packet sent out by the 'sendto'
command. The bottom packet, which should be the same as the top, is
corrupted. This causes the printer server not to acknowledge the this
packet, and so the client reckons that the printer is not available.

I've tried running tcpdump on another machine and checking what my
host sends, and I get exactly the same results.

Is this a known problem? If anyone would like to help me out, I can
send the source code, but as it is essentially identical to libpacket.c,
I'm not including it here.

TIA,

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBMebO1mZVEN0KDxVBAQHsDgP/bVSRqY8uDhsf9lhe7X/W6UVPEgSZ1acD
lcfSalFCU25QiK9iouIro76o468dTWY3agmAhlDiGg51304YNhxHn1iWeo2Wvfpw
rVmm96id/dRsCQgk4upem0JlFNkhubbpR0KOnmKVlZXIfFskgvmejKm5HAkb1Dw0
cxHXybcHe2w=
=F+cv
-----END PGP SIGNATURE-----

 
 
 

1. supraexpress modems (28.8) problems w/dial-ins

Hello,

        I've configured my linux box to receive calls from two 28.8
SupraExpress modems (both support v.34).  Everything works fine, the
connection, everything.  However, when the user logs off, the modems
literally go bezerks and make the LED display shows pure garbage and
the SD/RD leds blinks relentlessly.  After that, the modem no longer
answer to commands issued by my system or to incoming calls, and I get
this kind of messages inside /var/adm/messages:

Feb 24 14:05:02 zeus kernel: ttyS0: 13 input overrun(s)

        for both ports.  The only solution is to power off the modem
and restart it.  Then, uugetty regains controls and accepts answers.

        Here's a copy of my /etc/default/uugetty.ttyS0 file:

CLEAR = NO
HANGUP=YES
#DEBUG=777
DEBUG=010
INIT="" AT&F2S0=1\r OK
ALTLOCK=cua0
ALTLINE=cua0
#WAITFOR=RING
#CONNECT="" ATs0=1\r CONNECT \s\A
TIMEOUT=60

        Help!

        ...David

--

// Socom technologies, Inc.        Tel: 514/939-0480 Fax: 514/939-0834
   " There are lies, damned lies, and statistics. " -- Mark Twain

2. Which extra library to link for Profile.

3. Netscape plug-ins problem

4. Muliprocessor Linux

5. Problems with dialing out when dial-ins are enabled

6. Boot problem

7. Netscape 4.51 and plug-ins problem

8. Error code list & description?

9. DVD writing corruption (DMA problem? 2GB limit problem?)

10. SOCK_PACKET and datalink layer access from user space program

11. libpcap - writing using Linux SOCK_PACKET

12. SOCK_PACKET

13. What replaced socket(AF_INET,SOCK_PACKET....