Skip to content

Commit c1faead

Browse files
author
Antonio Quartulli
committed
batman-adv: use ETH_ALEN instead of hardcoded numeric constants
In packet.h the numeric constant 6 is used instead of the more portable ETH_ALEN define. This patch substitute any hardcoded value with such define. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Sven Eckelmann <sven@narfation.org>
1 parent 10e3cd6 commit c1faead

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎net/batman-adv/packet.h‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ struct batman_ogm_packet {
100100
struct batman_header header;
101101
uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */
102102
uint32_t seqno;
103-
uint8_t orig[6];
104-
uint8_t prev_sender[6];
103+
uint8_t orig[ETH_ALEN];
104+
uint8_t prev_sender[ETH_ALEN];
105105
uint8_t gw_flags; /* flags related to gateway class */
106106
uint8_t tq;
107107
uint8_t tt_num_changes;
@@ -114,8 +114,8 @@ struct batman_ogm_packet {
114114
struct icmp_packet {
115115
struct batman_header header;
116116
uint8_t msg_type; /* see ICMP message types above */
117-
uint8_t dst[6];
118-
uint8_t orig[6];
117+
uint8_t dst[ETH_ALEN];
118+
uint8_t orig[ETH_ALEN];
119119
uint16_t seqno;
120120
uint8_t uid;
121121
uint8_t reserved;
@@ -128,8 +128,8 @@ struct icmp_packet {
128128
struct icmp_packet_rr {
129129
struct batman_header header;
130130
uint8_t msg_type; /* see ICMP message types above */
131-
uint8_t dst[6];
132-
uint8_t orig[6];
131+
uint8_t dst[ETH_ALEN];
132+
uint8_t orig[ETH_ALEN];
133133
uint16_t seqno;
134134
uint8_t uid;
135135
uint8_t rr_cur;
@@ -139,24 +139,24 @@ struct icmp_packet_rr {
139139
struct unicast_packet {
140140
struct batman_header header;
141141
uint8_t ttvn; /* destination translation table version number */
142-
uint8_t dest[6];
142+
uint8_t dest[ETH_ALEN];
143143
} __packed;
144144

145145
struct unicast_frag_packet {
146146
struct batman_header header;
147147
uint8_t ttvn; /* destination translation table version number */
148-
uint8_t dest[6];
148+
uint8_t dest[ETH_ALEN];
149149
uint8_t flags;
150150
uint8_t align;
151-
uint8_t orig[6];
151+
uint8_t orig[ETH_ALEN];
152152
uint16_t seqno;
153153
} __packed;
154154

155155
struct bcast_packet {
156156
struct batman_header header;
157157
uint8_t reserved;
158158
uint32_t seqno;
159-
uint8_t orig[6];
159+
uint8_t orig[ETH_ALEN];
160160
} __packed;
161161

162162
struct vis_packet {
@@ -165,9 +165,9 @@ struct vis_packet {
165165
uint32_t seqno; /* sequence number */
166166
uint8_t entries; /* number of entries behind this struct */
167167
uint8_t reserved;
168-
uint8_t vis_orig[6]; /* originator that announces its neighbors */
169-
uint8_t target_orig[6]; /* who should receive this packet */
170-
uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
168+
uint8_t vis_orig[ETH_ALEN]; /* originator reporting its neighbors */
169+
uint8_t target_orig[ETH_ALEN]; /* who should receive this packet */
170+
uint8_t sender_orig[ETH_ALEN]; /* who sent or forwarded this packet */
171171
} __packed;
172172

173173
struct tt_query_packet {

0 commit comments

Comments
 (0)