[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] Fwd: lwip tcp socket in mini-os in xen 4.6.6



I have some trouble with lwip in minios-devel. Hope someone to help me to sovle this.

I have set up a tcp/ip server listening in the dom0. I want to use lwip to connect to the server.
I can`t use the tcp/ip to connect which is in dom0.


the error is that:

Initialising scheduler
Thread "Idle": pointer: 0x0x2000802050, stack: 0x0x110000
Thread "xenstore": pointer: 0x0x2000802800, stack: 0x0x120000
xenbus initialised on irq 1 mfn 0x1196ef
Thread "shutdown": pointer: 0x0x2000802fb0, stack: 0x0x130000
main.c: dummy main: start_info=0xc8be0
Thread "main": pointer: 0x0x2000803760, stack: 0x0x140000
[main] Waiting for network.
************************ NETFRONT for device/vif/0 **********


net TX ring size 256
net RX ring size 256
backend at /local/domain/0/backend/vif/3/0
mac is 00:16:3e:68:43:99
**************************
[main] IP ac150512 netmask ffff0000 gateway 0.
[main] TCP/IP bringup begins.
Thread "tcpip_thread": pointer: 0x0x20008064e0, stack: 0x0x250000
[tcpip_thread] TCP/IP bringup ends.
[main] Network is ready.
"main" 
Hello, world!
0
7e0515ac
socket -> 3

connect error!: Software caused connection abort

close(0)
close(1)
close(2)
close(3)
main returned -1
close network: backend at /local/domain/0/backend/vif/3/0
Do_exit called!
base is 0x14fee0 caller is 0x65d04
base is 0x14fef0 caller is 0x4b087
base is 0x14ff10 caller is 0x4b93a
base is 0x14ff40 caller is 0x668ab
base is 0x14ff60 caller is 0x4b8b5
base is 0x14ffe0 caller is 0x3423



my environment is below:

my dom0 has xenbr0.
xenbr0 : ip is 172.21.5.126

the minios.conf is below:
-------------------------------------minios.conf---------------------------------------------------------
name="minios"
kernel="/home/huanghaoxiang/xen-RELEASE-4.6.6/stubdom/mini-os-x86_64-c/mini-os.gz"
memory=8
vif=['mac=00:16:3e:68:43:99,ip=172.21.5.18,bridge=xenbr0']

#disk=["file:/home/test/vtpm/test.img,hda,w"]
#_on_crash_='preserve'
-------------------------------------minios.conf---------------------------------------------------------

Im write a tcp connection to test the connectivity in Xen-Release-4.6.6 /stubdom/c/main.c

----------------------------------minios.c
CONFIG_LWIP=y
CONFIG_XC=y

----------------------------------main.c------------------------------------------------------
int main(void) {
struct sockaddr_in sockaddr;
int sockfd, connectfd, ret;
sleep(2);
printf("Hello, world!\n");
sockfd = connectfd = -1;
ret = 0;
sleep(5);
bzero(&sockaddr, sizeof(sockaddr));
sockaddr.sin_family = AF_INET;
sockaddr.sin_port = htons(13000);
printf("%0x\n", sockaddr.sin_addr.s_addr);
if ((ret = inet_aton("172.21.5.126", &sockaddr.sin_addr)) < 0) 
{
perror("ip");     
return -1;

}
printf("%0x\n", sockaddr.sin_addr.s_addr);

if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) 
{
perror("socket");     
return -1;

}

if ((connectfd = connect(sockfd, (struct sockaddr *)&sockaddr, sizeof(sockaddr))) < 0)
{
perror("connect error!");     
return -1;
} else
{
printf("connnect succuse\n");
}
close(connectfd);
while (1)
{
sleep(2);
printf("Hello, world!\n");
}
return 0;
}
----------------------------------------------main.c-----------------------------------------------------

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.