Skip to content

Commit e18b6b8

Browse files
wenyingdhongliangl
authored andcommitted
Bump up golangci-bin version
1. Bump up golangci-bin version to v1.50.0 2. Remove invalid configurations in golangci.yml 3. Formated several files Signed-off-by: wenyingd <wenyingd@vmware.com>
1 parent 2ade3b2 commit e18b6b8

8 files changed

Lines changed: 242 additions & 235 deletions

File tree

.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ linters:
1919
- goimports
2020
- gosec
2121
- misspell
22-
23-
run:
24-
deadline: 5m

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test:
99
# code linting
1010
.golangci-bin:
1111
@echo "===> Installing Golangci-lint <==="
12-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $@ v1.41.1
12+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $@ v1.50.0
1313

1414
.PHONY: golangci
1515
golangci: .golangci-bin

openflow13/match.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (m *MatchField) MarshalBinary() (data []byte, err error) {
127127
if m.HasMask {
128128
fld = (m.Field << 1) | 0x1
129129
} else {
130-
fld = (m.Field << 1) | 0x0
130+
fld = m.Field << 1
131131
}
132132
data[n] = fld
133133
n += 1
@@ -477,7 +477,7 @@ func DecodeMatchField(class uint16, field uint8, length uint8, hasMask bool, dat
477477
return nil, nil
478478
}
479479

480-
// ofp_match_type 1.3
480+
// ofp_match_type 1.3
481481
const (
482482
MatchType_Standard = iota /* Deprecated. */
483483
MatchType_OXM

openflow15/match.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (m *MatchField) MarshalBinary() (data []byte, err error) {
130130
if m.HasMask {
131131
fld = (m.Field << 1) | 0x1
132132
} else {
133-
fld = (m.Field << 1) | 0x0
133+
fld = m.Field << 1
134134
}
135135
data[n] = fld
136136
n += 1
@@ -276,7 +276,7 @@ func (o *OxmId) MarshalBinary() (data []byte, err error) {
276276
if o.HasMask {
277277
fld = (o.Field << 1) | 0x1
278278
} else {
279-
fld = (o.Field << 1) | 0x0
279+
fld = o.Field << 1
280280
}
281281
data[n] = fld
282282
n += 1

openflow15/openflow15.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ const (
827827
ACFC_EPERM
828828
)
829829

830-
// ofp_flow_monitor_failed_code
830+
// ofp_flow_monitor_failed_code
831831
const (
832832
MOFC_UNKNOWN = iota
833833
MOFC_MONITOR_EXISTS

protocol/dhcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const (
7777
const (
7878
DHCP_FLAG_BROADCAST uint16 = 0x80
7979

80-
// FLAG_BROADCAST_MASK uint16 = (1 << FLAG_BROADCAST)
80+
// FLAG_BROADCAST_MASK uint16 = (1 << FLAG_BROADCAST)
8181
)
8282

8383
func getRandomXID() (uint32, error) {

protocol/icmpv6.go

Lines changed: 146 additions & 141 deletions
Large diffs are not rendered by default.

protocol/igmp.go

Lines changed: 89 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ type IGMPMessage interface {
2727
}
2828

2929
// IGMPv1:
30-
// 0 1 2 3
31-
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
32-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33-
// |Version| Type | Unused | Checksum |
34-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35-
// | Group Address |
36-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
30+
//
31+
// 0 1 2 3
32+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
33+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34+
// |Version| Type | Unused | Checksum |
35+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36+
// | Group Address |
37+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3738
//
3839
// IGMPv2:
39-
// 0 1 2 3
40-
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
41-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42-
// | Type | Max Resp Time | Checksum |
43-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44-
// | Group Address |
45-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40+
//
41+
// 0 1 2 3
42+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
43+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44+
// | Type | Max Resp Time | Checksum |
45+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46+
// | Group Address |
47+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
4648
type IGMPv1or2 struct {
4749
Type uint8
4850
MaxResponseTime uint8 // It is 0 for IGMPv1 message.
@@ -113,24 +115,25 @@ func NewIGMPv2Leave(group net.IP) *IGMPv1or2 {
113115
}
114116

115117
// IGMPv3Query:
116-
// 0 1 2 3
117-
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
118-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
119-
// | Type = 0x11 | Max Resp Code | Checksum |
120-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
121-
// | Group Address |
122-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
123-
// | Resv |S| QRV | QQIC | Number of Sources (N) |
124-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
125-
// | Source Address [1] |
126-
// +- -+
127-
// | Source Address [2] |
128-
// +- . -+
129-
// . . .
130-
// . . .
131-
// +- -+
132-
// | Source Address [N] |
133-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
118+
//
119+
// 0 1 2 3
120+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
121+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
122+
// | Type = 0x11 | Max Resp Code | Checksum |
123+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
124+
// | Group Address |
125+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
126+
// | Resv |S| QRV | QQIC | Number of Sources (N) |
127+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
128+
// | Source Address [1] |
129+
// +- -+
130+
// | Source Address [2] |
131+
// +- . -+
132+
// . . .
133+
// . . .
134+
// +- -+
135+
// | Source Address [N] |
136+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
134137
type IGMPv3Query struct {
135138
Type uint8
136139
MaxResponseTime uint8
@@ -222,29 +225,30 @@ func NewIGMPv3Query(group net.IP, maxResponseTime uint8, queryInterval uint8, so
222225
}
223226

224227
// IGMPv3GroupRecord:
225-
// 0 1 2 3
226-
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
227-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
228-
// | Record Type | Aux Data Len | Number of Sources (N) |
229-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
230-
// | Multicast Address |
231-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
232-
// | Source Address [1] |
233-
// +- -+
234-
// | Source Address [2] |
235-
// +- -+
236-
// . . .
237-
// . . .
238-
// . . .
239-
// +- -+
240-
// | Source Address [N] |
241-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
242-
// | |
243-
// . .
244-
// . Auxiliary Data .
245-
// . .
246-
// | |
247-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
228+
//
229+
// 0 1 2 3
230+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
231+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
232+
// | Record Type | Aux Data Len | Number of Sources (N) |
233+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
234+
// | Multicast Address |
235+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
236+
// | Source Address [1] |
237+
// +- -+
238+
// | Source Address [2] |
239+
// +- -+
240+
// . . .
241+
// . . .
242+
// . . .
243+
// +- -+
244+
// | Source Address [N] |
245+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
246+
// | |
247+
// . .
248+
// . Auxiliary Data .
249+
// . .
250+
// | |
251+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
248252
type IGMPv3GroupRecord struct {
249253
Type uint8
250254
AuxDataLen uint8 // this should always be 0 as per IGMPv3 spec.
@@ -317,35 +321,36 @@ func NewGroupRecord(recordType uint8, group net.IP, sources []net.IP) IGMPv3Grou
317321
}
318322

319323
// IGMPv3MembershipReport:
320-
// 0 1 2 3
321-
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
322-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
323-
// | Type = 0x22 | Reserved | Checksum |
324-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
325-
// | Reserved | Number of Group Records (M) |
326-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
327-
// | |
328-
// . .
329-
// . Group Record [1] .
330-
// . .
331-
// | |
332-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
333-
// | |
334-
// . .
335-
// . Group Record [2] .
336-
// . .
337-
// | |
338-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
339-
// | . |
340-
// . . .
341-
// | . |
342-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
343-
// | |
344-
// . .
345-
// . Group Record [M] .
346-
// . .
347-
// | |
348-
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
324+
//
325+
// 0 1 2 3
326+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
327+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
328+
// | Type = 0x22 | Reserved | Checksum |
329+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
330+
// | Reserved | Number of Group Records (M) |
331+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
332+
// | |
333+
// . .
334+
// . Group Record [1] .
335+
// . .
336+
// | |
337+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
338+
// | |
339+
// . .
340+
// . Group Record [2] .
341+
// . .
342+
// | |
343+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
344+
// | . |
345+
// . . .
346+
// | . |
347+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
348+
// | |
349+
// . .
350+
// . Group Record [M] .
351+
// . .
352+
// | |
353+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
349354
type IGMPv3MembershipReport struct {
350355
Type uint8
351356
Reserved uint8

0 commit comments

Comments
 (0)