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
1b35bb1d
Commit
1b35bb1d
authored
9 years ago
by
hoelscher
Browse files
Options
Downloads
Patches
Plain Diff
Correcting errors for setsockopt with sctp_rtoinfo
parent
646f8749
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
+8
-6
8 additions, 6 deletions
gtests/net/packetdrill/run_system_call.c
gtests/net/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
+6
-3
6 additions, 3 deletions
...et/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
with
14 additions
and
9 deletions
gtests/net/packetdrill/run_system_call.c
+
8
−
6
View file @
1b35bb1d
...
@@ -1586,8 +1586,9 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1586,8 +1586,9 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
live_optlen
=
(
socklen_t
)
sizeof
(
struct
linger
);
live_optlen
=
(
socklen_t
)
sizeof
(
struct
linger
);
#ifdef SCTP_RTOINFO
#ifdef SCTP_RTOINFO
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
live_optval
=
m
alloc
(
sizeof
(
struct
sctp_rtoinfo
));
live_optval
=
c
alloc
(
1
,
sizeof
(
struct
sctp_rtoinfo
));
live_optlen
=
(
socklen_t
)
sizeof
(
struct
sctp_rtoinfo
);
live_optlen
=
(
socklen_t
)
sizeof
(
struct
sctp_rtoinfo
);
((
struct
sctp_rtoinfo
*
)
live_optval
)
->
srto_assoc_id
=
0
;
#endif
#endif
#ifdef SCTP_STATUS
#ifdef SCTP_STATUS
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_STATUS
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_STATUS
)
{
...
@@ -1651,7 +1652,7 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1651,7 +1652,7 @@ static int syscall_getsockopt(struct state *state, struct syscall_spec *syscall,
struct
expression
*
srto_max
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
;
struct
expression
*
srto_max
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
;
struct
expression
*
srto_min
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
;
struct
expression
*
srto_min
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
;
struct
sctp_rtoinfo
*
rtoinfo
=
live_optval
;
struct
sctp_rtoinfo
*
rtoinfo
=
live_optval
;
int
initial
,
max
,
min
;
int
initial
=
0
,
max
=
0
,
min
=
0
;
if
(
srto_initial
->
type
==
EXPR_INTEGER
)
{
if
(
srto_initial
->
type
==
EXPR_INTEGER
)
{
if
(
get_s32
(
srto_initial
,
&
initial
,
error
))
{
if
(
get_s32
(
srto_initial
,
&
initial
,
error
))
{
free
(
live_optval
);
free
(
live_optval
);
...
@@ -1776,16 +1777,17 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
...
@@ -1776,16 +1777,17 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
optval
=
&
optval_s32
;
optval
=
&
optval_s32
;
#ifdef SCTP_RTOINFO
#ifdef SCTP_RTOINFO
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_RTOINFO
)
{
if
(
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
type
!=
EXPR_INTEGER
||
if
(
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
type
!=
EXPR_INTEGER
||
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
->
type
!=
EXPR_INTEGER
||
val_expression
->
value
.
sctp_rtoinfo
->
srto_max
->
type
!=
EXPR_INTEGER
||
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
->
type
!=
EXPR_INTEGER
)
{
val_expression
->
value
.
sctp_rtoinfo
->
srto_min
->
type
!=
EXPR_INTEGER
)
{
asprintf
(
error
,
"Bad setsockopt, bad inputtype for rtoinfo"
);
return
STATUS_ERR
;
return
STATUS_ERR
;
}
}
optval
=
malloc
(
sizeof
(
struct
sctp_rtoinfo
));
optval
=
malloc
(
sizeof
(
struct
sctp_rtoinfo
));
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_initial
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_initial
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_initial
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_max
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_
initial
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_max
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_
max
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_min
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_in
itial
->
value
.
num
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_min
=
val_expression
->
value
.
sctp_rtoinfo
->
srto_
m
in
->
value
.
num
;
optval
=
&
val_expression
->
value
.
sctp_rtoinfo
;
((
struct
sctp_rtoinfo
*
)
optval
)
->
srto_assoc_id
=
0
;
#endif
#endif
#ifdef SCTP_INITMSG
#ifdef SCTP_INITMSG
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_INITMSG
)
{
}
else
if
(
val_expression
->
type
==
EXPR_SCTP_INITMSG
)
{
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/tests/bsd/sctp/sctp_get_socket_options.pkt
+
6
−
3
View file @
1b35bb1d
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
+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=8, sstat_rwnd=1500, sstat_unackdata=0, sstat_penddata=0, sstat_instrms=1, sstat_outstrms=1,
sstat_fragmentation_point=1452, sstat_primary=...}, [176])= 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
...
@@ -18,9 +21,9 @@
...
@@ -18,9 +21,9 @@
+0 setsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=200, srto_min=50}, 16) = 0
+0 setsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=200, srto_min=50}, 16) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=200, srto_min=50}, [16]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=200, srto_min=50}, [16]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=..., srto_max=200, srto_min=50}, [16]) = 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_
STATUS, {sstat_state=8, sstat_rwnd
=1
5
00, s
stat_unackdata=0, sstat_penddata=0, sstat_instrms=1, sstat_outstrms=1,
+0 getsockopt(3, IPPROTO_SCTP, SCTP_
RTOINFO, {srto_initial
=100, s
rto_max=..., srto_min=50}, [16]) = 0
sstat_fragmentation_point=1452, sstat_primary
=...}, [1
7
6])= 0
+0 getsockopt(3, IPPROTO_SCTP, SCTP_RTOINFO, {srto_initial=100, srto_max=200, srto_min
=...}, [16])
= 0
+0 close(3) = 0
+0 close(3) = 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