summaryrefslogtreecommitdiff
path: root/net-mgmt/wide-dhcp/files/patch-ac
diff options
context:
space:
mode:
authorSatoshi Asami <asami@FreeBSD.org>1996-05-04 02:43:35 +0000
committerSatoshi Asami <asami@FreeBSD.org>1996-05-04 02:43:35 +0000
commit6370b9489269271afbedbdf4851adb3989e3d58d (patch)
tree3d62c17a230678a8edc5a1f0339000c329697927 /net-mgmt/wide-dhcp/files/patch-ac
parentAdd trafshow. (diff)
Re-import wide-dhcp to a more suitable location. Also change the port
to one that works. Submitted by: Yoshiro MIHIRA <sanpei@yy.cs.keio.ac.jp>
Notes
Notes: svn path=/head/; revision=3061
Diffstat (limited to 'net-mgmt/wide-dhcp/files/patch-ac')
-rw-r--r--net-mgmt/wide-dhcp/files/patch-ac109
1 files changed, 109 insertions, 0 deletions
diff --git a/net-mgmt/wide-dhcp/files/patch-ac b/net-mgmt/wide-dhcp/files/patch-ac
new file mode 100644
index 000000000000..198574153364
--- /dev/null
+++ b/net-mgmt/wide-dhcp/files/patch-ac
@@ -0,0 +1,109 @@
+--- client/dhcpc_subr.c.org Sat Jan 20 19:40:45 1996
++++ client/dhcpc_subr.c Sat Jan 20 19:40:49 1996
+@@ -273,7 +273,11 @@
+ tmp = 0;
+ bcopy(&tmp, sarp->arp_spa, sarp->arp_pln);
+ bcopy(&target->s_addr, sarp->arp_tpa, sarp->arp_pln);
++#ifdef __FreeBSD__
++ sether->ether_type = ETHERTYPE_ARP;
++#else
+ sether->ether_type = htons(ETHERTYPE_ARP);
++#endif
+
+ if (ether_write(ifp->fd, sbuf, ETHERHL + sizeof(struct ether_arp)) < 0) {
+ return(0); /* it is harmless to return 0 */
+@@ -341,7 +345,11 @@
+ bcopy(&ipaddr->s_addr, sarp->arp_spa, sarp->arp_pln);
+ bcopy(&ipaddr->s_addr, sarp->arp_tpa, sarp->arp_pln);
+
++#ifdef __FreeBSD__
++ sether->ether_type = ETHERTYPE_ARP;
++#else
+ sether->ether_type = htons(ETHERTYPE_ARP);
++#endif
+
+ if (ether_write(ifp->fd, sbuf, ETHERHL + sizeof(struct ether_arp)) < 0) {
+ return(-1);
+@@ -1387,7 +1395,7 @@
+ /* get haddr of interface */
+ intface.haddr.htype = ETHER;
+ intface.haddr.hlen = 6;
+-#if defined(sony_news) || defined(__FreeBSD__)
++#if defined(sony_news) || !defined(__FreeBSD__)
+ if (ioctl(dhcpif.fd, SIOCGIFADDR, &ifr) < 0) {
+ syslog(LOG_WARNING, "ioctl(SIOCGIFADDR) error in initialize(): %m");
+ return(-1);
+@@ -1660,7 +1668,7 @@
+ /*
+ * set routing table
+ */
+-#ifndef BSDOS
++#if !defined(BSDOS) && (__FreeBSD__ != 2)
+ void
+ set_route(param)
+ struct dhcp_param *param;
+@@ -1730,6 +1738,10 @@
+ register char *cp = m_rtmsg.m_space;
+ register int l;
+
++ if (!ISSET(param->got_option, ROUTER) ||
++ param->router == NULL || param->router->addr == NULL)
++ return;
++
+ bzero(&so_dst, sizeof(struct sockaddr));
+ bzero(&so_mask, sizeof(struct sockaddr));
+ bzero(&so_gate, sizeof(struct sockaddr));
+@@ -1897,7 +1909,11 @@
+ lsether->ether_shost[i] = intface.haddr.haddr[i];
+ #endif
+ }
++#ifdef __FreeBSD__
++ lsether->ether_type = ETHERTYPE_IP;
++#else
+ lsether->ether_type = htons(ETHERTYPE_IP);
++#endif
+
+ return;
+ }
+@@ -2199,7 +2215,11 @@
+ snd.ether->ether_shost[i] = intface.haddr.haddr[i];
+ #endif
+ }
++#ifdef __FreeBSD__
++ snd.ether->ether_type = ETHERTYPE_IP;
++#else
+ snd.ether->ether_type = htons(ETHERTYPE_IP);
++#endif
+
+ return;
+ }
+@@ -2372,7 +2392,11 @@
+ snd.ether->ether_shost[i] = intface.haddr.haddr[i];
+ #endif
+ }
++#ifdef __FreeBSD__
++ snd.ether->ether_type = ETHERTYPE_IP;
++#else
+ snd.ether->ether_type = htons(ETHERTYPE_IP);
++#endif
+
+ return(0);
+ }
+@@ -2391,7 +2415,7 @@
+ struct msghdr msg;
+ struct iovec bufvec[1];
+ int bufsize = DFLTDHCPLEN;
+-#ifdef BSDOS
++#if defined(BSDOS) || (__FreeBSD__ == 2)
+ int on;
+ #endif
+
+@@ -2417,7 +2441,7 @@
+ return(-1);
+ }
+
+-#ifdef BSDOS
++#if defined(BSDOS) || (__FreeBSD__ == 2)
+ on = 1;
+ if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) {
+ close(sockfd);