Skip to content

Commit a3b51fa

Browse files
committed
MPTCP: Fix a Visual Studio 15 warning about TCP flags
print-tcp.c(655): warning C4242: 'function': conversion from 'uint16_t' to 'u_char', possible loss of data This is a follow-up to 55dc320 (TCP: Add support for the AE (AccECN) flag)
1 parent 266183e commit a3b51fa

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

netdissect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ extern void mobile_print(netdissect_options *, const u_char *, u_int);
719719
extern int mobility_print(netdissect_options *, const u_char *, const u_char *);
720720
extern void mpcp_print(netdissect_options *, const u_char *, u_int);
721721
extern void mpls_print(netdissect_options *, const u_char *, u_int);
722-
extern int mptcp_print(netdissect_options *, const u_char *, u_int, u_char);
722+
extern int mptcp_print(netdissect_options *, const u_char *, u_int, uint16_t);
723723
extern void msdp_print(netdissect_options *, const u_char *, u_int);
724724
extern void msnlb_print(netdissect_options *, const u_char *);
725725
extern void nbt_tcp_print(netdissect_options *, const u_char *, u_int);

print-mptcp.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ struct mp_tcprst {
221221

222222
static int
223223
dummy_print(netdissect_options *ndo _U_,
224-
const u_char *opt _U_, u_int opt_len _U_, u_char flags _U_)
224+
const u_char *opt _U_, u_int opt_len _U_, uint16_t flags _U_)
225225
{
226226
return 1;
227227
}
228228

229229
static int
230230
mp_capable_print(netdissect_options *ndo,
231-
const u_char *opt, u_int opt_len, u_char flags)
231+
const u_char *opt, u_int opt_len, uint16_t flags)
232232
{
233233
const struct mp_capable *mpc = (const struct mp_capable *) opt;
234234
uint8_t version, csum_enabled;
@@ -270,7 +270,7 @@ mp_capable_print(netdissect_options *ndo,
270270

271271
static int
272272
mp_join_print(netdissect_options *ndo,
273-
const u_char *opt, u_int opt_len, u_char flags)
273+
const u_char *opt, u_int opt_len, uint16_t flags)
274274
{
275275
const struct mp_join *mpj = (const struct mp_join *) opt;
276276

@@ -310,7 +310,7 @@ mp_join_print(netdissect_options *ndo,
310310

311311
static int
312312
mp_dss_print(netdissect_options *ndo,
313-
const u_char *opt, u_int opt_len, u_char flags)
313+
const u_char *opt, u_int opt_len, uint16_t flags)
314314
{
315315
const struct mp_dss *mdss = (const struct mp_dss *) opt;
316316
uint8_t mdss_flags;
@@ -401,7 +401,7 @@ mp_dss_print(netdissect_options *ndo,
401401

402402
static int
403403
add_addr_print(netdissect_options *ndo,
404-
const u_char *opt, u_int opt_len, u_char flags _U_)
404+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
405405
{
406406
const struct mp_add_addr *add_addr = (const struct mp_add_addr *) opt;
407407

@@ -438,7 +438,7 @@ add_addr_print(netdissect_options *ndo,
438438

439439
static int
440440
remove_addr_print(netdissect_options *ndo,
441-
const u_char *opt, u_int opt_len, u_char flags _U_)
441+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
442442
{
443443
const struct mp_remove_addr *remove_addr = (const struct mp_remove_addr *) opt;
444444
u_int i;
@@ -455,7 +455,7 @@ remove_addr_print(netdissect_options *ndo,
455455

456456
static int
457457
mp_prio_print(netdissect_options *ndo,
458-
const u_char *opt, u_int opt_len, u_char flags _U_)
458+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
459459
{
460460
const struct mp_prio *mpp = (const struct mp_prio *) opt;
461461

@@ -474,7 +474,7 @@ mp_prio_print(netdissect_options *ndo,
474474

475475
static int
476476
mp_fail_print(netdissect_options *ndo,
477-
const u_char *opt, u_int opt_len, u_char flags _U_)
477+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
478478
{
479479
if (opt_len != 12)
480480
return 0;
@@ -485,7 +485,7 @@ mp_fail_print(netdissect_options *ndo,
485485

486486
static int
487487
mp_fast_close_print(netdissect_options *ndo,
488-
const u_char *opt, u_int opt_len, u_char flags _U_)
488+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
489489
{
490490
if (opt_len != 12)
491491
return 0;
@@ -496,7 +496,7 @@ mp_fast_close_print(netdissect_options *ndo,
496496

497497
static int
498498
mp_tcprst_print(netdissect_options *ndo,
499-
const u_char *opt, u_int opt_len, u_char flags _U_)
499+
const u_char *opt, u_int opt_len, uint16_t flags _U_)
500500
{
501501
const struct mp_tcprst *mpr = (const struct mp_tcprst *)opt;
502502

@@ -513,7 +513,7 @@ mp_tcprst_print(netdissect_options *ndo,
513513

514514
static const struct {
515515
const char *name;
516-
int (*print)(netdissect_options *, const u_char *, u_int, u_char);
516+
int (*print)(netdissect_options *, const u_char *, u_int, uint16_t);
517517
} mptcp_options[] = {
518518
{ "capable", mp_capable_print },
519519
{ "join", mp_join_print },
@@ -529,7 +529,7 @@ static const struct {
529529

530530
int
531531
mptcp_print(netdissect_options *ndo,
532-
const u_char *cp, u_int len, u_char flags)
532+
const u_char *cp, u_int len, uint16_t flags)
533533
{
534534
const struct mptcp_option *opt;
535535
u_int subtype;

0 commit comments

Comments
 (0)