Bugzilla – Attachment 359 Details for
Bug 620
Address bits are backwards when setting up port forwarding on Solaris/intel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test loopback address for sanity.
getaddrtest.c (text/plain), 563 bytes, created by
Darren Tucker
on 2003-07-20 00:33:04 AEST
(
hide
)
Description:
Test loopback address for sanity.
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2003-07-20 00:33:04 AEST
Size:
563 bytes
patch
obsolete
>#include <stdio.h> >#include <netinet/in.h> >#include <sys/types.h> >#include <sys/socket.h> >#include <netdb.h> > >int >main() >{ > struct addrinfo hints, *ai; > struct sockaddr_in *sa; > in_addr_t loopback = htonl(0x7f000001); > > memset(&hints, 0, sizeof(hints)); > hints.ai_family = AF_INET; > hints.ai_socktype = SOCK_STREAM; > > if (getaddrinfo(NULL, "22", &hints, &ai) == 0 && > ai && ai->ai_family == AF_INET) { > sa = (struct sockaddr_in *)ai->ai_addr; > if (sa->sin_addr.s_addr == loopback) > printf("Loopback sane\n"); > else > printf("Loopback not sane\n"); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 620
:
357
|
358
| 359 |
384