Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Packetdrill_tarr_ext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Gense
Packetdrill_tarr_ext
Commits
31a2685f
Commit
31a2685f
authored
9 years ago
by
hoelscher
Browse files
Options
Downloads
Patches
Plain Diff
Add for set/getsockopt for sctp_paddrparams with spp_address as ellipsis with primary peeraddress
parent
77d7bb73
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gtests/net/packetdrill/run_system_call.c
+18
-5
18 additions, 5 deletions
gtests/net/packetdrill/run_system_call.c
gtests/net/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
+3
-1
3 additions, 1 deletion
...et/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
with
21 additions
and
6 deletions
gtests/net/packetdrill/run_system_call.c
+
18
−
5
View file @
31a2685f
...
@@ -1621,13 +1621,19 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1621,13 +1621,19 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
struct
sctp_paddrparams_expr
*
expr_params
=
val_expression
->
value
.
sctp_paddrparams
;
struct
sctp_paddrparams_expr
*
expr_params
=
val_expression
->
value
.
sctp_paddrparams
;
struct
sctp_paddrparams
*
live_params
=
malloc
(
sizeof
(
struct
sctp_paddrparams
));
struct
sctp_paddrparams
*
live_params
=
malloc
(
sizeof
(
struct
sctp_paddrparams
));
live_optlen
=
sizeof
(
struct
sctp_paddrparams
);
live_optlen
=
sizeof
(
struct
sctp_paddrparams
);
if
(
expr_params
->
spp_address
->
type
!=
EXPR_ELLIPSIS
)
{
if
(
expr_params
->
spp_address
->
type
==
EXPR_ELLIPSIS
)
{
if
(
expr_params
->
spp_address
->
type
==
EXPR_SOCKET_ADDRESS_IPV4
)
{
socklen_t
len_addr
=
sizeof
(
live_params
->
spp_address
);
memcpy
(
&
live_params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv4
,
sizeof
(
struct
sockaddr_in
));
if
(
getpeername
(
live_fd
,
(
struct
sockaddr
*
)
&
live_params
->
spp_address
,
&
len_addr
))
{
}
else
{
asprintf
(
error
,
"Bad setsockopt, bad get primary peer address"
);
memcpy
(
&
live_params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv6
,
sizeof
(
struct
sockaddr_in6
));
free
(
live_params
);
return
STATUS_ERR
;
}
}
}
else
if
(
expr_params
->
spp_address
->
type
==
EXPR_SOCKET_ADDRESS_IPV4
)
{
memcpy
(
&
live_params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv4
,
sizeof
(
struct
sockaddr_in
));
}
else
if
(
expr_params
->
spp_address
->
type
==
EXPR_SOCKET_ADDRESS_IPV6
)
{
memcpy
(
&
live_params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv6
,
sizeof
(
struct
sockaddr_in6
));
}
else
{
}
else
{
asprintf
(
error
,
"Bad setsockopt, bad get input for spp_address"
);
free
(
live_params
);
free
(
live_params
);
return
STATUS_ERR
;
return
STATUS_ERR
;
}
}
...
@@ -2031,6 +2037,13 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -2031,6 +2037,13 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
memcpy
(
&
params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv4
,
sizeof
(
struct
sockaddr_in
));
memcpy
(
&
params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv4
,
sizeof
(
struct
sockaddr_in
));
}
else
if
(
expr_params
->
spp_address
->
type
==
EXPR_SOCKET_ADDRESS_IPV6
)
{
}
else
if
(
expr_params
->
spp_address
->
type
==
EXPR_SOCKET_ADDRESS_IPV6
)
{
memcpy
(
&
params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv6
,
sizeof
(
struct
sockaddr_in6
));
memcpy
(
&
params
->
spp_address
,
expr_params
->
spp_address
->
value
.
socket_address_ipv6
,
sizeof
(
struct
sockaddr_in6
));
}
else
if
(
expr_params
->
spp_address
->
type
==
EXPR_ELLIPSIS
)
{
socklen_t
len_addr
=
sizeof
(
params
->
spp_address
);
if
(
getpeername
(
live_fd
,
(
struct
sockaddr
*
)
&
params
->
spp_address
,
&
len_addr
))
{
asprintf
(
error
,
"Bad setsockopt, bad get primary peer address"
);
free
(
params
);
return
STATUS_ERR
;
}
}
else
{
}
else
{
asprintf
(
error
,
"Bad setsockopt, bad input for spp_address for socketoption SCTP_PADDRPARAMS"
);
asprintf
(
error
,
"Bad setsockopt, bad input for spp_address for socketoption SCTP_PADDRPARAMS"
);
free
(
params
);
free
(
params
);
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
+
3
−
1
View file @
31a2685f
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
//+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
//+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_STATUS, {sstat_state=
SCTP_ESTABLISHED
, sstat_rwnd=1500,
+0 getsockopt(3, IPPROTO_SCTP, SCTP_STATUS, {sstat_state=
...
, sstat_rwnd=1500,
sstat_unackdata=0, sstat_penddata=0, sstat_instrms=1, sstat_outstrms=1, sstat_fragmentation_point=1452, sstat_primary=...}, [176])= 0
sstat_unackdata=0, sstat_penddata=0, sstat_instrms=1, sstat_outstrms=1, sstat_fragmentation_point=1452, sstat_primary=...}, [176])= 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_STATUS, {sstat_state=..., sstat_rwnd=1500, sstat_unackdata=0,
+0 getsockopt(3, IPPROTO_SCTP, SCTP_STATUS, {sstat_state=..., sstat_rwnd=1500, sstat_unackdata=0,
...
@@ -55,6 +55,8 @@ spp_hbinterval=60000, spp_pathmtu=..., spp_pathmaxrxt=5}, [152]) = 0
...
@@ -55,6 +55,8 @@ spp_hbinterval=60000, spp_pathmtu=..., spp_pathmaxrxt=5}, [152]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, {spp_address={sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("192.0.2.1")},
+0 getsockopt(3, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, {spp_address={sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("192.0.2.1")},
spp_hbinterval=60000, spp_pathmtu=1468, spp_pathmaxrxt=...}, [152]) = 0
spp_hbinterval=60000, spp_pathmtu=1468, spp_pathmaxrxt=...}, [152]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, {spp_address=..., spp_hbinterval=60000, spp_pathmtu=1468, spp_pathmaxrxt=...}, [152]) = 0
+0 setsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=1, linger=30}, 8) = 0
+0 setsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=1, linger=30}, 8) = 0
+0 getsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=128, linger=30}, [8]) = 0
+0 getsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=128, linger=30}, [8]) = 0
+0 getsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=128, linger=...}, [8]) = 0
+0 getsockopt(3, SOL_SOCKET, SO_LINGER, {onoff=128, linger=...}, [8]) = 0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment