hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/mpls/internal.h
....@@ -98,7 +98,7 @@
9898 u8 nh_via_table;
9999 u8 nh_reserved1;
100100
101
- u32 nh_label[0];
101
+ u32 nh_label[];
102102 };
103103
104104 /* offset of via from beginning of mpls_nh */
....@@ -154,7 +154,7 @@
154154 u8 rt_nh_size;
155155 u8 rt_via_offset;
156156 u8 rt_reserved1;
157
- struct mpls_nh rt_nh[0];
157
+ struct mpls_nh rt_nh[];
158158 };
159159
160160 #define for_nexthops(rt) { \
....@@ -171,17 +171,6 @@
171171 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
172172
173173 #define endfor_nexthops(rt) }
174
-
175
-static inline struct mpls_shim_hdr mpls_entry_encode(u32 label, unsigned ttl, unsigned tc, bool bos)
176
-{
177
- struct mpls_shim_hdr result;
178
- result.label_stack_entry =
179
- cpu_to_be32((label << MPLS_LS_LABEL_SHIFT) |
180
- (tc << MPLS_LS_TC_SHIFT) |
181
- (bos ? (1 << MPLS_LS_S_SHIFT) : 0) |
182
- (ttl << MPLS_LS_TTL_SHIFT));
183
- return result;
184
-}
185174
186175 static inline struct mpls_entry_decoded mpls_entry_decode(struct mpls_shim_hdr *hdr)
187176 {