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
eaf57b97
Commit
eaf57b97
authored
9 years ago
by
Michael Tüxen
Browse files
Options
Downloads
Patches
Plain Diff
Fix an off-by-one error.
While there remove some trailing whitespaces.
parent
ea07d3d6
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
+11
-26
11 additions, 26 deletions
gtests/net/packetdrill/run_system_call.c
gtests/net/packetdrill/tests/bsd/sctp/notifications/sctp_assoc_change_event.pkt
+2
-2
2 additions, 2 deletions
.../tests/bsd/sctp/notifications/sctp_assoc_change_event.pkt
with
13 additions
and
28 deletions
gtests/net/packetdrill/run_system_call.c
+
11
−
26
View file @
eaf57b97
...
...
@@ -418,7 +418,7 @@ static int get_sockstorage_arg(struct expression *arg, struct sockaddr_storage *
int
check_u8_expr
(
struct
expression
*
expr
,
u8
value
,
char
*
val_name
,
char
**
error
)
{
if
(
expr
->
type
!=
EXPR_ELLIPSIS
)
{
u8
script_val
;
if
(
get_u8
(
expr
,
&
script_val
,
error
))
{
return
STATUS_ERR
;
}
...
...
@@ -435,7 +435,7 @@ int check_u8_expr(struct expression *expr, u8 value, char *val_name, char **erro
int
check_u16_expr
(
struct
expression
*
expr
,
u16
value
,
char
*
val_name
,
char
**
error
)
{
if
(
expr
->
type
!=
EXPR_ELLIPSIS
)
{
u16
script_val
;
if
(
get_u16
(
expr
,
&
script_val
,
error
))
{
return
STATUS_ERR
;
}
...
...
@@ -451,7 +451,7 @@ int check_u16_expr(struct expression *expr, u16 value, char *val_name, char **er
int
check_s32_expr
(
struct
expression
*
expr
,
s16
value
,
char
*
val_name
,
char
**
error
)
{
if
(
expr
->
type
!=
EXPR_ELLIPSIS
)
{
s32
script_val
;
if
(
get_s32
(
expr
,
&
script_val
,
error
))
{
return
STATUS_ERR
;
}
...
...
@@ -467,7 +467,7 @@ int check_s32_expr(struct expression *expr, s16 value, char *val_name, char **er
int
check_u32_expr
(
struct
expression
*
expr
,
u16
value
,
char
*
val_name
,
char
**
error
)
{
if
(
expr
->
type
!=
EXPR_ELLIPSIS
)
{
u32
script_val
;
if
(
get_u32
(
expr
,
&
script_val
,
error
))
{
return
STATUS_ERR
;
}
...
...
@@ -3343,7 +3343,6 @@ static int check_sctp_nxtinfo(struct sctp_nxtinfo_expr *expr,
static
int
check_sctp_assoc_change
(
struct
sctp_assoc_change_expr
*
expr
,
struct
sctp_assoc_change
*
sctp_event
,
char
**
error
)
{
if
(
check_u16_expr
(
expr
->
sac_type
,
sctp_event
->
sac_type
,
"sctp_assoc_change.sac_type"
,
error
))
return
STATUS_ERR
;
...
...
@@ -3369,22 +3368,15 @@ static int check_sctp_assoc_change(struct sctp_assoc_change_expr *expr,
"sctp_assoc_change.sac_assoc_id"
,
error
))
return
STATUS_ERR
;
if
(
expr
->
sac_info
->
type
!=
EXPR_ELLIPSIS
)
{
size_t
infolen
=
0
;
size_t
infolen
;
struct
expression
*
info_expr
=
NULL
;
int
i
;
infolen
=
sizeof
(
sctp_event
->
sac_type
);
infolen
+=
sizeof
(
sctp_event
->
sac_flags
);
infolen
+=
sizeof
(
sctp_event
->
sac_length
);
infolen
+=
sizeof
(
sctp_event
->
sac_state
);
infolen
+=
sizeof
(
sctp_event
->
sac_error
);
infolen
+=
sizeof
(
sctp_event
->
sac_outbound_streams
);
infolen
+=
sizeof
(
sctp_event
->
sac_inbound_streams
);
infolen
+=
sizeof
(
sctp_event
->
sac_assoc_id
);
infolen
=
sctp_event
->
sac_length
-
infolen
+
1
;
unsigned
int
i
;
infolen
=
sctp_event
->
sac_length
-
sizeof
(
struct
sctp_assoc_change
);
switch
(
expr
->
sac_info
->
type
)
{
case
EXPR_LIST
:
if
(
infolen
!=
expression_list_length
(
expr
->
sac_info
->
value
.
list
))
{
asprintf
(
error
,
"sctp_assoc_change.
sac_
list length unequal to sac_
lenth expected: %u actual %u"
,
asprintf
(
error
,
"sctp_assoc_change.sac_
info
len
g
th
:
expected: %u actual %u"
,
expression_list_length
(
expr
->
sac_info
->
value
.
list
),
infolen
);
return
STATUS_ERR
;
}
...
...
@@ -3397,19 +3389,12 @@ static int check_sctp_assoc_change(struct sctp_assoc_change_expr *expr,
return
STATUS_ERR
;
}
if
(
script_val
!=
sctp_event
->
sac_info
[
i
])
{
asprintf
(
error
,
"sctp_assoc_change.sac_info
. byte
%d: expected: %hhu actual: %hhu"
,
asprintf
(
error
,
"sctp_assoc_change.sac_info
[
%d
]
: expected: %hhu actual: %hhu"
,
i
,
script_val
,
sctp_event
->
sac_info
[
i
]);
return
STATUS_ERR
;
}
}
/*if (info_expr->type != EXPR_ELLIPSIS) {
if (check_u8_expr(info_expr, sctp_event->sac_info[i],
"sctp_assoc_change.sac_info", error))
return STATUS_ERR;
}
*/
}
}
break
;
default:
asprintf
(
error
,
"Bad expressiontype for sac_info"
);
return
STATUS_ERR
;
...
...
This diff is collapsed.
Click to expand it.
gtests/net/packetdrill/tests/bsd/sctp/notifications/sctp_assoc_change_event.pkt
+
2
−
2
View file @
eaf57b97
...
...
@@ -10,7 +10,7 @@
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.1 < sctp: COOKIE_ACK[flgs=0]
+0.0 sctp_recvv(3, [{iov_base={sac_type=SCTP_ASSOC_CHANGE, sac_flags=0, sac_length=21, sac_state=SCTP_COMM_UP, sac_error=0, sac_outbound_streams=1,
sac_inbound_streams=1, sac_assoc_id=
3
, sac_info=[SCTP_ASSOC_SUPPORTS_MULTIBUF
, 0x00
]}, iov_len=1000}], 1, ..., 20, NULL, [0], [SCTP_RECVV_NOINFO],
sac_inbound_streams=1, sac_assoc_id=
...
, sac_info=[SCTP_ASSOC_SUPPORTS_MULTIBUF]}, iov_len=1000}], 1, ..., 20, NULL, [0], [SCTP_RECVV_NOINFO],
[MSG_NOTIFICATION|MSG_EOR]) = 21
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
...
...
@@ -18,5 +18,5 @@ sac_inbound_streams=1, sac_assoc_id=3, sac_info=[SCTP_ASSOC_SUPPORTS_MULTIBUF, 0
* > sctp: SHUTDOWN_ACK[flgs=0]
+0.0 < sctp: SHUTDOWN_COMPLETE[flgs=0]
+0.0 sctp_recvv(3, [{iov_base={sac_type=SCTP_ASSOC_CHANGE, sac_flags=0, sac_length=20, sac_state=SCTP_SHUTDOWN_COMP, sac_error=0, sac_outbound_streams=1,
sac_inbound_streams=1, sac_assoc_id=
3
, sac_info=[
0
]}, iov_len=1000}], 1, ..., 20, NULL, [0], [SCTP_RECVV_NOINFO], [MSG_NOTIFICATION|MSG_EOR]) = 20
sac_inbound_streams=1, sac_assoc_id=
...
, sac_info=[]}, iov_len=1000}], 1, ..., 20, NULL, [0], [SCTP_RECVV_NOINFO], [MSG_NOTIFICATION|MSG_EOR]) = 20
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