mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-23 04:44:16 +08:00
@@ -343,8 +343,9 @@ arpresolve(
|
||||
rt = la->la_rt;
|
||||
}
|
||||
if (la == 0 || rt == 0) {
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s\n",
|
||||
inet_ntoa(SIN(dst)->sin_addr));
|
||||
inet_ntoa_r(SIN(dst)->sin_addr, addrbuf));
|
||||
m_freem(m);
|
||||
return (0);
|
||||
}
|
||||
@@ -449,6 +450,7 @@ in_arpinput(struct mbuf *m)
|
||||
struct sockaddr sa;
|
||||
struct in_addr isaddr, itaddr, myaddr;
|
||||
int op;
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
|
||||
ea = mtod(m, struct ether_arp *);
|
||||
op = ntohs(ea->arp_op);
|
||||
@@ -475,14 +477,14 @@ in_arpinput(struct mbuf *m)
|
||||
sizeof (ea->arp_sha))) {
|
||||
log(LOG_ERR,
|
||||
"arp: ether address is broadcast for IP address %s!\n",
|
||||
inet_ntoa(isaddr));
|
||||
inet_ntoa_r(isaddr, addrbuf));
|
||||
m_freem(m);
|
||||
return;
|
||||
}
|
||||
if (isaddr.s_addr == myaddr.s_addr) {
|
||||
log(LOG_ERR,
|
||||
"arp: %6D is using my IP address %s!\n",
|
||||
ea->arp_sha, ":", inet_ntoa(isaddr));
|
||||
ea->arp_sha, ":", inet_ntoa_r(isaddr, addrbuf));
|
||||
itaddr = myaddr;
|
||||
goto reply;
|
||||
}
|
||||
@@ -491,8 +493,8 @@ in_arpinput(struct mbuf *m)
|
||||
if (sdl->sdl_alen &&
|
||||
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
|
||||
log(LOG_INFO, "arp: %s moved from %6D to %6D\n",
|
||||
inet_ntoa(isaddr), (u_char *)LLADDR(sdl), ":",
|
||||
ea->arp_sha, ":");
|
||||
inet_ntoa_r(isaddr, addrbuf),
|
||||
(u_char *)LLADDR(sdl), ":", ea->arp_sha, ":");
|
||||
(void)memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha));
|
||||
sdl->sdl_alen = sizeof(ea->arp_sha);
|
||||
if (rt->rt_expire)
|
||||
@@ -549,7 +551,7 @@ reply:
|
||||
rtfree(rt);
|
||||
#ifdef DEBUG_PROXY
|
||||
printf("arp: proxying for %s\n",
|
||||
inet_ntoa(itaddr));
|
||||
inet_ntoa_r(itaddr, addrbuf));
|
||||
#endif
|
||||
} else {
|
||||
rt = la->la_rt;
|
||||
@@ -619,8 +621,9 @@ arplookup(u_long addr, int create, int proxy)
|
||||
why = "gateway route is not ours";
|
||||
|
||||
if (why && create) {
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
log(LOG_DEBUG, "arplookup %s failed: %s\n",
|
||||
inet_ntoa(sin.sin_addr), why);
|
||||
inet_ntoa_r(sin.sin_addr, addrbuf), why);
|
||||
return 0;
|
||||
} else if (why) {
|
||||
return 0;
|
||||
|
||||
@@ -973,13 +973,14 @@ ip_dooptions(struct mbuf *m)
|
||||
}
|
||||
|
||||
if (!ip_dosourceroute) {
|
||||
char buf[4*sizeof "123"];
|
||||
char buf0[INET_ADDRSTRLEN];
|
||||
char buf1[INET_ADDRSTRLEN];
|
||||
|
||||
nosourcerouting:
|
||||
strcpy(buf, inet_ntoa(ip->ip_dst));
|
||||
log(LOG_WARNING,
|
||||
"attempted source route from %s to %s\n",
|
||||
inet_ntoa(ip->ip_src), buf);
|
||||
inet_ntoa_r(ip->ip_dst, buf0),
|
||||
inet_ntoa_r(ip->ip_src, buf1));
|
||||
type = ICMP_UNREACH;
|
||||
code = ICMP_UNREACH_SRCFAIL;
|
||||
goto bad;
|
||||
|
||||
@@ -380,13 +380,13 @@ findpcb:
|
||||
*/
|
||||
if (inp == NULL) {
|
||||
if (log_in_vain && tiflags & TH_SYN) {
|
||||
char buf[4*sizeof "123"];
|
||||
char buf0[INET_ADDRSTRLEN];
|
||||
char buf1[INET_ADDRSTRLEN];
|
||||
|
||||
strcpy(buf, inet_ntoa(ti->ti_dst));
|
||||
log(LOG_INFO, "Connection attempt to TCP %s:%d"
|
||||
" from %s:%d\n",
|
||||
buf, ntohs(ti->ti_dport),
|
||||
inet_ntoa(ti->ti_src), ntohs(ti->ti_sport));
|
||||
inet_ntoa_r(ti->ti_dst, buf0), ntohs(ti->ti_dport),
|
||||
inet_ntoa_r(ti->ti_src, buf1), ntohs(ti->ti_sport));
|
||||
}
|
||||
goto dropwithreset;
|
||||
}
|
||||
|
||||
@@ -281,13 +281,13 @@ udp_input(struct mbuf *m, int iphlen)
|
||||
ip->ip_dst, uh->uh_dport, 1);
|
||||
if (inp == NULL) {
|
||||
if (log_in_vain) {
|
||||
char buf[4*sizeof "123"];
|
||||
char buf0[INET_ADDRSTRLEN];
|
||||
char buf1[INET_ADDRSTRLEN];
|
||||
|
||||
strcpy(buf, inet_ntoa(ip->ip_dst));
|
||||
log(LOG_INFO, "Connection attempt to UDP %s:%d"
|
||||
" from %s:%d\n",
|
||||
buf, ntohs(uh->uh_dport),
|
||||
inet_ntoa(ip->ip_src), ntohs(uh->uh_sport));
|
||||
inet_ntoa_r(ip->ip_dst, buf0), ntohs(uh->uh_dport),
|
||||
inet_ntoa_r(ip->ip_src, buf1), ntohs(uh->uh_sport));
|
||||
}
|
||||
udpstat.udps_noport++;
|
||||
if (m->m_flags & (M_BCAST | M_MCAST)) {
|
||||
|
||||
@@ -1184,8 +1184,9 @@ bootpc_init(bool update_files, bool forever)
|
||||
}
|
||||
|
||||
for (i = 0; i < rtems_bsdnet_nameserver_count; i++) {
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
strcpy(buf, "nameserver ");
|
||||
strcat(buf, inet_ntoa(rtems_bsdnet_nameserver[i]));
|
||||
strcat(buf, inet_ntoa_r(rtems_bsdnet_nameserver[i], addrbuf));
|
||||
strcat(buf, "\n");
|
||||
if (rtems_rootfs_file_append ("/etc/resolv.conf", MKFILE_MODE, 1, bufl))
|
||||
break;
|
||||
|
||||
@@ -177,7 +177,9 @@ rtems_rootfs_append_host_rec (in_addr_t cip,
|
||||
|
||||
if (cname && strlen (cname))
|
||||
{
|
||||
snprintf (bufp, sizeof (buf), "%s\t\t%s", inet_ntoa (ip), cname);
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
|
||||
snprintf (bufp, sizeof (buf), "%s\t\t%s", inet_ntoa_r (ip, addrbuf), cname);
|
||||
bufp += strlen (buf);
|
||||
|
||||
if (dname && strlen (dname))
|
||||
|
||||
@@ -1132,8 +1132,9 @@ dhcp_init (int update_files)
|
||||
}
|
||||
|
||||
for (i = 0; i < rtems_bsdnet_nameserver_count; i++) {
|
||||
char addrbuf[INET_ADDRSTRLEN];
|
||||
strcpy(buf, "nameserver ");
|
||||
strcat(buf, inet_ntoa(rtems_bsdnet_ntpserver[i]));
|
||||
strcat(buf, inet_ntoa_r(rtems_bsdnet_ntpserver[i], addrbuf));
|
||||
strcat(buf, "\n");
|
||||
if (rtems_rootfs_file_append ("/etc/resolv.conf", MKFILE_MODE, 1, bufl))
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user