Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Adding breaktrace & disabling timer migration"
[kvmfornfv.git]
/
qemu
/
slirp
/
ip_input.c
diff --git
a/qemu/slirp/ip_input.c
b/qemu/slirp/ip_input.c
index
880bdfd
..
cdd5483
100644
(file)
--- a/
qemu/slirp/ip_input.c
+++ b/
qemu/slirp/ip_input.c
@@
-38,6
+38,7
@@
* terms and conditions of the copyright.
*/
* terms and conditions of the copyright.
*/
+#include "qemu/osdep.h"
#include <slirp.h>
#include <qemu/osdep.h>
#include "ip_icmp.h"
#include <slirp.h>
#include <qemu/osdep.h>
#include "ip_icmp.h"
@@
-79,12
+80,16
@@
ip_input(struct mbuf *m)
register struct ip *ip;
int hlen;
register struct ip *ip;
int hlen;
+ if (!slirp->in_enabled) {
+ goto bad;
+ }
+
DEBUG_CALL("ip_input");
DEBUG_CALL("ip_input");
- DEBUG_ARG("m = %
lx", (long)
m);
+ DEBUG_ARG("m = %
p",
m);
DEBUG_ARG("m_len = %d", m->m_len);
if (m->m_len < sizeof (struct ip)) {
DEBUG_ARG("m_len = %d", m->m_len);
if (m->m_len < sizeof (struct ip)) {
-
return
;
+
goto bad
;
}
ip = mtod(m, struct ip *);
}
ip = mtod(m, struct ip *);
@@
-131,9
+136,9
@@
ip_input(struct mbuf *m)
m_adj(m, ip->ip_len - m->m_len);
/* check ip_ttl for a correct ICMP reply */
m_adj(m, ip->ip_len - m->m_len);
/* check ip_ttl for a correct ICMP reply */
- if
(ip->ip_ttl==
0) {
-
icmp_error(m, ICMP_TIMXCEED,ICMP_TIMXCEED_INTRANS, 0,
"ttl");
- goto bad;
+ if
(ip->ip_ttl ==
0) {
+
icmp_send_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0,
"ttl");
+
goto bad;
}
/*
}
/*
@@
-199,7
+204,7
@@
ip_input(struct mbuf *m)
*/
switch (ip->ip_p) {
case IPPROTO_TCP:
*/
switch (ip->ip_p) {
case IPPROTO_TCP:
- tcp_input(m, hlen, (struct socket *)NULL);
+ tcp_input(m, hlen, (struct socket *)NULL
, AF_INET
);
break;
case IPPROTO_UDP:
udp_input(m, hlen);
break;
case IPPROTO_UDP:
udp_input(m, hlen);
@@
-232,9
+237,9
@@
ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp)
int i, next;
DEBUG_CALL("ip_reass");
int i, next;
DEBUG_CALL("ip_reass");
- DEBUG_ARG("ip = %
lx", (long)
ip);
- DEBUG_ARG("fp = %
lx", (long)
fp);
- DEBUG_ARG("m = %
lx", (long)
m);
+ DEBUG_ARG("ip = %
p",
ip);
+ DEBUG_ARG("fp = %
p",
fp);
+ DEBUG_ARG("m = %
p",
m);
/*
* Presence of header sizes in mbufs
/*
* Presence of header sizes in mbufs
@@
-400,7
+405,7
@@
static void
ip_enq(register struct ipasfrag *p, register struct ipasfrag *prev)
{
DEBUG_CALL("ip_enq");
ip_enq(register struct ipasfrag *p, register struct ipasfrag *prev)
{
DEBUG_CALL("ip_enq");
- DEBUG_ARG("prev = %
lx", (long)
prev);
+ DEBUG_ARG("prev = %
p",
prev);
p->ipf_prev = prev;
p->ipf_next = prev->ipf_next;
((struct ipasfrag *)(prev->ipf_next))->ipf_prev = p;
p->ipf_prev = prev;
p->ipf_next = prev->ipf_next;
((struct ipasfrag *)(prev->ipf_next))->ipf_prev = p;
@@
-636,7
+641,7
@@
typedef uint32_t n_time;
}
return (0);
bad:
}
return (0);
bad:
- icmp_error(m, type, code, 0, 0);
+ icmp_
send_
error(m, type, code, 0, 0);
return (1);
}
return (1);
}