The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: luvisi@andru.sonoma.edu (Andru Luvisi)
Subject: [pups] 2.11BSD networking on simh
Date: Mon, 2 Dec 2002 13:52:27 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0212021349370.643-100000@gladen> (raw)
In-Reply-To: <Pine.LNX.4.44.0211281703350.643-100000@gladen>

I finally tracked it down with strace.  The send() function was
complaining about not being connected.

By changing it to a sendto and providing some hard coded data I was able
to make it work.  Obviously this is not the "correct" solution, but it
illustrates the problem.

Here's the patch:

--- sim_ether.c.org     Mon Dec  2 12:43:49 2002
+++ sim_ether.c Mon Dec  2 13:51:47 2002
@@ -406,7 +406,9 @@

 int pcap_sendpacket(pcap_t* handle, u_char* msg, int len)
 {
-  return (send(pcap_fileno(handle), msg, len, 0) == len)?0:-1;
+  struct sockaddr_pkt spkt = { AF_INET, "eth0", -1 };
+  return (sendto(pcap_fileno(handle), msg, len, 0,
+                 (struct sockaddr *)&spkt, sizeof(spkt)) == len)?0:-1;
 }

 int PacketGetAdapterNames(char* buffer, int* size)





  reply	other threads:[~2002-12-02 21:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-28  4:50 Steven M. Schultz
2002-11-29  1:22 ` Andru Luvisi
2002-12-02 21:52   ` Andru Luvisi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-28  1:19 Andru Luvisi
2002-11-28  2:19 ` Gregg C Levine
2002-11-28  7:20   ` Andru Luvisi
2002-11-28 16:55     ` Andru Luvisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0212021349370.643-100000@gladen \
    --to=luvisi@andru.sonoma.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).