Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
412e5c62
Commit
412e5c62
authored
Jun 19, 2000
by
Brian Wellington
Browse files
Add lwres_udp_port, so that test programs can use a different port.
parent
9550eb2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/lwres/context.c
View file @
412e5c62
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
#define LWRES_SOCKADDR_LEN_T unsigned int
#define LWRES_SOCKADDR_LEN_T unsigned int
#endif
#endif
lwres_uint16_t
lwres_udp_port
=
LWRES_UDP_PORT
;
static
void
*
static
void
*
lwres_malloc
(
void
*
,
size_t
);
lwres_malloc
(
void
*
,
size_t
);
...
@@ -178,7 +180,7 @@ context_connect(lwres_context_t *ctx) {
...
@@ -178,7 +180,7 @@ context_connect(lwres_context_t *ctx) {
memset
(
&
localhost
,
0
,
sizeof
(
localhost
));
memset
(
&
localhost
,
0
,
sizeof
(
localhost
));
localhost
.
sin_family
=
AF_INET
;
localhost
.
sin_family
=
AF_INET
;
localhost
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
localhost
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
localhost
.
sin_port
=
htons
(
LWRES_UDP_PORT
);
localhost
.
sin_port
=
htons
(
lwres_udp_port
);
s
=
socket
(
PF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
s
=
socket
(
PF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
if
(
s
<
0
)
if
(
s
<
0
)
...
@@ -271,7 +273,7 @@ lwres_context_sendrecv(lwres_context_t *ctx,
...
@@ -271,7 +273,7 @@ lwres_context_sendrecv(lwres_context_t *ctx,
* or if someone is sending us random stuff.
* or if someone is sending us random stuff.
*/
*/
if
(
sin
.
sin_addr
.
s_addr
!=
htonl
(
INADDR_LOOPBACK
)
if
(
sin
.
sin_addr
.
s_addr
!=
htonl
(
INADDR_LOOPBACK
)
||
sin
.
sin_port
!=
htons
(
LWRES_UDP_PORT
))
||
sin
.
sin_port
!=
htons
(
lwres_udp_port
))
goto
again
;
goto
again
;
if
(
recvd_len
!=
NULL
)
if
(
recvd_len
!=
NULL
)
...
...
lib/lwres/include/lwres/lwres.h
View file @
412e5c62
...
@@ -228,6 +228,11 @@ typedef struct {
...
@@ -228,6 +228,11 @@ typedef struct {
LWRES_LANG_BEGINDECLS
LWRES_LANG_BEGINDECLS
/*
* This is in host byte order.
*/
extern
lwres_uint16_t
lwres_udp_port
;
lwres_result_t
lwres_result_t
lwres_gabnrequest_render
(
lwres_context_t
*
ctx
,
lwres_gabnrequest_t
*
req
,
lwres_gabnrequest_render
(
lwres_context_t
*
ctx
,
lwres_gabnrequest_t
*
req
,
lwres_lwpacket_t
*
pkt
,
lwres_buffer_t
*
b
);
lwres_lwpacket_t
*
pkt
,
lwres_buffer_t
*
b
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment