1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
https://github.com/pstavirs/ostinato/issues/265#issuecomment-429008063
diff --git a/common/mld.cpp b/common/mld.cpp
index 52b48a5..fbb22f5 100644
--- a/common/mld.cpp
+++ b/common/mld.cpp
@@ -225,9 +225,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
fv.resize(16);
for (int i = 0; i < data.sources_size(); i++)
{
- qToBigEndian(data.sources(i).v6_hi(),
+ qToBigEndian(quint64(data.sources(i).v6_hi()),
(uchar*)fv.data());
- qToBigEndian(data.sources(i).v6_lo(),
+ qToBigEndian(quint64(data.sources(i).v6_lo()),
(uchar*)fv.data()+8);
list << QHostAddress((quint8*)fv.constData()).toString();
@@ -240,9 +240,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
fv.resize(16 * data.sources_size());
for (int i = 0; i < data.sources_size(); i++)
{
- qToBigEndian(data.sources(i).v6_hi(),
+ qToBigEndian(quint64(data.sources(i).v6_hi()),
(uchar*)(fv.data() + i*16));
- qToBigEndian(data.sources(i).v6_lo(),
+ qToBigEndian(quint64(data.sources(i).v6_lo()),
(uchar*)(fv.data() + i*16 + 8));
}
return fv;
@@ -254,9 +254,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
fv.resize(16);
for (int i = 0; i < data.sources_size(); i++)
{
- qToBigEndian(data.sources(i).v6_hi(),
+ qToBigEndian(quint64(data.sources(i).v6_hi()),
(uchar*)fv.data());
- qToBigEndian(data.sources(i).v6_lo(),
+ qToBigEndian(quint64(data.sources(i).v6_lo()),
(uchar*)fv.data()+8);
list << QHostAddress((quint8*)fv.constData()).toString();
@@ -295,9 +295,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
QStringList sl;
for (int j = 0; j < rec.sources_size(); j++)
{
- qToBigEndian(rec.sources(j).v6_hi(),
+ qToBigEndian(quint64(rec.sources(j).v6_hi()),
(uchar*)(ip.data()));
- qToBigEndian(rec.sources(j).v6_lo(),
+ qToBigEndian(quint64(rec.sources(j).v6_lo()),
(uchar*)(ip.data() + 8));
sl.append(QHostAddress(
(quint8*)ip.constData()).toString());
@@ -322,15 +322,15 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
QByteArray rv = list.at(i).toByteArray();
rv.insert(4, QByteArray(16+16*rec.sources_size(), char(0)));
- qToBigEndian(rec.group_address().v6_hi(),
+ qToBigEndian(quint64(rec.group_address().v6_hi()),
(uchar*)(rv.data()+4));
- qToBigEndian(rec.group_address().v6_lo(),
+ qToBigEndian(quint64(rec.group_address().v6_lo()),
(uchar*)(rv.data()+4+8));
for (int j = 0; j < rec.sources_size(); j++)
{
- qToBigEndian(rec.sources(j).v6_hi(),
+ qToBigEndian(quint64(rec.sources(j).v6_hi()),
(uchar*)(rv.data()+20+16*j));
- qToBigEndian(rec.sources(j).v6_lo(),
+ qToBigEndian(quint64(rec.sources(j).v6_lo()),
(uchar*)(rv.data()+20+16*j+8));
}
@@ -352,9 +352,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
QString recStr = list.at(i);
QString str;
- qToBigEndian(rec.group_address().v6_hi(),
+ qToBigEndian(quint64(rec.group_address().v6_hi()),
(uchar*)(ip.data()));
- qToBigEndian(rec.group_address().v6_lo(),
+ qToBigEndian(quint64(rec.group_address().v6_lo()),
(uchar*)(ip.data() + 8));
str.append(QString("Group: %1").arg(
QHostAddress((quint8*)ip.constData()).toString()));
@@ -363,9 +363,9 @@ QVariant MldProtocol::fieldData(int index, FieldAttrib attrib,
QStringList sl;
for (int j = 0; j < rec.sources_size(); j++)
{
- qToBigEndian(rec.sources(j).v6_hi(),
+ qToBigEndian(quint64(rec.sources(j).v6_hi()),
(uchar*)(ip.data()));
- qToBigEndian(rec.sources(j).v6_lo(),
+ qToBigEndian(quint64(rec.sources(j).v6_lo()),
(uchar*)(ip.data() + 8));
sl.append(QHostAddress(
(quint8*)ip.constData()).toString());
|