mirror of
https://github.com/PDP-10/klh10.git
synced 2026-02-06 16:35:39 +00:00
Small cleanups.
This commit is contained in:
10
src/dpni20.c
10
src/dpni20.c
@@ -973,7 +973,7 @@ void eth_mcatset(struct dpni20_s *dpni)
|
||||
n = DPNI_MCAT_SIZ;
|
||||
for (i = 0; i < nmcats; ++i) {
|
||||
for (j = 0; j < n; ++j) {
|
||||
if (memcmp(ethmcat[i], dpni->dpni_mcat[j], 6) == 0)
|
||||
if (ea_cmp(ethmcat[i], dpni->dpni_mcat[j]) == 0)
|
||||
break;
|
||||
}
|
||||
if (j < n)
|
||||
@@ -996,7 +996,7 @@ void eth_mcatset(struct dpni20_s *dpni)
|
||||
*/
|
||||
for (j = 0; j < n; ++j) {
|
||||
for (i = 0; i < nmcats; ++i) {
|
||||
if (memcmp(ethmcat[i], dpni->dpni_mcat[j], 6) == 0)
|
||||
if (ea_cmp(ethmcat[i], dpni->dpni_mcat[j]) == 0)
|
||||
break;
|
||||
}
|
||||
if (j < n)
|
||||
@@ -1144,7 +1144,9 @@ int arp_myreply(unsigned char *buf, int cnt)
|
||||
*/
|
||||
(void)osn_pfwrite(&pfdata, pktbuf, sizeof(pktbuf));
|
||||
#else
|
||||
/* ARP reply packet, pass to 10 via DPC */
|
||||
/* ARP reply packet, pass to 10 via DPC.
|
||||
* Can we do that? We're not the process which normally does that...
|
||||
*/
|
||||
struct dpx_s *dpx;
|
||||
unsigned char *buff;
|
||||
size_t max;
|
||||
@@ -1307,7 +1309,7 @@ void tentoeth(struct dpni20_s *dpni)
|
||||
fprintf(stderr, "]");
|
||||
}
|
||||
else
|
||||
dbprint("SPKT %d", progname, rcnt);
|
||||
dbprint("SPKT %d", rcnt);
|
||||
}
|
||||
if (doarpchk /* If must check ARPs */
|
||||
&& arp_reqcheck(buff, rcnt) /* and this is an ARP req */
|
||||
|
||||
12
src/osdnet.c
12
src/osdnet.c
@@ -1714,7 +1714,7 @@ osn_pfinit_tuntap(struct pfdata *pfdata, struct osnpf *osnpf, void *arg)
|
||||
if (DP_DBGFLG)
|
||||
dbprintln("running \"%s\"",cmdbuff);
|
||||
if ((res = system(cmdbuff)) != 0) {
|
||||
esfatal(1, "osn_pfinit: ifconfig failed to initialize tunnel device?");
|
||||
esfatal(1, "osn_pfinit_tuntap: ifconfig failed to initialize tunnel device?");
|
||||
}
|
||||
}
|
||||
#else /* not CENV_SYS_LINUX */
|
||||
@@ -1735,7 +1735,7 @@ osn_pfinit_tuntap(struct pfdata *pfdata, struct osnpf *osnpf, void *arg)
|
||||
strncpy(ifr.ifr_name, ifnam, sizeof(ifr.ifr_name));
|
||||
if (ioctl(s, SIOCDIFADDR, &ifr) < 0) {
|
||||
if (DP_DBGFLG)
|
||||
syserr(errno, "osn_pfinit tun SIOCDIFADDR failed");
|
||||
syserr(errno, "osn_pfinit_tuntap SIOCDIFADDR failed; usual for new interfaces.");
|
||||
}
|
||||
|
||||
if (pfdata->pf_ip4_only) {
|
||||
@@ -1751,7 +1751,7 @@ osn_pfinit_tuntap(struct pfdata *pfdata, struct osnpf *osnpf, void *arg)
|
||||
((struct sockaddr_in *)(&ifra.ifra_broadaddr))->sin_family = AF_INET;
|
||||
((struct sockaddr_in *)(&ifra.ifra_broadaddr))->sin_addr = ipremote;
|
||||
if (ioctl(s, SIOCAIFADDR, &ifra) < 0) {
|
||||
esfatal(1, "osn_pfinit tun SIOCAIFADDR failed");
|
||||
esfatal(1, "osn_pfinit_tuntap SIOCAIFADDR failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1759,15 +1759,13 @@ osn_pfinit_tuntap(struct pfdata *pfdata, struct osnpf *osnpf, void *arg)
|
||||
Note interface name is still there from the SIOCDIFADDR.
|
||||
*/
|
||||
if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {
|
||||
esfatal(1, "osn_pfinit tun SIOCGIFFLAGS failed");
|
||||
esfatal(1, "osn_pfinit_tuntap SIOCGIFFLAGS failed");
|
||||
}
|
||||
if (!(ifr.ifr_flags & IFF_UP)) {
|
||||
ifr.ifr_flags |= IFF_UP;
|
||||
if (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) {
|
||||
esfatal(1, "osn_pfinit tun SIOCSIFFLAGS failed");
|
||||
esfatal(1, "osn_pfinit_tuntap SIOCSIFFLAGS failed");
|
||||
}
|
||||
if (DP_DBGFLG)
|
||||
dbprint("osn_pfinit tun did SIOCSIFFLAGS");
|
||||
}
|
||||
}
|
||||
#endif /* CENV_SYS_LINUX */
|
||||
|
||||
Reference in New Issue
Block a user