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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
|
From e3bf09403c668462a062c9c7ec4a428540cc969a Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 16 Jun 2019 12:21:05 -0700
Subject: [PATCH] Don't use empty initializer lists
---
bridge/mdb.c | 2 +-
bridge/vlan.c | 4 +-
devlink/devlink.c | 94 +++++++++++++++++++++++------------------------
devlink/mnlg.c | 6 +--
ip/ip6tunnel.c | 2 +-
ip/ipaddress.c | 8 ++--
ip/ipaddrlabel.c | 2 +-
ip/ipl2tp.c | 2 +-
ip/iplink.c | 2 +-
ip/iplink_can.c | 2 +-
ip/ipmacsec.c | 2 +-
ip/ipmaddr.c | 2 +-
ip/ipntable.c | 4 +-
ip/iptunnel.c | 10 ++---
ip/iptuntap.c | 2 +-
ip/ipxfrm.c | 14 +++----
ip/xfrm_policy.c | 12 +++---
ip/xfrm_state.c | 12 +++---
lib/bpf.c | 42 ++++++++++-----------
lib/libnetlink.c | 4 +-
lib/ll_map.c | 2 +-
misc/arpd.c | 4 +-
misc/ss.c | 38 +++++++++----------
rdma/dev.c | 2 +-
rdma/link.c | 2 +-
rdma/rdma.c | 2 +-
rdma/res-cmid.c | 6 +--
rdma/res-cq.c | 6 +--
rdma/res-mr.c | 6 +--
rdma/res-pd.c | 6 +--
rdma/res-qp.c | 6 +--
rdma/res.c | 4 +-
rdma/utils.c | 2 +-
tc/e_bpf.c | 4 +-
tc/em_cmp.c | 2 +-
tc/em_ipset.c | 2 +-
tc/em_meta.c | 2 +-
tc/em_nbyte.c | 2 +-
tc/em_u32.c | 2 +-
tc/f_bpf.c | 2 +-
tc/f_fw.c | 2 +-
tc/f_rsvp.c | 2 +-
tc/f_u32.c | 6 +--
tc/m_bpf.c | 4 +-
tc/m_connmark.c | 2 +-
tc/m_csum.c | 2 +-
tc/m_mirred.c | 4 +-
tc/m_nat.c | 2 +-
tc/m_pedit.c | 4 +-
tc/m_simple.c | 2 +-
tc/m_tunnel_key.c | 2 +-
tc/m_vlan.c | 2 +-
tc/m_xt.c | 2 +-
tc/q_atm.c | 2 +-
tc/q_cbq.c | 12 +++---
tc/q_cbs.c | 2 +-
tc/q_choke.c | 2 +-
tc/q_codel.c | 2 +-
tc/q_fifo.c | 2 +-
tc/q_fq_codel.c | 2 +-
tc/q_gred.c | 6 +--
tc/q_hfsc.c | 4 +-
tc/q_htb.c | 2 +-
tc/q_multiq.c | 2 +-
tc/q_netem.c | 12 +++---
tc/q_red.c | 2 +-
tc/q_sfq.c | 2 +-
tc/q_skbprio.c | 2 +-
tc/q_tbf.c | 2 +-
tc/tc_class.c | 18 ++++-----
tc/tc_exec.c | 2 +-
tc/tc_filter.c | 12 +++---
tc/tc_qdisc.c | 10 ++---
tc/tc_stab.c | 2 +-
tc/tc_util.c | 6 +--
tipc/bearer.c | 22 +++++------
tipc/link.c | 34 ++++++++---------
tipc/media.c | 10 ++---
tipc/misc.c | 2 +-
tipc/msg.c | 2 +-
tipc/nametable.c | 6 +--
tipc/node.c | 14 +++----
tipc/socket.c | 10 ++---
83 files changed, 287 insertions(+), 287 deletions(-)
diff --git a/bridge/mdb.c b/bridge/mdb.c
index 1f2cebd8..124fef49 100644
--- a/bridge/mdb.c
+++ b/bridge/mdb.c
@@ -377,7 +377,7 @@ static int mdb_modify(int cmd, int flags, int argc, char **argv)
.n.nlmsg_type = cmd,
.bpm.family = PF_BRIDGE,
};
- struct br_mdb_entry entry = {};
+ struct br_mdb_entry entry = {0};
char *d = NULL, *p = NULL, *grp = NULL;
short vid = 0;
diff --git a/bridge/vlan.c b/bridge/vlan.c
index cc1c34cf..231f8543 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -107,7 +107,7 @@ static int add_tunnel_info_range(struct nlmsghdr *n, int reqsize,
static int add_vlan_info_range(struct nlmsghdr *n, int reqsize, __u16 vid_start,
int16_t vid_end, __u16 flags)
{
- struct bridge_vlan_info vinfo = {};
+ struct bridge_vlan_info vinfo = {0};
vinfo.flags = flags;
vinfo.vid = vid_start;
@@ -146,7 +146,7 @@ static int vlan_modify(int cmd, int argc, char **argv)
short vid = -1;
short vid_end = -1;
struct rtattr *afspec;
- struct bridge_vlan_info vinfo = {};
+ struct bridge_vlan_info vinfo = {0};
bool tunnel_info_set = false;
unsigned short flags = 0;
__u32 tun_id_start = 0;
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 0982faef..5de5b068 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -596,7 +596,7 @@ static int attr_stats_cb(const struct nlattr *attr, void *data)
static int ifname_map_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
struct dl *dl = data;
struct ifname_map *ifname_map;
@@ -2227,7 +2227,7 @@ static void pr_out_eswitch(struct dl *dl, struct nlattr **tb)
static int cmd_dev_eswitch_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -2395,7 +2395,7 @@ static const struct param_val_conv param_val_conv[] = {
static void pr_out_param_value(struct dl *dl, const char *nla_name,
int nla_type, struct nlattr *nl)
{
- struct nlattr *nla_value[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_value[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *val_attr;
const char *vstr;
bool conv_exists;
@@ -2477,7 +2477,7 @@ static void pr_out_param_value(struct dl *dl, const char *nla_name,
static void pr_out_param(struct dl *dl, struct nlattr **tb, bool array)
{
- struct nlattr *nla_param[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_param[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *param_value_attr;
const char *nla_name;
int nla_type;
@@ -2520,7 +2520,7 @@ static void pr_out_param(struct dl *dl, struct nlattr **tb, bool array)
static int cmd_dev_param_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct dl *dl = data;
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -2546,8 +2546,8 @@ struct param_ctx {
static int cmd_dev_param_set_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *nla_param[DEVLINK_ATTR_MAX + 1] = {};
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_param[DEVLINK_ATTR_MAX + 1] = {0};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *param_value_attr;
enum devlink_param_cmode cmode;
struct param_ctx *ctx = data;
@@ -2571,7 +2571,7 @@ static int cmd_dev_param_set_cb(const struct nlmsghdr *nlh, void *data)
nla_type = mnl_attr_get_u8(nla_param[DEVLINK_ATTR_PARAM_TYPE]);
mnl_attr_for_each_nested(param_value_attr,
nla_param[DEVLINK_ATTR_PARAM_VALUES_LIST]) {
- struct nlattr *nla_value[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_value[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *val_attr;
err = mnl_attr_parse_nested(param_value_attr,
@@ -2613,7 +2613,7 @@ static int cmd_dev_param_set_cb(const struct nlmsghdr *nlh, void *data)
static int cmd_dev_param_set(struct dl *dl)
{
- struct param_ctx ctx = {};
+ struct param_ctx ctx = {0};
struct nlmsghdr *nlh;
bool conv_exists;
uint32_t val_u32;
@@ -2768,7 +2768,7 @@ static int cmd_dev_param(struct dl *dl)
static int cmd_dev_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
uint8_t reload_failed = 0;
@@ -2840,7 +2840,7 @@ static void pr_out_versions_single(struct dl *dl, const struct nlmsghdr *nlh,
struct nlattr *version;
mnl_attr_for_each(version, nlh, sizeof(struct genlmsghdr)) {
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
const char *ver_value;
const char *ver_name;
int err;
@@ -2920,7 +2920,7 @@ static void pr_out_info(struct dl *dl, const struct nlmsghdr *nlh,
static int cmd_versions_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
bool has_versions, has_info;
struct dl *dl = data;
@@ -3316,7 +3316,7 @@ static void pr_out_port(struct dl *dl, struct nlattr **tb)
static int cmd_port_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -3460,7 +3460,7 @@ static void pr_out_sb(struct dl *dl, struct nlattr **tb)
static int cmd_sb_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -3539,7 +3539,7 @@ static void pr_out_sb_pool(struct dl *dl, struct nlattr **tb)
static int cmd_sb_pool_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -3625,7 +3625,7 @@ static void pr_out_sb_port_pool(struct dl *dl, struct nlattr **tb)
static int cmd_sb_port_pool_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -3728,7 +3728,7 @@ static void pr_out_sb_tc_bind(struct dl *dl, struct nlattr **tb)
static int cmd_sb_tc_bind_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -4016,7 +4016,7 @@ static void cmd_sb_occ_port_pool_process(struct occ_show *occ_show,
static int cmd_sb_occ_port_pool_process_cb(const struct nlmsghdr *nlh, void *data)
{
struct occ_show *occ_show = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -4067,7 +4067,7 @@ static void cmd_sb_occ_tc_pool_process(struct occ_show *occ_show,
static int cmd_sb_occ_tc_pool_process_cb(const struct nlmsghdr *nlh, void *data)
{
struct occ_show *occ_show = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -4353,7 +4353,7 @@ static void pr_out_trap_policer(struct dl *dl, struct nlattr **tb, bool array);
static int cmd_mon_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dl *dl = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
uint8_t cmd = genl->cmd;
@@ -4880,7 +4880,7 @@ static void pr_out_dpipe_headers(struct dpipe_ctx *ctx,
static int dpipe_header_field_get(struct nlattr *nl, struct dpipe_field *field)
{
- struct nlattr *nla_field[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_field[DEVLINK_ATTR_MAX + 1] = {0};
const char *name;
int err;
@@ -4931,7 +4931,7 @@ static unsigned int dpipe_header_field_count_get(struct nlattr *nla_fields)
static int dpipe_header_get(struct dpipe_ctx *ctx, struct nlattr *nl)
{
- struct nlattr *nla_header[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_header[DEVLINK_ATTR_MAX + 1] = {0};
struct dpipe_header *header;
unsigned int fields_count;
const char *header_name;
@@ -4987,7 +4987,7 @@ static int dpipe_headers_get(struct dpipe_ctx *ctx, struct nlattr **tb)
static int cmd_dpipe_header_cb(const struct nlmsghdr *nlh, void *data)
{
struct dpipe_ctx *ctx = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
int err;
@@ -5009,7 +5009,7 @@ static int cmd_dpipe_header_cb(const struct nlmsghdr *nlh, void *data)
static int cmd_dpipe_headers_show(struct dl *dl)
{
struct nlmsghdr *nlh;
- struct dpipe_ctx ctx = {};
+ struct dpipe_ctx ctx = {0};
uint16_t flags = NLM_F_REQUEST | NLM_F_ACK;
int err;
@@ -5104,7 +5104,7 @@ static void pr_out_dpipe_action(struct dpipe_action *action,
static int dpipe_action_parse(struct dpipe_action *action, struct nlattr *nl)
{
- struct nlattr *nla_action[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_action[DEVLINK_ATTR_MAX + 1] = {0};
int err;
err = mnl_attr_parse_nested(nl, attr_cb, nla_action);
@@ -5189,7 +5189,7 @@ static int dpipe_match_parse(struct dpipe_match *match,
struct nlattr *nl)
{
- struct nlattr *nla_match[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_match[DEVLINK_ATTR_MAX + 1] = {0};
int err;
err = mnl_attr_parse_nested(nl, attr_cb, nla_match);
@@ -5294,7 +5294,7 @@ resource_path_print(struct dl *dl, struct resources *resources,
static int dpipe_table_show(struct dpipe_ctx *ctx, struct nlattr *nl)
{
- struct nlattr *nla_table[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_table[DEVLINK_ATTR_MAX + 1] = {0};
struct dpipe_table *table;
uint32_t resource_units;
bool counters_enabled;
@@ -5388,7 +5388,7 @@ err_table_show:
static int cmd_dpipe_table_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct dpipe_ctx *ctx = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -5406,8 +5406,8 @@ static int cmd_resource_dump_cb(const struct nlmsghdr *nlh, void *data);
static int cmd_dpipe_table_show(struct dl *dl)
{
struct nlmsghdr *nlh;
- struct dpipe_ctx dpipe_ctx = {};
- struct resource_ctx resource_ctx = {};
+ struct dpipe_ctx dpipe_ctx = {0};
+ struct resource_ctx resource_ctx = {0};
uint16_t flags = NLM_F_REQUEST;
int err;
@@ -5664,7 +5664,7 @@ static void pr_out_dpipe_entry_value(struct dpipe_ctx *ctx,
static int dpipe_entry_match_value_show(struct dpipe_ctx *ctx,
struct nlattr *nl)
{
- struct nlattr *nla_match_value[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_match_value[DEVLINK_ATTR_MAX + 1] = {0};
struct dpipe_match match;
int err;
@@ -5695,7 +5695,7 @@ err_match_parse:
static int dpipe_entry_action_value_show(struct dpipe_ctx *ctx,
struct nlattr *nl)
{
- struct nlattr *nla_action_value[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_action_value[DEVLINK_ATTR_MAX + 1] = {0};
struct dpipe_action action;
int err;
@@ -5751,7 +5751,7 @@ dpipe_tables_match_values_show(struct dpipe_ctx *ctx,
static int dpipe_entry_show(struct dpipe_ctx *ctx, struct nlattr *nl)
{
- struct nlattr *nla_entry[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_entry[DEVLINK_ATTR_MAX + 1] = {0};
uint32_t entry_index;
uint64_t counter;
int err;
@@ -5815,7 +5815,7 @@ err_entry_show:
static int cmd_dpipe_table_entry_dump_cb(const struct nlmsghdr *nlh, void *data)
{
struct dpipe_ctx *ctx = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -5831,7 +5831,7 @@ static int cmd_dpipe_table_entry_dump_cb(const struct nlmsghdr *nlh, void *data)
static int cmd_dpipe_table_dump(struct dl *dl)
{
struct nlmsghdr *nlh;
- struct dpipe_ctx ctx = {};
+ struct dpipe_ctx ctx = {0};
uint16_t flags = NLM_F_REQUEST;
int err;
@@ -5940,7 +5940,7 @@ static int
resource_get(struct resource_ctx *ctx, struct resource *resource,
struct resource *parent_resource, struct nlattr *nl)
{
- struct nlattr *nla_resource[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *nla_resource[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *nla_child_resource;
struct nlattr *nla_resources;
bool top = false;
@@ -6088,7 +6088,7 @@ static int resources_get(struct resource_ctx *ctx, struct nlattr **tb)
static int cmd_resource_dump_cb(const struct nlmsghdr *nlh, void *data)
{
struct resource_ctx *ctx = data;
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
int err;
@@ -6112,8 +6112,8 @@ static int cmd_resource_dump_cb(const struct nlmsghdr *nlh, void *data)
static int cmd_resource_show(struct dl *dl)
{
struct nlmsghdr *nlh;
- struct dpipe_ctx dpipe_ctx = {};
- struct resource_ctx resource_ctx = {};
+ struct dpipe_ctx dpipe_ctx = {0};
+ struct resource_ctx resource_ctx = {0};
int err;
err = dl_argv_parse(dl, DL_OPT_HANDLE, 0);
@@ -6208,7 +6208,7 @@ err_resource_lookup:
static int cmd_resource_set(struct dl *dl)
{
struct nlmsghdr *nlh;
- struct resource_ctx ctx = {};
+ struct resource_ctx ctx = {0};
int err;
err = resource_ctx_init(&ctx, dl);
@@ -6320,7 +6320,7 @@ static void pr_out_region_snapshots_id(struct dl *dl, struct nlattr **tb, int in
static void pr_out_snapshots(struct dl *dl, struct nlattr **tb)
{
- struct nlattr *tb_snapshot[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb_snapshot[DEVLINK_ATTR_MAX + 1] = {0};
struct nlattr *nla_sanpshot;
int err, index = 0;
@@ -6361,7 +6361,7 @@ static void pr_out_region(struct dl *dl, struct nlattr **tb)
static int cmd_region_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct dl *dl = data;
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
@@ -6417,8 +6417,8 @@ static int cmd_region_read_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *nla_entry, *nla_chunk_data, *nla_chunk_addr;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb_field[DEVLINK_ATTR_MAX + 1] = {};
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb_field[DEVLINK_ATTR_MAX + 1] = {0};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct dl *dl = data;
int err;
@@ -6764,7 +6764,7 @@ static int cmd_fmsg_nest(struct fmsg_cb_data *fmsg_data, uint8_t nest_value,
static int cmd_fmsg_object_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct fmsg_cb_data *fmsg_data = data;
struct dl *dl = fmsg_data->dl;
struct nlattr *nla_object;
@@ -6945,7 +6945,7 @@ static void pr_out_dump_report_timestamp(struct dl *dl, const struct nlattr *att
static void pr_out_health(struct dl *dl, struct nlattr **tb_health)
{
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
enum devlink_health_reporter_state state;
int err;
@@ -6997,7 +6997,7 @@ static void pr_out_health(struct dl *dl, struct nlattr **tb_health)
static int cmd_health_show_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {};
+ struct nlattr *tb[DEVLINK_ATTR_MAX + 1] = {0};
struct dl *dl = data;
mnl_attr_parse(nlh, sizeof(*genl), attr_cb, tb);
diff --git a/devlink/mnlg.c b/devlink/mnlg.c
index c7d25e87..baeda3d8 100644
--- a/devlink/mnlg.c
+++ b/devlink/mnlg.c
@@ -154,7 +154,7 @@ static void parse_genl_mc_grps(struct nlattr *nested,
const char *name;
mnl_attr_for_each_nested(pos, nested) {
- struct nlattr *tb[CTRL_ATTR_MCAST_GRP_MAX + 1] = {};
+ struct nlattr *tb[CTRL_ATTR_MCAST_GRP_MAX + 1] = {0};
mnl_attr_parse_nested(pos, parse_mc_grps_cb, tb);
if (!tb[CTRL_ATTR_MCAST_GRP_NAME] ||
@@ -188,7 +188,7 @@ static int get_group_id_attr_cb(const struct nlattr *attr, void *data)
static int get_group_id_cb(const struct nlmsghdr *nlh, void *data)
{
struct group_info *group_info = data;
- struct nlattr *tb[CTRL_ATTR_MAX + 1] = {};
+ struct nlattr *tb[CTRL_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), get_group_id_attr_cb, tb);
@@ -249,7 +249,7 @@ static int get_family_id_attr_cb(const struct nlattr *attr, void *data)
static int get_family_id_cb(const struct nlmsghdr *nlh, void *data)
{
uint32_t *p_id = data;
- struct nlattr *tb[CTRL_ATTR_MAX + 1] = {};
+ struct nlattr *tb[CTRL_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
mnl_attr_parse(nlh, sizeof(*genl), get_family_id_attr_cb, tb);
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index c712d664..318e54b1 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -286,7 +286,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
if (get_ifname(p->name, *argv))
invarg("\"name\" not a valid ifname", *argv);
if (cmd == SIOCCHGTUNNEL && count == 0) {
- struct ip6_tnl_parm2 old_p = {};
+ struct ip6_tnl_parm2 old_p = {0};
if (tnl_get_ioctl(*argv, &old_p))
return -1;
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index ccf67d1d..f1dea4de 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -167,7 +167,7 @@ static void print_queuelen(FILE *f, struct rtattr *tb[IFLA_MAX + 1])
if (tb[IFLA_TXQLEN])
qlen = rta_getattr_u32(tb[IFLA_TXQLEN]);
else {
- struct ifreq ifr = {};
+ struct ifreq ifr = {0};
int s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
@@ -355,7 +355,7 @@ static void print_vfinfo(FILE *fp, struct ifinfomsg *ifi, struct rtattr *vfinfo)
struct ifla_vf_mac *vf_mac;
struct ifla_vf_broadcast *vf_broadcast;
struct ifla_vf_tx_rate *vf_tx_rate;
- struct rtattr *vf[IFLA_VF_MAX + 1] = {};
+ struct rtattr *vf[IFLA_VF_MAX + 1] = {0};
SPRINT_BUF(b1);
@@ -2248,7 +2248,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
char *lcl_arg = NULL;
char *valid_lftp = NULL;
char *preferred_lftp = NULL;
- inet_prefix lcl = {};
+ inet_prefix lcl = {0};
inet_prefix peer;
int local_len = 0;
int peer_len = 0;
@@ -2423,7 +2423,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
return nodev(d);
if (valid_lftp || preferred_lftp) {
- struct ifa_cacheinfo cinfo = {};
+ struct ifa_cacheinfo cinfo = {0};
if (!valid_lft) {
fprintf(stderr, "valid_lft is zero\n");
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index beb08da3..c8a14940 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -148,7 +148,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
.ifal.ifal_family = preferred_family,
};
- inet_prefix prefix = {};
+ inet_prefix prefix = {0};
uint32_t label = 0xffffffffUL;
char *p = NULL;
char *l = NULL;
diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index f090390f..edbe0f2f 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -345,7 +345,7 @@ static int get_response(struct nlmsghdr *n, void *arg)
if (len < 0)
return -1;
- parse_rtattr(attrs, L2TP_ATTR_MAX, (void *)ghdr + GENL_HDRLEN, len);
+ parse_rtattr(attrs, L2TP_ATTR_MAX, (struct rtattr *)((char *)ghdr + GENL_HDRLEN), len);
if (attrs[L2TP_ATTR_PW_TYPE])
p->pw_type = rta_getattr_u16(attrs[L2TP_ATTR_PW_TYPE]);
diff --git a/ip/iplink.c b/ip/iplink.c
index 7d4b244d..f0a9c57b 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1233,7 +1233,7 @@ static int set_mtu(const char *dev, int mtu)
static int get_address(const char *dev, int *htype)
{
- struct ifreq ifr = {};
+ struct ifreq ifr = {0};
struct sockaddr_ll me = {
.sll_family = AF_PACKET,
.sll_protocol = htons(ETH_P_LOOP),
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index 735ab941..82060bf4 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -112,7 +112,7 @@ static void print_ctrlmode(FILE *f, __u32 cm)
static int can_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
- struct can_bittiming bt = {}, dbt = {};
+ struct can_bittiming bt = {0}, dbt = {0};
struct can_ctrlmode cm = {0, 0};
while (argc > 0) {
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
index 18289ecd..1349e54e 100644
--- a/ip/ipmacsec.c
+++ b/ip/ipmacsec.c
@@ -1023,7 +1023,7 @@ static int process(struct nlmsghdr *n, void *arg)
if (ghdr->cmd != MACSEC_CMD_GET_TXSC)
return 0;
- parse_rtattr(attrs, MACSEC_ATTR_MAX, (void *) ghdr + GENL_HDRLEN, len);
+ parse_rtattr(attrs, MACSEC_ATTR_MAX, (struct rtattr *)((char *)ghdr + GENL_HDRLEN), len);
if (!validate_dump(attrs)) {
fprintf(stderr, "incomplete dump message\n");
return -1;
diff --git a/ip/ipmaddr.c b/ip/ipmaddr.c
index 02e923bf..44699b9e 100644
--- a/ip/ipmaddr.c
+++ b/ip/ipmaddr.c
@@ -289,7 +289,7 @@ static int multiaddr_list(int argc, char **argv)
static int multiaddr_modify(int cmd, int argc, char **argv)
{
- struct ifreq ifr = {};
+ struct ifreq ifr = {0};
int family;
int fd;
diff --git a/ip/ipntable.c b/ip/ipntable.c
index ddee4905..a56c71e5 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -76,7 +76,7 @@ static int ipntable_modify(int cmd, int flags, int argc, char **argv)
char *namep = NULL;
char *threshsp = NULL;
char *gc_intp = NULL;
- char parms_buf[1024] = {};
+ char parms_buf[1024] = {0};
struct rtattr *parms_rta = (struct rtattr *)parms_buf;
int parms_change = 0;
@@ -312,7 +312,7 @@ static int ipntable_modify(int cmd, int flags, int argc, char **argv)
static const char *ntable_strtime_delta(__u32 msec)
{
static char str[32];
- struct timeval now = {};
+ struct timeval now = {0};
time_t t;
struct tm *tp;
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 696f3b92..92b86c17 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -176,7 +176,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
if (get_ifname(p->name, *argv))
invarg("\"name\" not a valid ifname", *argv);
if (cmd == SIOCCHGTUNNEL && count == 0) {
- struct ip_tunnel_parm old_p = {};
+ struct ip_tunnel_parm old_p = {0};
if (tnl_get_ioctl(*argv, &old_p))
return -1;
@@ -288,7 +288,7 @@ static int do_del(int argc, char **argv)
static void print_tunnel(const void *t)
{
const struct ip_tunnel_parm *p = t;
- struct ip_tunnel_6rd ip6rd = {};
+ struct ip_tunnel_6rd ip6rd = {0};
SPRINT_BUF(b1);
/* Do not use format_host() for local addr,
@@ -310,7 +310,7 @@ static void print_tunnel(const void *t)
: "any");
if (p->iph.protocol == IPPROTO_IPV6 && (p->i_flags & SIT_ISATAP)) {
- struct ip_tunnel_prl prl[16] = {};
+ struct ip_tunnel_prl prl[16] = {0};
int i;
prl[0].datalen = sizeof(prl) - sizeof(prl[0]);
@@ -433,7 +433,7 @@ static int do_show(int argc, char **argv)
static int do_prl(int argc, char **argv)
{
- struct ip_tunnel_prl p = {};
+ struct ip_tunnel_prl p = {0};
int count = 0;
int cmd = 0;
const char *medium = NULL;
@@ -482,7 +482,7 @@ static int do_prl(int argc, char **argv)
static int do_6rd(int argc, char **argv)
{
- struct ip_tunnel_6rd ip6rd = {};
+ struct ip_tunnel_6rd ip6rd = {0};
int cmd = 0;
const char *medium = NULL;
inet_prefix prefix;
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index 91d3512b..f1bf0b18 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -290,7 +290,7 @@ static char *pid_name(pid_t pid)
static void show_processes(const char *name)
{
- glob_t globbuf = { };
+ glob_t globbuf = {0};
char **fd_path;
int err;
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 92afb7f8..4043a07c 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -907,7 +907,7 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family,
static int xfrm_selector_iszero(struct xfrm_selector *s)
{
- struct xfrm_selector s0 = {};
+ struct xfrm_selector s0 = {0};
return (memcmp(&s0, s, sizeof(s0)) == 0);
}
@@ -916,7 +916,7 @@ void xfrm_state_info_print(struct xfrm_usersa_info *xsinfo,
struct rtattr *tb[], FILE *fp, const char *prefix,
const char *title, bool nokeys)
{
- char buf[STRBUF_SIZE] = {};
+ char buf[STRBUF_SIZE] = {0};
int force_spi = xfrm_xfrmproto_is_ipsec(xsinfo->id.proto);
xfrm_id_info_print(&xsinfo->saddr, &xsinfo->id, xsinfo->mode,
@@ -995,7 +995,7 @@ void xfrm_policy_info_print(struct xfrm_userpolicy_info *xpinfo,
struct rtattr *tb[], FILE *fp, const char *prefix,
const char *title)
{
- char buf[STRBUF_SIZE] = {};
+ char buf[STRBUF_SIZE] = {0};
xfrm_selector_print(&xpinfo->sel, preferred_family, fp, title);
@@ -1096,8 +1096,8 @@ int xfrm_id_parse(xfrm_address_t *saddr, struct xfrm_id *id, __u16 *family,
{
int argc = *argcp;
char **argv = *argvp;
- inet_prefix dst = {};
- inet_prefix src = {};
+ inet_prefix dst = {0};
+ inet_prefix src = {0};
while (1) {
if (strcmp(*argv, "src") == 0) {
@@ -1404,8 +1404,8 @@ int xfrm_selector_parse(struct xfrm_selector *sel, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
- inet_prefix dst = {};
- inet_prefix src = {};
+ inet_prefix dst = {0};
+ inet_prefix src = {0};
char *upspecp = NULL;
while (1) {
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index 7cc00e7c..fc593008 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -257,14 +257,14 @@ static int xfrm_policy_modify(int cmd, unsigned int flags, int argc, char **argv
char *selp = NULL;
char *ptypep = NULL;
char *sctxp = NULL;
- struct xfrm_userpolicy_type upt = {};
- char tmpls_buf[XFRM_TMPLS_BUF_SIZE] = {};
+ struct xfrm_userpolicy_type upt = {0};
+ char tmpls_buf[XFRM_TMPLS_BUF_SIZE] = {0};
int tmpls_len = 0;
struct xfrm_mark mark = {0, 0};
struct {
struct xfrm_user_sec_ctx sctx;
char str[CTX_BUF_SIZE];
- } ctx = {};
+ } ctx = {0};
bool is_if_id_set = false;
__u32 if_id = 0;
@@ -577,12 +577,12 @@ static int xfrm_policy_get_or_delete(int argc, char **argv, int delete,
char *indexp = NULL;
char *ptypep = NULL;
char *sctxp = NULL;
- struct xfrm_userpolicy_type upt = {};
+ struct xfrm_userpolicy_type upt = {0};
struct xfrm_mark mark = {0, 0};
struct {
struct xfrm_user_sec_ctx sctx;
char str[CTX_BUF_SIZE];
- } ctx = {};
+ } ctx = {0};
bool is_if_id_set = false;
__u32 if_id = 0;
@@ -1136,7 +1136,7 @@ static int xfrm_policy_flush(int argc, char **argv)
.n.nlmsg_type = XFRM_MSG_FLUSHPOLICY,
};
char *ptypep = NULL;
- struct xfrm_userpolicy_type upt = {};
+ struct xfrm_userpolicy_type upt = {0};
while (argc > 0) {
if (strcmp(*argv, "ptype") == 0) {
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index f4bf3356..821763f3 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -305,9 +305,9 @@ static int xfrm_state_modify(int cmd, unsigned int flags, int argc, char **argv)
.xsinfo.lft.soft_packet_limit = XFRM_INF,
.xsinfo.lft.hard_packet_limit = XFRM_INF,
};
- struct xfrm_replay_state replay = {};
- struct xfrm_replay_state_esn replay_esn = {};
- struct xfrm_user_offload xuo = {};
+ struct xfrm_replay_state replay = {0};
+ struct xfrm_replay_state_esn replay_esn = {0};
+ struct xfrm_user_offload xuo = {0};
unsigned int ifindex = 0;
__u8 dir = 0;
bool is_offload = false;
@@ -325,7 +325,7 @@ static int xfrm_state_modify(int cmd, unsigned int flags, int argc, char **argv)
struct {
struct xfrm_user_sec_ctx sctx;
char str[CTX_BUF_SIZE];
- } ctx = {};
+ } ctx = {0};
__u32 output_mark = 0;
bool is_if_id_set = false;
__u32 if_id = 0;
@@ -394,7 +394,7 @@ static int xfrm_state_modify(int cmd, unsigned int flags, int argc, char **argv)
(void *)&encap, sizeof(encap));
} else if (strcmp(*argv, "coa") == 0) {
inet_prefix coa;
- xfrm_address_t xcoa = {};
+ xfrm_address_t xcoa = {0};
if (coap)
duparg("coa", *argv);
@@ -472,7 +472,7 @@ static int xfrm_state_modify(int cmd, unsigned int flags, int argc, char **argv)
struct xfrm_algo_auth auth;
} u;
char buf[XFRM_ALGO_KEY_BUF_SIZE];
- } alg = {};
+ } alg = {0};
int len;
__u32 icvlen, trunclen;
char *name;
diff --git a/lib/bpf.c b/lib/bpf.c
index c7d45077..5d620f40 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -148,7 +148,7 @@ static int bpf(int cmd, union bpf_attr *attr, unsigned int size)
static int bpf_map_update(int fd, const void *key, const void *value,
uint64_t flags)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.map_fd = fd;
attr.key = bpf_ptr_to_u64(key);
@@ -160,7 +160,7 @@ static int bpf_map_update(int fd, const void *key, const void *value,
static int bpf_prog_fd_by_id(uint32_t id)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.prog_id = id;
@@ -170,7 +170,7 @@ static int bpf_prog_fd_by_id(uint32_t id)
static int bpf_prog_info_by_fd(int fd, struct bpf_prog_info *info,
uint32_t *info_len)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
int ret;
attr.info.bpf_fd = fd;
@@ -187,7 +187,7 @@ static int bpf_prog_info_by_fd(int fd, struct bpf_prog_info *info,
int bpf_dump_prog_info(FILE *f, uint32_t id)
{
- struct bpf_prog_info info = {};
+ struct bpf_prog_info info = {0};
uint32_t len = sizeof(info);
int fd, ret, dump_ok = 0;
SPRINT_BUF(tmp);
@@ -449,7 +449,7 @@ static int bpf_map_selfcheck_pinned(int fd, const struct bpf_elf_map *map,
struct bpf_map_ext *ext, int length,
enum bpf_prog_type type)
{
- struct bpf_elf_map tmp, zero = {};
+ struct bpf_elf_map tmp, zero = {0};
int ret;
ret = bpf_derive_elf_map_from_fdinfo(fd, &tmp, ext);
@@ -510,7 +510,7 @@ static int bpf_mnt_fs(const char *target)
static int bpf_mnt_check_target(const char *target)
{
- struct stat sb = {};
+ struct stat sb = {0};
int ret;
ret = stat(target, &sb);
@@ -694,7 +694,7 @@ static int bpf_gen_slave(const char *base, const char *name,
{
char bpf_lnk_dir[PATH_MAX + NAME_MAX + 1];
char bpf_sub_dir[PATH_MAX + NAME_MAX];
- struct stat sb = {};
+ struct stat sb = {0};
int ret;
snprintf(bpf_lnk_dir, sizeof(bpf_lnk_dir), "%s%s/", base, link);
@@ -801,7 +801,7 @@ out:
static int bpf_obj_get(const char *pathname, enum bpf_prog_type type)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
char tmp[PATH_MAX];
if (strlen(pathname) > 2 && pathname[0] == 'm' &&
@@ -972,7 +972,7 @@ int bpf_load_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops,
int bpf_parse_common(struct bpf_cfg_in *cfg, const struct bpf_cfg_ops *ops)
{
- bool opt_tbl[BPF_MODE_MAX] = {};
+ bool opt_tbl[BPF_MODE_MAX] = {0};
if (ops->cbpf_cb) {
opt_tbl[CBPF_BYTECODE] = true;
@@ -1015,7 +1015,7 @@ int bpf_graft_map(const char *map_path, uint32_t *key, int argc, char **argv)
.argc = argc,
.argv = argv,
};
- struct bpf_map_ext ext = {};
+ struct bpf_map_ext ext = {0};
int ret, prog_fd, map_fd;
uint32_t map_key;
@@ -1068,7 +1068,7 @@ out_prog:
int bpf_prog_attach_fd(int prog_fd, int target_fd, enum bpf_attach_type type)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.target_fd = target_fd;
attr.attach_bpf_fd = prog_fd;
@@ -1079,7 +1079,7 @@ int bpf_prog_attach_fd(int prog_fd, int target_fd, enum bpf_attach_type type)
int bpf_prog_detach_fd(int target_fd, enum bpf_attach_type type)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.target_fd = target_fd;
attr.attach_type = type;
@@ -1092,7 +1092,7 @@ static int bpf_prog_load_dev(enum bpf_prog_type type,
const char *license, __u32 ifindex,
char *log, size_t size_log)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.prog_type = type;
attr.insns = bpf_ptr_to_u64(insns);
@@ -1255,7 +1255,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
uint32_t ifindex, uint32_t btf_id_key,
uint32_t btf_id_val)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.map_type = type;
attr.key_size = size_key;
@@ -1274,7 +1274,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
static int bpf_btf_load(void *btf, size_t size_btf,
char *log, size_t size_log)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.btf = bpf_ptr_to_u64(btf);
attr.btf_size = size_btf;
@@ -1290,7 +1290,7 @@ static int bpf_btf_load(void *btf, size_t size_btf,
static int bpf_obj_pin(int fd, const char *pathname)
{
- union bpf_attr attr = {};
+ union bpf_attr attr = {0};
attr.pathname = bpf_ptr_to_u64(pathname);
attr.bpf_fd = fd;
@@ -1975,7 +1975,7 @@ static int bpf_map_verify_all_offs(struct bpf_elf_ctx *ctx, int end)
static int bpf_fetch_maps_end(struct bpf_elf_ctx *ctx)
{
- struct bpf_elf_map fixup[ARRAY_SIZE(ctx->maps)] = {};
+ struct bpf_elf_map fixup[ARRAY_SIZE(ctx->maps)] = {0};
int i, sym_num = bpf_map_num_sym(ctx);
__u8 *buff;
@@ -2481,7 +2481,7 @@ static int bpf_fetch_prog_relo(struct bpf_elf_ctx *ctx, const char *section,
int ret, idx, i, fd = -1;
for (i = 1; i < ctx->elf_hdr.e_shnum; i++) {
- struct bpf_relo_props props = {};
+ struct bpf_relo_props props = {0};
ret = bpf_fill_section_data(ctx, i, &data_relo);
if (ret < 0 || data_relo.sec_hdr.sh_type != SHT_REL)
@@ -2656,7 +2656,7 @@ static int bpf_fill_prog_arrays(struct bpf_elf_ctx *ctx)
ret = bpf_map_update(ctx->map_fds[idx], &key_id,
&fd, BPF_ANY);
if (ret < 0) {
- struct bpf_jited_aux aux = {};
+ struct bpf_jited_aux aux = {0};
ret = -errno;
if (errno == E2BIG) {
@@ -2747,7 +2747,7 @@ static bool bpf_pinning_reserved(uint32_t pinning)
static void bpf_hash_init(struct bpf_elf_ctx *ctx, const char *db_file)
{
struct bpf_hash_entry *entry;
- char subpath[PATH_MAX] = {};
+ char subpath[PATH_MAX] = {0};
uint32_t pinning;
FILE *fp;
int ret;
@@ -2845,7 +2845,7 @@ static void bpf_get_cfg(struct bpf_elf_ctx *ctx)
fd = open(path_jit, O_RDONLY);
if (fd > 0) {
- char tmp[16] = {};
+ char tmp[16] = {0};
if (read(fd, tmp, sizeof(tmp)) > 0)
ctx->cfg.jit_enabled = atoi(tmp);
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 48b19501..5345b1c7 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -81,7 +81,7 @@ static void print_ext_ack_msg(bool is_err, const char *msg)
/* dump netlink extended ack error message */
int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
{
- struct nlattr *tb[NLMSGERR_ATTR_MAX + 1] = {};
+ struct nlattr *tb[NLMSGERR_ATTR_MAX + 1] = {0};
const struct nlmsgerr *err = mnl_nlmsg_get_payload(nlh);
const struct nlmsghdr *err_nlh = NULL;
unsigned int hlen = sizeof(*err);
@@ -128,7 +128,7 @@ int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
int nl_dump_ext_ack_done(const struct nlmsghdr *nlh, int error)
{
- struct nlattr *tb[NLMSGERR_ATTR_MAX + 1] = {};
+ struct nlattr *tb[NLMSGERR_ATTR_MAX + 1] = {0};
unsigned int hlen = sizeof(int);
const char *msg = NULL;
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 70ea3d49..36320f77 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -279,7 +279,7 @@ static int ll_link_get(const char *name, int index)
.ifm.ifi_index = index,
};
__u32 filt_mask = RTEXT_FILTER_VF | RTEXT_FILTER_SKIP_STATS;
- struct rtnl_handle rth = {};
+ struct rtnl_handle rth = {0};
struct nlmsghdr *answer;
int rc = 0;
diff --git a/misc/arpd.c b/misc/arpd.c
index 504961cb..ac412e29 100644
--- a/misc/arpd.c
+++ b/misc/arpd.c
@@ -435,7 +435,7 @@ static void get_kern_msg(void)
{
int status;
struct nlmsghdr *h;
- struct sockaddr_nl nladdr = {};
+ struct sockaddr_nl nladdr = {0};
struct iovec iov;
char buf[8192];
struct msghdr msg = {
@@ -659,7 +659,7 @@ int main(int argc, char **argv)
if (ifnum) {
int i;
- struct ifreq ifr = {};
+ struct ifreq ifr = {0};
for (i = 0; i < ifnum; i++) {
if (get_ifname(ifr.ifr_name, ifnames[i]))
diff --git a/misc/ss.c b/misc/ss.c
index 35066bf6..e2e3f1ec 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2669,7 +2669,7 @@ static void sctp_timer_print(struct tcpstat *s)
static int tcp_show_line(char *line, const struct filter *f, int family)
{
int rto = 0, ato = 0;
- struct tcpstat s = {};
+ struct tcpstat s = {0};
char *loc, *rem, *data;
char opt[256];
int n;
@@ -2936,7 +2936,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
struct rtattr *tb[])
{
double rtt = 0;
- struct tcpstat s = {};
+ struct tcpstat s = {0};
s.ss.state = r->idiag_state;
@@ -3233,7 +3233,7 @@ static int inet_show_sock(struct nlmsghdr *nlh,
inet_stats_print(s, v6only);
if (show_options) {
- struct tcpstat t = {};
+ struct tcpstat t = {0};
t.timer = r->idiag_timer;
t.timeout = r->idiag_expires;
@@ -3460,7 +3460,7 @@ static int show_one_inet_sock(struct nlmsghdr *h, void *arg)
int err;
struct inet_diag_arg *diag_arg = arg;
struct inet_diag_msg *r = NLMSG_DATA(h);
- struct sockstat s = {};
+ struct sockstat s = {0};
if (!(diag_arg->f->families & FAMILY_MASK(r->idiag_family)))
return 0;
@@ -3549,7 +3549,7 @@ static int tcp_show_netlink_file(struct filter *f)
int err2;
size_t status, nitems;
struct nlmsghdr *h = (struct nlmsghdr *)buf;
- struct sockstat s = {};
+ struct sockstat s = {0};
status = fread(buf, 1, sizeof(*h), fp);
if (status != sizeof(*h)) {
@@ -3694,7 +3694,7 @@ static int sctp_show(struct filter *f)
static int dgram_show_line(char *line, const struct filter *f, int family)
{
- struct sockstat s = {};
+ struct sockstat s = {0};
char *loc, *rem, *data;
char opt[256];
int n;
@@ -3834,7 +3834,7 @@ static bool unix_type_skip(struct sockstat *s, struct filter *f)
static void unix_stats_print(struct sockstat *s, struct filter *f)
{
- char port_name[30] = {};
+ char port_name[30] = {0};
sock_state_print(s);
@@ -4147,7 +4147,7 @@ static int packet_show_sock(struct nlmsghdr *nlh, void *arg)
struct packet_diag_info *pinfo = NULL;
struct packet_diag_ring *ring_rx = NULL, *ring_tx = NULL;
struct rtattr *tb[PACKET_DIAG_MAX+1];
- struct sockstat stat = {};
+ struct sockstat stat = {0};
uint32_t fanout = 0;
bool has_fanout = false;
@@ -4296,7 +4296,7 @@ static int packet_show_netlink(struct filter *f)
static int packet_show_line(char *buf, const struct filter *f, int fam)
{
unsigned long long sk;
- struct sockstat stat = {};
+ struct sockstat stat = {0};
int type, prot, iface, state, rq, uid, ino;
sscanf(buf, "%llx %*d %d %x %d %d %u %u %u",
@@ -4420,7 +4420,7 @@ static int xdp_show_sock(struct nlmsghdr *nlh, void *arg)
struct xdp_diag_info *info = NULL;
struct xdp_diag_umem *umem = NULL;
const struct filter *f = arg;
- struct sockstat stat = {};
+ struct sockstat stat = {0};
parse_rtattr(tb, XDP_DIAG_MAX, (struct rtattr *)(msg + 1),
nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*msg)));
@@ -4501,9 +4501,9 @@ static int netlink_show_one(struct filter *f,
.remote.family = AF_NETLINK,
};
- SPRINT_BUF(prot_buf) = {};
+ SPRINT_BUF(prot_buf) = {0};
const char *prot_name;
- char procname[64] = {};
+ char procname[64] = {0};
if (f->f) {
st.rport = -1;
@@ -4750,8 +4750,8 @@ static void tipc_sock_addr_print(struct rtattr *net_addr, struct rtattr *id)
uint32_t node = rta_getattr_u32(net_addr);
uint32_t identity = rta_getattr_u32(id);
- SPRINT_BUF(addr) = {};
- SPRINT_BUF(port) = {};
+ SPRINT_BUF(addr) = {0};
+ SPRINT_BUF(port) = {0};
sprintf(addr, "%u", node);
sprintf(port, "%u", identity);
@@ -4761,12 +4761,12 @@ static void tipc_sock_addr_print(struct rtattr *net_addr, struct rtattr *id)
static int tipc_show_sock(struct nlmsghdr *nlh, void *arg)
{
- struct rtattr *stat[TIPC_NLA_SOCK_STAT_MAX + 1] = {};
- struct rtattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {};
- struct rtattr *con[TIPC_NLA_CON_MAX + 1] = {};
- struct rtattr *info[TIPC_NLA_MAX + 1] = {};
+ struct rtattr *stat[TIPC_NLA_SOCK_STAT_MAX + 1] = {0};
+ struct rtattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {0};
+ struct rtattr *con[TIPC_NLA_CON_MAX + 1] = {0};
+ struct rtattr *info[TIPC_NLA_MAX + 1] = {0};
struct rtattr *msg_ref;
- struct sockstat ss = {};
+ struct sockstat ss = {0};
parse_rtattr(info, TIPC_NLA_MAX, NLMSG_DATA(nlh),
NLMSG_PAYLOAD(nlh, 0));
diff --git a/rdma/dev.c b/rdma/dev.c
index a11081b8..27290218 100644
--- a/rdma/dev.c
+++ b/rdma/dev.c
@@ -191,7 +191,7 @@ static void dev_print_node_type(struct rd *rd, struct nlattr **tb)
static int dev_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
diff --git a/rdma/link.c b/rdma/link.c
index bf24b849..620485f1 100644
--- a/rdma/link.c
+++ b/rdma/link.c
@@ -224,7 +224,7 @@ static void link_print_netdev(struct rd *rd, struct nlattr **tb)
static int link_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
uint32_t port, idx;
const char *name;
diff --git a/rdma/rdma.c b/rdma/rdma.c
index d1957465..0a8e87b5 100644
--- a/rdma/rdma.c
+++ b/rdma/rdma.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
bool show_details = false;
bool json_output = false;
bool force = false;
- struct rd rd = {};
+ struct rd rd = {0};
char *filename;
int opt;
int err;
diff --git a/rdma/res-cmid.c b/rdma/res-cmid.c
index f167800f..59c68495 100644
--- a/rdma/res-cmid.c
+++ b/rdma/res-cmid.c
@@ -212,7 +212,7 @@ out: if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
int res_cm_id_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
int idx;
@@ -229,7 +229,7 @@ int res_cm_id_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct nlattr *nla_table, *nla_entry;
struct rd *rd = data;
int ret = MNL_CB_OK;
@@ -246,7 +246,7 @@ int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
nla_table = tb[RDMA_NLDEV_ATTR_RES_CM_ID];
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
ret = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (ret != MNL_CB_OK)
diff --git a/rdma/res-cq.c b/rdma/res-cq.c
index e1efe3ba..d3fd01fb 100644
--- a/rdma/res-cq.c
+++ b/rdma/res-cq.c
@@ -116,7 +116,7 @@ out: if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
int res_cq_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
@@ -133,7 +133,7 @@ int res_cq_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct nlattr *nla_table, *nla_entry;
struct rd *rd = data;
int ret = MNL_CB_OK;
@@ -150,7 +150,7 @@ int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)
nla_table = tb[RDMA_NLDEV_ATTR_RES_CQ];
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
ret = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (ret != MNL_CB_OK)
diff --git a/rdma/res-mr.c b/rdma/res-mr.c
index c1366035..2b19a5d7 100644
--- a/rdma/res-mr.c
+++ b/rdma/res-mr.c
@@ -79,7 +79,7 @@ out:
int res_mr_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
@@ -96,7 +96,7 @@ int res_mr_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct nlattr *nla_table, *nla_entry;
struct rd *rd = data;
int ret = MNL_CB_OK;
@@ -113,7 +113,7 @@ int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)
nla_table = tb[RDMA_NLDEV_ATTR_RES_MR];
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
ret = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (ret != MNL_CB_OK)
diff --git a/rdma/res-pd.c b/rdma/res-pd.c
index df538010..6179d788 100644
--- a/rdma/res-pd.c
+++ b/rdma/res-pd.c
@@ -83,7 +83,7 @@ out: if (nla_line[RDMA_NLDEV_ATTR_RES_PID])
int res_pd_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
@@ -100,7 +100,7 @@ int res_pd_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct nlattr *nla_table, *nla_entry;
struct rd *rd = data;
int ret = MNL_CB_OK;
@@ -117,7 +117,7 @@ int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)
nla_table = tb[RDMA_NLDEV_ATTR_RES_PD];
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
ret = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (ret != MNL_CB_OK)
diff --git a/rdma/res-qp.c b/rdma/res-qp.c
index 801cfca9..e01e94ff 100644
--- a/rdma/res-qp.c
+++ b/rdma/res-qp.c
@@ -172,7 +172,7 @@ out:
int res_qp_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
@@ -189,7 +189,7 @@ int res_qp_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct nlattr *nla_table, *nla_entry;
struct rd *rd = data;
int ret = MNL_CB_OK;
@@ -206,7 +206,7 @@ int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)
nla_table = tb[RDMA_NLDEV_ATTR_RES_QP];
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
ret = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (ret != MNL_CB_OK)
diff --git a/rdma/res.c b/rdma/res.c
index 251f5041..7eee7e0f 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -34,7 +34,7 @@ static int res_print_summary(struct rd *rd, struct nlattr **tb)
int err;
mnl_attr_for_each_nested(nla_entry, nla_table) {
- struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *nla_line[RDMA_NLDEV_ATTR_MAX] = {0};
err = mnl_attr_parse_nested(nla_entry, rd_attr_cb, nla_line);
if (err != MNL_CB_OK)
@@ -61,7 +61,7 @@ static int res_no_args_idx_parse_cb(const struct nlmsghdr *nlh, void *data)
static int res_no_args_parse_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct rd *rd = data;
const char *name;
uint32_t idx;
diff --git a/rdma/utils.c b/rdma/utils.c
index e25c3adf..25648a30 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -488,7 +488,7 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
int rd_dev_init_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {};
+ struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {0};
struct dev_map *dev_map;
struct rd *rd = data;
const char *dev_name;
diff --git a/tc/e_bpf.c b/tc/e_bpf.c
index a48393b7..6fbcd339 100644
--- a/tc/e_bpf.c
+++ b/tc/e_bpf.c
@@ -58,8 +58,8 @@ static int parse_bpf(struct exec_util *eu, int argc, char **argv)
char **argv_run = argv_default, **envp_run, *tmp;
int ret, i, env_old, env_num, env_map;
const char *bpf_uds_name = NULL;
- int fds[BPF_SCM_MAX_FDS] = {};
- struct bpf_map_aux aux = {};
+ int fds[BPF_SCM_MAX_FDS] = {0};
+ struct bpf_map_aux aux = {0};
if (argc == 0)
return 0;
diff --git a/tc/em_cmp.c b/tc/em_cmp.c
index e051656f..abe2cd93 100644
--- a/tc/em_cmp.c
+++ b/tc/em_cmp.c
@@ -43,7 +43,7 @@ static int cmp_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
int align, opnd = 0;
unsigned long offset = 0, layer = TCF_LAYER_NETWORK, mask = 0, value = 0;
int offset_present = 0, value_present = 0;
- struct tcf_em_cmp cmp = {};
+ struct tcf_em_cmp cmp = {0};
#define PARSE_ERR(CARG, FMT, ARGS...) \
em_parse_error(EINVAL, args, CARG, &cmp_ematch_util, FMT, ##ARGS)
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
index 48b287f5..08d83401 100644
--- a/tc/em_ipset.c
+++ b/tc/em_ipset.c
@@ -198,7 +198,7 @@ static void ipset_print_usage(FILE *fd)
static int ipset_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
struct bstr *args)
{
- struct xt_set_info set_info = {};
+ struct xt_set_info set_info = {0};
int ret;
#define PARSE_ERR(CARG, FMT, ARGS...) \
diff --git a/tc/em_meta.c b/tc/em_meta.c
index 2ddc65ed..6d0755c5 100644
--- a/tc/em_meta.c
+++ b/tc/em_meta.c
@@ -360,7 +360,7 @@ static int meta_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
{
int opnd;
struct bstr *a;
- struct tcf_meta_hdr meta_hdr = {};
+ struct tcf_meta_hdr meta_hdr = {0};
unsigned long lvalue = 0, rvalue = 0;
if (args == NULL)
diff --git a/tc/em_nbyte.c b/tc/em_nbyte.c
index 274d713f..1e72bdf4 100644
--- a/tc/em_nbyte.c
+++ b/tc/em_nbyte.c
@@ -43,7 +43,7 @@ static int nbyte_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
struct bstr *needle = args;
unsigned long offset = 0, layer = TCF_LAYER_NETWORK;
int offset_present = 0;
- struct tcf_em_nbyte nb = {};
+ struct tcf_em_nbyte nb = {0};
#define PARSE_ERR(CARG, FMT, ARGS...) \
em_parse_error(EINVAL, args, CARG, &nbyte_ematch_util, FMT, ##ARGS)
diff --git a/tc/em_u32.c b/tc/em_u32.c
index bc284af4..efebb2dc 100644
--- a/tc/em_u32.c
+++ b/tc/em_u32.c
@@ -38,7 +38,7 @@ static int u32_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
struct bstr *a;
int align, nh_len;
unsigned long key, mask, offmask = 0, offset;
- struct tc_u32_key u_key = {};
+ struct tc_u32_key u_key = {0};
#define PARSE_ERR(CARG, FMT, ARGS...) \
em_parse_error(EINVAL, args, CARG, &u32_ematch_util, FMT, ##ARGS)
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index fa3552ae..33462d0b 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -82,7 +82,7 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle,
struct tcmsg *t = NLMSG_DATA(n);
unsigned int bpf_gen_flags = 0;
unsigned int bpf_flags = 0;
- struct bpf_cfg_in cfg = {};
+ struct bpf_cfg_in cfg = {0};
bool seen_run = false;
bool skip_sw = false;
struct rtattr *tail;
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 688364f5..55fcc3cc 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -93,7 +93,7 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
}
continue;
} else if (strcmp(*argv, "indev") == 0) {
- char d[IFNAMSIZ+1] = {};
+ char d[IFNAMSIZ+1] = {0};
argc--;
argv++;
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 388e9ee5..e6eb0147 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -174,7 +174,7 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc,
char **argv, struct nlmsghdr *n)
{
int family = strcmp(qu->id, "rsvp") == 0 ? AF_INET : AF_INET6;
- struct tc_rsvp_pinfo pinfo = {};
+ struct tc_rsvp_pinfo pinfo = {0};
struct tcmsg *t = NLMSG_DATA(n);
int pinfo_ok = 0;
struct rtattr *tail;
diff --git a/tc/f_u32.c b/tc/f_u32.c
index e0a322d5..483c4685 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -984,7 +984,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
struct {
struct tc_u32_sel sel;
struct tc_u32_key keys[128];
- } sel = {};
+ } sel = {0};
struct tcmsg *t = NLMSG_DATA(n);
struct rtattr *tail;
int sel_ok = 0, terminal_ok = 0;
@@ -1089,7 +1089,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
struct {
struct tc_u32_sel sel;
struct tc_u32_key keys[4];
- } sel2 = {};
+ } sel2 = {0};
NEXT_ARG();
if (parse_selector(&argc, &argv, &sel2.sel, n)) {
@@ -1117,7 +1117,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
sample_ok = 1;
continue;
} else if (strcmp(*argv, "indev") == 0) {
- char ind[IFNAMSIZ + 1] = {};
+ char ind[IFNAMSIZ + 1] = {0};
argc--;
argv++;
diff --git a/tc/m_bpf.c b/tc/m_bpf.c
index e8d704b5..7ecd86ef 100644
--- a/tc/m_bpf.c
+++ b/tc/m_bpf.c
@@ -77,8 +77,8 @@ static int bpf_parse_opt(struct action_util *a, int *ptr_argc, char ***ptr_argv,
int tca_id, struct nlmsghdr *n)
{
const char *bpf_obj = NULL, *bpf_uds_name = NULL;
- struct tc_act_bpf parm = {};
- struct bpf_cfg_in cfg = {};
+ struct tc_act_bpf parm = {0};
+ struct bpf_cfg_in cfg = {0};
bool seen_run = false;
struct rtattr *tail;
int argc, ret = 0;
diff --git a/tc/m_connmark.c b/tc/m_connmark.c
index 4b2dc4e2..3d5a203e 100644
--- a/tc/m_connmark.c
+++ b/tc/m_connmark.c
@@ -46,7 +46,7 @@ static int
parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
struct nlmsghdr *n)
{
- struct tc_connmark sel = {};
+ struct tc_connmark sel = {0};
char **argv = *argv_p;
int argc = *argc_p;
int ok = 0;
diff --git a/tc/m_csum.c b/tc/m_csum.c
index afbee9c8..bfe0468e 100644
--- a/tc/m_csum.c
+++ b/tc/m_csum.c
@@ -88,7 +88,7 @@ static int
parse_csum(struct action_util *a, int *argc_p,
char ***argv_p, int tca_id, struct nlmsghdr *n)
{
- struct tc_csum sel = {};
+ struct tc_csum sel = {0};
int argc = *argc_p;
char **argv = *argv_p;
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index d2bdf407..deb4ce5e 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -96,9 +96,9 @@ parse_direction(struct action_util *a, int *argc_p, char ***argv_p,
int argc = *argc_p;
char **argv = *argv_p;
int ok = 0, iok = 0, mirror = 0, redir = 0, ingress = 0, egress = 0;
- struct tc_mirred p = {};
+ struct tc_mirred p = {0};
struct rtattr *tail;
- char d[IFNAMSIZ] = {};
+ char d[IFNAMSIZ] = {0};
while (argc > 0) {
diff --git a/tc/m_nat.c b/tc/m_nat.c
index 56e8f47c..ef8f75fb 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -83,7 +83,7 @@ bad_val:
static int
parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n)
{
- struct tc_nat sel = {};
+ struct tc_nat sel = {0};
int argc = *argc_p;
char **argv = *argv_p;
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 51dcf109..84fb9060 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -511,7 +511,7 @@ done:
static int parse_munge(int *argc_p, char ***argv_p, struct m_pedit_sel *sel)
{
- struct m_pedit_key tkey = {};
+ struct m_pedit_key tkey = {0};
int argc = *argc_p;
char **argv = *argv_p;
int res = -1;
@@ -615,7 +615,7 @@ static int pedit_keys_ex_addattr(struct m_pedit_sel *sel, struct nlmsghdr *n)
static int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p,
int tca_id, struct nlmsghdr *n)
{
- struct m_pedit_sel sel = {};
+ struct m_pedit_sel sel = {0};
int argc = *argc_p;
char **argv = *argv_p;
diff --git a/tc/m_simple.c b/tc/m_simple.c
index 70897d6b..6793e6f5 100644
--- a/tc/m_simple.c
+++ b/tc/m_simple.c
@@ -97,7 +97,7 @@ static int
parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
struct nlmsghdr *n)
{
- struct tc_defact sel = {};
+ struct tc_defact sel = {0};
int argc = *argc_p;
char **argv = *argv_p;
int ok = 0;
diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c
index bfec9072..3c850f40 100644
--- a/tc/m_tunnel_key.c
+++ b/tc/m_tunnel_key.c
@@ -317,7 +317,7 @@ static int tunnel_key_parse_tos_ttl(char *str, int type, struct nlmsghdr *n)
static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p,
int tca_id, struct nlmsghdr *n)
{
- struct tc_tunnel_key parm = {};
+ struct tc_tunnel_key parm = {0};
char **argv = *argv_p;
int argc = *argc_p;
struct rtattr *tail;
diff --git a/tc/m_vlan.c b/tc/m_vlan.c
index 1096ba0f..3640d13a 100644
--- a/tc/m_vlan.c
+++ b/tc/m_vlan.c
@@ -69,7 +69,7 @@ static int parse_vlan(struct action_util *a, int *argc_p, char ***argv_p,
int proto_set = 0;
__u8 prio;
int prio_set = 0;
- struct tc_vlan parm = {};
+ struct tc_vlan parm = {0};
if (matches(*argv, "vlan") != 0)
return -1;
diff --git a/tc/m_xt.c b/tc/m_xt.c
index 487ba25a..66655a28 100644
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -147,7 +147,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
{
struct xtables_target *m = NULL;
#if XTABLES_VERSION_CODE >= 6
- struct ipt_entry fw = {};
+ struct ipt_entry fw = {0};
#endif
struct rtattr *tail;
diff --git a/tc/q_atm.c b/tc/q_atm.c
index 77b56825..c0acf492 100644
--- a/tc/q_atm.c
+++ b/tc/q_atm.c
@@ -49,7 +49,7 @@ static void explain(void)
static int atm_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- struct sockaddr_atmsvc addr = {};
+ struct sockaddr_atmsvc addr = {0};
struct atm_qos qos;
struct atm_sap sap;
unsigned char hdr[MAX_HDR_LEN];
diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index 6518ef46..9bee7c1b 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -50,8 +50,8 @@ static void explain1(char *arg)
static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev)
{
- struct tc_ratespec r = {};
- struct tc_cbq_lssopt lss = {};
+ struct tc_ratespec r = {0};
+ struct tc_cbq_lssopt lss = {0};
__u32 rtab[256];
unsigned mpu = 0, avpkt = 0, allot = 0;
unsigned short overhead = 0;
@@ -185,10 +185,10 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev)
{
int wrr_ok = 0, fopt_ok = 0;
- struct tc_ratespec r = {};
- struct tc_cbq_lssopt lss = {};
- struct tc_cbq_wrropt wrr = {};
- struct tc_cbq_fopt fopt = {};
+ struct tc_ratespec r = {0};
+ struct tc_cbq_lssopt lss = {0};
+ struct tc_cbq_wrropt wrr = {0};
+ struct tc_cbq_fopt fopt = {0};
__u32 rtab[256];
unsigned mpu = 0;
int cell_log = -1;
diff --git a/tc/q_cbs.c b/tc/q_cbs.c
index 13bb08e9..a32aa6c1 100644
--- a/tc/q_cbs.c
+++ b/tc/q_cbs.c
@@ -37,7 +37,7 @@ static void explain1(const char *arg, const char *val)
static int cbs_parse_opt(struct qdisc_util *qu, int argc,
char **argv, struct nlmsghdr *n, const char *dev)
{
- struct tc_cbs_qopt opt = {};
+ struct tc_cbs_qopt opt = {0};
struct rtattr *tail;
while (argc > 0) {
diff --git a/tc/q_choke.c b/tc/q_choke.c
index 570c3599..aa354d5d 100644
--- a/tc/q_choke.c
+++ b/tc/q_choke.c
@@ -34,7 +34,7 @@ static void explain(void)
static int choke_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- struct tc_red_qopt opt = {};
+ struct tc_red_qopt opt = {0};
unsigned int burst = 0;
unsigned int avpkt = 1000;
double probability = 0.02;
diff --git a/tc/q_codel.c b/tc/q_codel.c
index c72a5779..a000bcdd 100644
--- a/tc/q_codel.c
+++ b/tc/q_codel.c
@@ -180,7 +180,7 @@ static int codel_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
static int codel_print_xstats(struct qdisc_util *qu, FILE *f,
struct rtattr *xstats)
{
- struct tc_codel_xstats _st = {}, *st;
+ struct tc_codel_xstats _st = {0}, *st;
SPRINT_BUF(b1);
diff --git a/tc/q_fifo.c b/tc/q_fifo.c
index 61493fbb..b4fa76ae 100644
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -31,7 +31,7 @@ static int fifo_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
int ok = 0;
- struct tc_fifo_qopt opt = {};
+ struct tc_fifo_qopt opt = {0};
while (argc > 0) {
if (strcmp(*argv, "limit") == 0) {
diff --git a/tc/q_fq_codel.c b/tc/q_fq_codel.c
index 1a51302e..6d94af44 100644
--- a/tc/q_fq_codel.c
+++ b/tc/q_fq_codel.c
@@ -244,7 +244,7 @@ static int fq_codel_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt
static int fq_codel_print_xstats(struct qdisc_util *qu, FILE *f,
struct rtattr *xstats)
{
- struct tc_fq_codel_xstats _st = {}, *st;
+ struct tc_fq_codel_xstats _st = {0}, *st;
SPRINT_BUF(b1);
diff --git a/tc/q_gred.c b/tc/q_gred.c
index 8a1cecff..7a39281f 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -304,8 +304,8 @@ gred_parse_vqs(struct tc_gred_info *info, struct rtattr *vqs)
unsigned int offset = 0;
while (rem > offset) {
- struct rtattr *tb_entry[TCA_GRED_VQ_ENTRY_MAX + 1] = {};
- struct rtattr *tb[TCA_GRED_VQ_MAX + 1] = {};
+ struct rtattr *tb_entry[TCA_GRED_VQ_ENTRY_MAX + 1] = {0};
+ struct rtattr *tb[TCA_GRED_VQ_MAX + 1] = {0};
struct rtattr *entry;
unsigned int len;
unsigned int dp;
@@ -422,7 +422,7 @@ gred_print_stats(struct tc_gred_info *info, struct tc_gred_qopt *qopt)
static int gred_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
{
- struct tc_gred_info infos[MAX_DPs] = {};
+ struct tc_gred_info infos[MAX_DPs] = {0};
struct rtattr *tb[TCA_GRED_MAX + 1];
struct tc_gred_sopt *sopt;
struct tc_gred_qopt *qopt;
diff --git a/tc/q_hfsc.c b/tc/q_hfsc.c
index f34b1b2f..9612df40 100644
--- a/tc/q_hfsc.c
+++ b/tc/q_hfsc.c
@@ -73,7 +73,7 @@ static int
hfsc_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- struct tc_hfsc_qopt qopt = {};
+ struct tc_hfsc_qopt qopt = {0};
while (argc > 0) {
if (matches(*argv, "default") == 0) {
@@ -144,7 +144,7 @@ static int
hfsc_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- struct tc_service_curve rsc = {}, fsc = {}, usc = {};
+ struct tc_service_curve rsc = {0}, fsc = {}, usc = {};
int rsc_ok = 0, fsc_ok = 0, usc_ok = 0;
struct rtattr *tail;
diff --git a/tc/q_htb.c b/tc/q_htb.c
index 52052226..2806c7f1 100644
--- a/tc/q_htb.c
+++ b/tc/q_htb.c
@@ -109,7 +109,7 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc,
static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev)
{
- struct tc_htb_opt opt = {};
+ struct tc_htb_opt opt = {0};
__u32 rtab[256], ctab[256];
unsigned buffer = 0, cbuffer = 0;
int cell_log = -1, ccell_log = -1;
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
index 8ad9e0b2..7319b1bf 100644
--- a/tc/q_multiq.c
+++ b/tc/q_multiq.c
@@ -42,7 +42,7 @@ static void explain(void)
static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
- struct tc_multiq_qopt opt = {};
+ struct tc_multiq_qopt opt = {0};
if (argc) {
if (strcmp(*argv, "help") == 0) {
diff --git a/tc/q_netem.c b/tc/q_netem.c
index d01450fc..42677a29 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -200,17 +200,17 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
int slot_dist_size = 0;
struct rtattr *tail;
struct tc_netem_qopt opt = { .limit = 1000 };
- struct tc_netem_corr cor = {};
- struct tc_netem_reorder reorder = {};
- struct tc_netem_corrupt corrupt = {};
+ struct tc_netem_corr cor = {0};
+ struct tc_netem_reorder reorder = {0};
+ struct tc_netem_corrupt corrupt = {0};
struct tc_netem_gimodel gimodel;
struct tc_netem_gemodel gemodel;
- struct tc_netem_rate rate = {};
- struct tc_netem_slot slot = {};
+ struct tc_netem_rate rate = {0};
+ struct tc_netem_slot slot = {0};
__s16 *dist_data = NULL;
__s16 *slot_dist_data = NULL;
__u16 loss_type = NETEM_LOSS_UNSPEC;
- int present[__TCA_NETEM_MAX] = {};
+ int present[__TCA_NETEM_MAX] = {0};
__u64 rate64 = 0;
for ( ; argc > 0; --argc, ++argv) {
diff --git a/tc/q_red.c b/tc/q_red.c
index 53181c82..30008c68 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -41,7 +41,7 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nla_bitfield32 flags_bf = {
.selector = RED_SUPPORTED_FLAGS,
};
- struct tc_red_qopt opt = {};
+ struct tc_red_qopt opt = {0};
unsigned int burst = 0;
unsigned int avpkt = 0;
double probability = 0.02;
diff --git a/tc/q_sfq.c b/tc/q_sfq.c
index 2b9bbcd2..a0b84f41 100644
--- a/tc/q_sfq.c
+++ b/tc/q_sfq.c
@@ -38,7 +38,7 @@ static void explain(void)
static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n, const char *dev)
{
int ok = 0, red = 0;
- struct tc_sfq_qopt_v1 opt = {};
+ struct tc_sfq_qopt_v1 opt = {0};
unsigned int burst = 0;
int wlog;
unsigned int avpkt = 1000;
diff --git a/tc/q_skbprio.c b/tc/q_skbprio.c
index ca81a72c..c792ebf0 100644
--- a/tc/q_skbprio.c
+++ b/tc/q_skbprio.c
@@ -32,7 +32,7 @@ static int skbprio_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
int ok = 0;
- struct tc_skbprio_qopt opt = {};
+ struct tc_skbprio_qopt opt = {0};
while (argc > 0) {
if (strcmp(*argv, "limit") == 0) {
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 5135b1d6..9bbe6b37 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -40,7 +40,7 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv,
struct nlmsghdr *n, const char *dev)
{
int ok = 0;
- struct tc_tbf_qopt opt = {};
+ struct tc_tbf_qopt opt = {0};
__u32 rtab[256];
__u32 ptab[256];
unsigned buffer = 0, mtu = 0, mpu = 0, latency = 0;
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 39bea971..e6f91207 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -36,8 +36,8 @@ struct graph_node {
int nodes_count;
};
-static struct hlist_head cls_list = {};
-static struct hlist_head root_cls_list = {};
+static struct hlist_head cls_list = {0};
+static struct hlist_head root_cls_list = {0};
static void usage(void);
@@ -67,9 +67,9 @@ static int tc_class_modify(int cmd, unsigned int flags, int argc, char **argv)
.t.tcm_family = AF_UNSPEC,
};
struct qdisc_util *q = NULL;
- struct tc_estimator est = {};
- char d[IFNAMSIZ] = {};
- char k[FILTER_NAMESZ] = {};
+ struct tc_estimator est = {0};
+ char d[IFNAMSIZ] = {0};
+ char k[FILTER_NAMESZ] = {0};
while (argc > 0) {
if (strcmp(*argv, "dev") == 0) {
@@ -216,14 +216,14 @@ static void graph_cls_show(FILE *fp, char *buf, struct hlist_head *root_list,
int level)
{
struct hlist_node *n, *tmp_cls;
- char cls_id_str[256] = {};
+ char cls_id_str[256] = {0};
struct rtattr *tb[TCA_MAX + 1];
struct qdisc_util *q;
- char str[300] = {};
+ char str[300] = {0};
hlist_for_each_safe(n, tmp_cls, root_list) {
struct hlist_node *c, *tmp_chld;
- struct hlist_head children = {};
+ struct hlist_head children = {0};
struct graph_node *cls = container_of(n, struct graph_node,
hlist);
@@ -388,7 +388,7 @@ int print_class(struct nlmsghdr *n, void *arg)
static int tc_class_list(int argc, char **argv)
{
struct tcmsg t = { .tcm_family = AF_UNSPEC };
- char d[IFNAMSIZ] = {};
+ char d[IFNAMSIZ] = {0};
char buf[1024] = {0};
filter_qdisc = 0;
diff --git a/tc/tc_exec.c b/tc/tc_exec.c
index 9b912ceb..edc6c205 100644
--- a/tc/tc_exec.c
+++ b/tc/tc_exec.c
@@ -85,7 +85,7 @@ noexist:
int do_exec(int argc, char **argv)
{
struct exec_util *eu;
- char kind[FILTER_NAMESZ] = {};
+ char kind[FILTER_NAMESZ] = {0};
if (argc < 1) {
fprintf(stderr, "No command given, try \"tc exec help\".\n");
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index c591a19f..4adf8bdb 100644
--- a/tc/tc_filter.c
+++ b/tc/tc_filter.c
@@ -78,9 +78,9 @@ static int tc_filter_modify(int cmd, unsigned int flags, int argc, char **argv)
__u32 chain_index;
int chain_index_set = 0;
char *fhandle = NULL;
- char d[IFNAMSIZ] = {};
- char k[FILTER_NAMESZ] = {};
- struct tc_estimator est = {};
+ char d[IFNAMSIZ] = {0};
+ char k[FILTER_NAMESZ] = {0};
+ struct tc_estimator est = {0};
if (cmd == RTM_NEWTFILTER && flags & NLM_F_CREATE)
protocol = htons(ETH_P_ALL);
@@ -405,8 +405,8 @@ static int tc_filter_get(int cmd, unsigned int flags, int argc, char **argv)
__u32 block_index = 0;
__u32 parent_handle = 0;
char *fhandle = NULL;
- char d[IFNAMSIZ] = {};
- char k[FILTER_NAMESZ] = {};
+ char d[IFNAMSIZ] = {0};
+ char k[FILTER_NAMESZ] = {0};
while (argc > 0) {
if (strcmp(*argv, "dev") == 0) {
@@ -595,7 +595,7 @@ static int tc_filter_list(int cmd, int argc, char **argv)
.t.tcm_parent = TC_H_UNSPEC,
.t.tcm_family = AF_UNSPEC,
};
- char d[IFNAMSIZ] = {};
+ char d[IFNAMSIZ] = {0};
__u32 prio = 0;
__u32 protocol = 0;
__u32 chain_index;
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 8eb08c34..11ccec42 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -47,13 +47,13 @@ static int usage(void)
static int tc_qdisc_modify(int cmd, unsigned int flags, int argc, char **argv)
{
struct qdisc_util *q = NULL;
- struct tc_estimator est = {};
+ struct tc_estimator est = {0};
struct {
struct tc_sizespec szopts;
__u16 *data;
- } stab = {};
- char d[IFNAMSIZ] = {};
- char k[FILTER_NAMESZ] = {};
+ } stab = {0};
+ char d[IFNAMSIZ] = {0};
+ char k[FILTER_NAMESZ] = {0};
struct {
struct nlmsghdr n;
struct tcmsg t;
@@ -363,7 +363,7 @@ static int tc_qdisc_list(int argc, char **argv)
.t.tcm_family = AF_UNSPEC,
};
- char d[IFNAMSIZ] = {};
+ char d[IFNAMSIZ] = {0};
bool dump_invisible = false;
__u32 handle;
diff --git a/tc/tc_stab.c b/tc/tc_stab.c
index c0f1f160..45a6b184 100644
--- a/tc/tc_stab.c
+++ b/tc/tc_stab.c
@@ -51,7 +51,7 @@ int parse_size_table(int *argcp, char ***argvp, struct tc_sizespec *sp)
{
char **argv = *argvp;
int argc = *argcp;
- struct tc_sizespec s = {};
+ struct tc_sizespec s = {0};
NEXT_ARG();
if (matches(*argv, "help") == 0) {
diff --git a/tc/tc_util.c b/tc/tc_util.c
index b7ff911b..ee1140c3 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -129,7 +129,7 @@ ok:
int print_tc_classid(char *buf, int blen, __u32 h)
{
- SPRINT_BUF(handle) = {};
+ SPRINT_BUF(handle) = {0};
int hlen = SPRINT_BSIZE - 1;
if (h == TC_H_ROOT)
@@ -144,7 +144,7 @@ int print_tc_classid(char *buf, int blen, __u32 h)
snprintf(handle, hlen, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
if (use_names) {
- char clname[IDNAME_MAX] = {};
+ char clname[IDNAME_MAX] = {0};
if (id_to_name(cls_names, h, clname))
snprintf(buf, blen, "%s#%s", clname, handle);
@@ -900,7 +900,7 @@ void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix,
}
/* backward compatibility */
if (tb[TCA_STATS]) {
- struct tc_stats st = {};
+ struct tc_stats st = {0};
/* handle case where kernel returns more/less than we know about */
memcpy(&st, RTA_DATA(tb[TCA_STATS]),
diff --git a/tipc/bearer.c b/tipc/bearer.c
index 4470819e..0bc8ed9e 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -84,8 +84,8 @@ static void cmd_bearer_enable_udp_help(struct cmdl *cmdl, char *media)
static int get_netid_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {0};
int *netid = (int*)data;
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
@@ -742,7 +742,7 @@ static int bearer_dump_udp_cb(const struct nlmsghdr *nlh, void *data)
{
struct sockaddr_storage *addr;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_UDP_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_UDP_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
@@ -778,9 +778,9 @@ static int bearer_get_udp_cb(const struct nlmsghdr *nlh, void *data)
struct cb_data *cb_data = (struct cb_data *) data;
struct sockaddr_storage *addr;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {};
- struct nlattr *opts[TIPC_NLA_UDP_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {0};
+ struct nlattr *opts[TIPC_NLA_UDP_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_BEARER])
@@ -850,9 +850,9 @@ static int bearer_get_cb(const struct nlmsghdr *nlh, void *data)
{
int *prop = data;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {};
- struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {0};
+ struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_BEARER])
@@ -1033,8 +1033,8 @@ static int cmd_bearer_get(struct nlmsghdr *nlh, const struct cmd *cmd,
static int bearer_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_BEARER_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_BEARER]) {
diff --git a/tipc/link.c b/tipc/link.c
index 192736ea..00ec0dca 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -35,8 +35,8 @@ static const char tipc_bclink_name[] = "broadcast-link";
static int link_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_LINK])
@@ -86,9 +86,9 @@ static int link_get_cb(const struct nlmsghdr *nlh, void *data)
{
int *prop = data;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {};
- struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {0};
+ struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_LINK])
@@ -508,10 +508,10 @@ static int link_stat_show_cb(const struct nlmsghdr *nlh, void *data)
const char *name;
const char *link = data;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {};
- struct nlattr *prop[TIPC_NLA_PROP_MAX + 1] = {};
- struct nlattr *stats[TIPC_NLA_STATS_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1] = {0};
+ struct nlattr *prop[TIPC_NLA_PROP_MAX + 1] = {0};
+ struct nlattr *stats[TIPC_NLA_STATS_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_LINK])
@@ -814,8 +814,8 @@ static int cmd_link_mon_set_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
static int link_mon_summary_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_MON])
@@ -947,8 +947,8 @@ static void link_mon_print_peer_state(const uint32_t addr, const char *status,
static int link_mon_peer_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *attrs[TIPC_NLA_MON_PEER_MAX + 1] = {};
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
+ struct nlattr *attrs[TIPC_NLA_MON_PEER_MAX + 1] = {0};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
uint16_t member_cnt;
uint32_t applied;
uint32_t dom_gen;
@@ -1025,8 +1025,8 @@ static int link_mon_peer_list(uint32_t mon_ref)
static int link_mon_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {0};
char *req_bearer = data;
const char *bname;
const char title[] =
@@ -1154,8 +1154,8 @@ static void cmd_link_mon_get_help(struct cmdl *cmdl)
static int link_mon_get_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_MON_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_MON])
diff --git a/tipc/media.c b/tipc/media.c
index 969ef657..4f60c2bc 100644
--- a/tipc/media.c
+++ b/tipc/media.c
@@ -26,8 +26,8 @@
static int media_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_MEDIA])
@@ -64,9 +64,9 @@ static int media_get_cb(const struct nlmsghdr *nlh, void *data)
{
int *prop = data;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {};
- struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_MEDIA_MAX + 1] = {0};
+ struct nlattr *props[TIPC_NLA_PROP_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_MEDIA])
diff --git a/tipc/misc.c b/tipc/misc.c
index 1daf3072..615c8a4c 100644
--- a/tipc/misc.c
+++ b/tipc/misc.c
@@ -154,7 +154,7 @@ void nodeid2str(uint8_t *id, char *str)
void hash2nodestr(uint32_t hash, char *str)
{
- struct tipc_sioc_nodeid_req nr = {};
+ struct tipc_sioc_nodeid_req nr = {0};
int sd;
sd = socket(AF_TIPC, SOCK_RDM, 0);
diff --git a/tipc/msg.c b/tipc/msg.c
index dc09d050..b2416bb2 100644
--- a/tipc/msg.c
+++ b/tipc/msg.c
@@ -32,7 +32,7 @@ int parse_attrs(const struct nlattr *attr, void *data)
static int family_id_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *tb[CTRL_ATTR_MAX + 1] = {};
+ struct nlattr *tb[CTRL_ATTR_MAX + 1] = {0};
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
int *id = data;
diff --git a/tipc/nametable.c b/tipc/nametable.c
index d899eeb6..dd8a7a49 100644
--- a/tipc/nametable.c
+++ b/tipc/nametable.c
@@ -29,9 +29,9 @@ static int nametable_show_cb(const struct nlmsghdr *nlh, void *data)
{
int *iteration = data;
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_NAME_TABLE_MAX + 1] = {};
- struct nlattr *publ[TIPC_NLA_PUBL_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_NAME_TABLE_MAX + 1] = {0};
+ struct nlattr *publ[TIPC_NLA_PUBL_MAX + 1] = {0};
const char *scope[] = { "", "zone", "cluster", "node" };
char str[33] = {0,};
diff --git a/tipc/node.c b/tipc/node.c
index ffdaeaea..40eda09e 100644
--- a/tipc/node.c
+++ b/tipc/node.c
@@ -26,9 +26,9 @@
static int node_list_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_NODE_MAX + 1] = {};
- char str[33] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_NODE_MAX + 1] = {0};
+ char str[33] = {0};
uint32_t addr;
mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
@@ -266,8 +266,8 @@ static int cmd_node_flush_key(struct nlmsghdr *nlh, const struct cmd *cmd,
static int nodeid_get_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {0};
char str[33] = {0,};
uint8_t id[16] = {0,};
uint64_t *w0 = (uint64_t *) &id[0];
@@ -312,8 +312,8 @@ static int cmd_node_get_nodeid(struct nlmsghdr *nlh, const struct cmd *cmd,
static int netid_get_cb(const struct nlmsghdr *nlh, void *data)
{
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
if (!info[TIPC_NLA_NET])
diff --git a/tipc/socket.c b/tipc/socket.c
index 852984ec..c6bf518b 100644
--- a/tipc/socket.c
+++ b/tipc/socket.c
@@ -26,8 +26,8 @@
static int publ_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_PUBL])
@@ -64,8 +64,8 @@ static int publ_list(uint32_t sock)
static int sock_list_cb(const struct nlmsghdr *nlh, void *data)
{
struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
- struct nlattr *info[TIPC_NLA_MAX + 1] = {};
- struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {};
+ struct nlattr *info[TIPC_NLA_MAX + 1] = {0};
+ struct nlattr *attrs[TIPC_NLA_SOCK_MAX + 1] = {0};
mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
if (!info[TIPC_NLA_SOCK])
@@ -79,7 +79,7 @@ static int sock_list_cb(const struct nlmsghdr *nlh, void *data)
if (attrs[TIPC_NLA_SOCK_CON]) {
uint32_t node;
- struct nlattr *con[TIPC_NLA_CON_MAX + 1] = {};
+ struct nlattr *con[TIPC_NLA_CON_MAX + 1] = {0};
mnl_attr_parse_nested(attrs[TIPC_NLA_SOCK_CON], parse_attrs, con);
node = mnl_attr_get_u32(con[TIPC_NLA_CON_NODE]);
--
2.28.0
|