Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e702b04c
Commit
e702b04c
authored
Sep 08, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using s_addr as a local variable name, to work around broken
system headers on Unixware.
parent
1a9a3467
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/backend/libpq/ip.c
src/backend/libpq/ip.c
+13
-13
No files found.
src/backend/libpq/ip.c
View file @
e702b04c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.2
1 2003/09/05 23:07:21
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/ip.c,v 1.2
2 2003/09/08 00:56:13
tgl Exp $
*
*
* This file and the IPV6 implementation were initially provided by
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
...
@@ -413,10 +413,10 @@ promote_v4_to_v6_addr(struct sockaddr_storage * addr)
...
@@ -413,10 +413,10 @@ promote_v4_to_v6_addr(struct sockaddr_storage * addr)
{
{
struct
sockaddr_in
addr4
;
struct
sockaddr_in
addr4
;
struct
sockaddr_in6
addr6
;
struct
sockaddr_in6
addr6
;
uint32
s_
addr
;
uint32
ip4
addr
;
memcpy
(
&
addr4
,
addr
,
sizeof
(
addr4
));
memcpy
(
&
addr4
,
addr
,
sizeof
(
addr4
));
s_
addr
=
ntohl
(
addr4
.
sin_addr
.
s_addr
);
ip4
addr
=
ntohl
(
addr4
.
sin_addr
.
s_addr
);
memset
(
&
addr6
,
0
,
sizeof
(
addr6
));
memset
(
&
addr6
,
0
,
sizeof
(
addr6
));
...
@@ -424,10 +424,10 @@ promote_v4_to_v6_addr(struct sockaddr_storage * addr)
...
@@ -424,10 +424,10 @@ promote_v4_to_v6_addr(struct sockaddr_storage * addr)
addr6
.
sin6_addr
.
s6_addr
[
10
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
10
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
11
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
11
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
12
]
=
(
s_
addr
>>
24
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
12
]
=
(
ip4
addr
>>
24
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
13
]
=
(
s_
addr
>>
16
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
13
]
=
(
ip4
addr
>>
16
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
14
]
=
(
s_
addr
>>
8
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
14
]
=
(
ip4
addr
>>
8
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
15
]
=
(
s_
addr
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
15
]
=
(
ip4
addr
)
&
0xFF
;
memcpy
(
addr
,
&
addr6
,
sizeof
(
addr6
));
memcpy
(
addr
,
&
addr6
,
sizeof
(
addr6
));
}
}
...
@@ -448,11 +448,11 @@ promote_v4_to_v6_mask(struct sockaddr_storage * addr)
...
@@ -448,11 +448,11 @@ promote_v4_to_v6_mask(struct sockaddr_storage * addr)
{
{
struct
sockaddr_in
addr4
;
struct
sockaddr_in
addr4
;
struct
sockaddr_in6
addr6
;
struct
sockaddr_in6
addr6
;
uint32
s_
addr
;
uint32
ip4
addr
;
int
i
;
int
i
;
memcpy
(
&
addr4
,
addr
,
sizeof
(
addr4
));
memcpy
(
&
addr4
,
addr
,
sizeof
(
addr4
));
s_
addr
=
ntohl
(
addr4
.
sin_addr
.
s_addr
);
ip4
addr
=
ntohl
(
addr4
.
sin_addr
.
s_addr
);
memset
(
&
addr6
,
0
,
sizeof
(
addr6
));
memset
(
&
addr6
,
0
,
sizeof
(
addr6
));
...
@@ -461,10 +461,10 @@ promote_v4_to_v6_mask(struct sockaddr_storage * addr)
...
@@ -461,10 +461,10 @@ promote_v4_to_v6_mask(struct sockaddr_storage * addr)
for
(
i
=
0
;
i
<
12
;
i
++
)
for
(
i
=
0
;
i
<
12
;
i
++
)
addr6
.
sin6_addr
.
s6_addr
[
i
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
i
]
=
0xff
;
addr6
.
sin6_addr
.
s6_addr
[
12
]
=
(
s_
addr
>>
24
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
12
]
=
(
ip4
addr
>>
24
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
13
]
=
(
s_
addr
>>
16
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
13
]
=
(
ip4
addr
>>
16
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
14
]
=
(
s_
addr
>>
8
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
14
]
=
(
ip4
addr
>>
8
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
15
]
=
(
s_
addr
)
&
0xFF
;
addr6
.
sin6_addr
.
s6_addr
[
15
]
=
(
ip4
addr
)
&
0xFF
;
memcpy
(
addr
,
&
addr6
,
sizeof
(
addr6
));
memcpy
(
addr
,
&
addr6
,
sizeof
(
addr6
));
}
}
...
...
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