From 62c1d2c4833f53897098f945f504f5ec3022d35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 10 Nov 2018 17:45:36 +0400 Subject: slirp: associate slirp_output callback with the Slirp context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's make the slirp interface a bit more library-like. Associate the slirp_output() with a Slirp context. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- net/slirp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/slirp.c b/net/slirp.c index 38ae65e4a9..dd06b0189e 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -99,7 +99,7 @@ static void slirp_smb_cleanup(SlirpState *s); static inline void slirp_smb_cleanup(SlirpState *s) { } #endif -void slirp_output(void *opaque, const uint8_t *pkt, int pkt_len) +static void net_slirp_output(void *opaque, const uint8_t *pkt, int pkt_len) { SlirpState *s = opaque; @@ -378,7 +378,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, ipv6, ip6_prefix, vprefix6_len, ip6_host, vhostname, tftp_server_name, tftp_export, bootfile, dhcp, - dns, ip6_dns, dnssearch, vdomainname, s); + dns, ip6_dns, dnssearch, vdomainname, + net_slirp_output, s); QTAILQ_INSERT_TAIL(&slirp_stacks, s, entry); for (config = slirp_configs; config; config = config->next) { -- cgit v1.2.3