summaryrefslogtreecommitdiffstats
path: root/tc/f_u32.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-02 11:55:30 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-02 11:55:30 -0700
commite3d153c1fb35ec5d5f4ce197afb4cb13093ce534 (patch)
treef2d8df6bc95de8807a9406aedf05feb3047a2396 /tc/f_u32.c
parent02833d1b381f468c8744f786061b36b7a4c2572a (diff)
Fix byte order of ether address match for u32
The u32 key match was incorrect byte order when using ether source or destination address matching.
Diffstat (limited to 'tc/f_u32.c')
-rw-r--r--tc/f_u32.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 31e13b52..d9d40914 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -448,7 +448,6 @@ static int parse_ether_addr(int *argc_p, char ***argv_p,
char **argv = *argv_p;
__u8 addr[6];
int offmask = 0;
- __u32 key;
int i;
if (argc < 1)
@@ -469,10 +468,8 @@ static int parse_ether_addr(int *argc_p, char ***argv_p,
return -1;
}
- for (i = 0; i < 6; i += 2) {
- key = *(__u16 *) (addr + i);
-
- res = pack_key16(sel, key, 0xFFFF, off + i, offmask);
+ for (i = 0; i < 6; i++) {
+ res = pack_key8(sel, addr[i], 0xFF, off + i, offmask);
if (res < 0)
return -1;
}