[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 25/41] slirp: Make IP packet ID consistent
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 25/41] slirp: Make IP packet ID consistent |
Date: |
Wed, 24 Jun 2009 14:42:30 +0200 |
User-agent: |
StGIT/0.14.3 |
Currently, ip_id is always initialized to 0 on slirp startup (despite
the broken attempt to derive it from the clock). This is good for
reproducibility. But it is not preserved across save/restore. This patch
therefore drops the dead initialization code from ip_init and introduces
ip_id to the persistent slirp state.
Signed-off-by: Jan Kiszka <address@hidden>
---
slirp/ip_input.c | 1 -
slirp/slirp.c | 8 +++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/slirp/ip_input.c b/slirp/ip_input.c
index 0356eb5..b07d3d5 100644
--- a/slirp/ip_input.c
+++ b/slirp/ip_input.c
@@ -59,7 +59,6 @@ void
ip_init(void)
{
ipq.ip_link.next = ipq.ip_link.prev = &ipq.ip_link;
- ip_id = tt.tv_sec & 0xffff;
udp_init();
tcp_init();
}
diff --git a/slirp/slirp.c b/slirp/slirp.c
index ea66c0c..02f6fe5 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -234,7 +234,7 @@ void slirp_init(int restricted, struct in_addr vnetwork,
vdhcp_startaddr = vdhcp_start;
vnameserver_addr = vnameserver;
- register_savevm("slirp", 0, 1, slirp_state_save, slirp_state_load, NULL);
+ register_savevm("slirp", 0, 2, slirp_state_save, slirp_state_load, NULL);
}
#define CONN_CANFSEND(so) (((so)->so_state &
(SS_FCANTSENDMORE|SS_ISFCONNECTED)) == SS_ISFCONNECTED)
@@ -973,6 +973,8 @@ static void slirp_state_save(QEMUFile *f, void *opaque)
slirp_socket_save(f, so);
}
qemu_put_byte(f, 0);
+
+ qemu_put_be16(f, ip_id);
}
static void slirp_tcp_load(QEMUFile *f, struct tcpcb *tp)
@@ -1103,5 +1105,9 @@ static int slirp_state_load(QEMUFile *f, void *opaque,
int version_id)
so->extra = (void *)ex_ptr->ex_exec;
}
+ if (version_id >= 2) {
+ ip_id = qemu_get_be16(f);
+ }
+
return 0;
}
- [Qemu-devel] [PATCH 13/41] slirp: Do not allow to remove non-hostfwd sockets, (continued)
- [Qemu-devel] [PATCH 13/41] slirp: Do not allow to remove non-hostfwd sockets, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 15/41] slirp: Add info usernet for dumping connection states, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 17/41] slirp: Drop statistic code, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 23/41] slirp: tftp: Rework filename handling, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 24/41] slirp: Factor out one-time initialization, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 19/41] slirp: Drop unused icmp_var.h, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 20/41] slirp: tftp: Cleanup tftp_prefix check, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 21/41] slirp: tftp: Clean up tftp_send_error, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 29/41] slirp: Clean up timeout handling around slirp_select_fill/poll, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 26/41] slirp: Clean up updtime, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 25/41] slirp: Make IP packet ID consistent,
Jan Kiszka <=
- [Qemu-devel] [PATCH 27/41] slirp: Kill slirp_is_inited, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 28/41] slirp: Drop redundant checks from slirp_output, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 36/41] slirp: Use shell to erase smb directory, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 35/41] slirp: Save/restore bootp client states, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 32/41] slirp: Use internal state in interface, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 33/41] slirp: Allocate/free stack instance dynamically, Jan Kiszka, 2009/06/24
- [Qemu-devel] [PATCH 31/41] slirp: Factor out internal state structure, Jan Kiszka, 2009/06/24