From: Benjamin MARSILI <mlspirat42@gmail.com>
To: qemu-devel@nongnu.org
Cc: Benjamin MARSILI <mlspirat42@gmail.com>
Subject: [Qemu-devel] [PATCH] net: Include the peer's information in VLANClientState->info_str when using the udp socket backend.
Date: Mon, 7 May 2012 00:21:07 +0900 [thread overview]
Message-ID: <1336317667-3484-1-git-send-email-mlspirat42@gmail.com> (raw)
Signed-off-by: Benjamin MARSILI <mlspirat42@gmail.com>
---
It makes it easier to debug and figure out what's going on behind the scene.
When using this syntax:
-device DEVICE,netdev=ID -netdev socket,id=ID,udp=LHOST:LPORT,localaddr=RHOST:RPORT
Before:
(qemu) info network
Devices not on any VLAN:
rtl8139.0: type=nic,model=rtl8139,macaddr=00:ab:29:8c:3e:00
\ gns3-0: type=socket,socket: udp=127.0.0.1:20003
rtl8139.1: type=nic,model=rtl8139,macaddr=00:ab:29:8c:3e:01
\ gns3-1: type=socket,socket: udp=127.0.0.1:20002
After:
(qemu) info network
Devices not on any VLAN:
rtl8139.0: type=nic,model=rtl8139,macaddr=00:ab:29:8c:3e:00
\ gns3-0: type=socket,socket: udp=127.0.0.1:20003, localaddr=127.0.0.1,20004
rtl8139.1: type=nic,model=rtl8139,macaddr=00:ab:29:8c:3e:01
\ gns3-1: type=socket,socket: udp=127.0.0.1:20002, localaddr=127.0.0.1,10000
net/socket.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 0bcf229..7613990 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -580,8 +580,9 @@ static int net_socket_udp_init(VLANState *vlan,
s->dgram_dst = raddr;
snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "socket: udp=%s:%d",
- inet_ntoa(raddr.sin_addr), ntohs(raddr.sin_port));
+ "socket: udp=%s:%d, localaddr=%s,%d",
+ inet_ntoa(raddr.sin_addr), ntohs(raddr.sin_port),
+ inet_ntoa(laddr.sin_addr), ntohs(laddr.sin_port));
return 0;
}
--
1.7.6
reply other threads:[~2012-05-06 6:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336317667-3484-1-git-send-email-mlspirat42@gmail.com \
--to=mlspirat42@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).