diff options
author | David Ward <david.ward@ll.mit.edu> | 2012-04-09 00:13:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-13 13:10:33 -0400 |
commit | 6f66cdc3e5d3d5ccbb7ee9265b8211cdc24aa401 (patch) | |
tree | 50209599d03eb7e4a086e7eb396dae4d0ae452de /net/802/garp.c | |
parent | 9d02daf754238adac48fa075ee79e7edd3d79ed3 (diff) |
net/garp: fix GID rbtree ordering
The comparison operators were backwards in both garp_attr_lookup and
garp_attr_create, so the entire GID rbtree was in reverse order.
(There was no practical side effect to this though, except that PDUs
were sent with attributes listed in reverse order, which is still
valid by the protocol. This change is only for clarity.)
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/802/garp.c')
-rw-r--r-- | net/802/garp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/802/garp.c b/net/802/garp.c index a5c224830439..8456f5d98b85 100644 --- a/net/802/garp.c +++ b/net/802/garp.c | |||
@@ -157,9 +157,9 @@ static struct garp_attr *garp_attr_lookup(const struct garp_applicant *app, | |||
157 | while (parent) { | 157 | while (parent) { |
158 | attr = rb_entry(parent, struct garp_attr, node); | 158 | attr = rb_entry(parent, struct garp_attr, node); |
159 | d = garp_attr_cmp(attr, data, len, type); | 159 | d = garp_attr_cmp(attr, data, len, type); |
160 | if (d < 0) | 160 | if (d > 0) |
161 | parent = parent->rb_left; | 161 | parent = parent->rb_left; |
162 | else if (d > 0) | 162 | else if (d < 0) |
163 | parent = parent->rb_right; | 163 | parent = parent->rb_right; |
164 | else | 164 | else |
165 | return attr; | 165 | return attr; |
@@ -178,9 +178,9 @@ static struct garp_attr *garp_attr_create(struct garp_applicant *app, | |||
178 | parent = *p; | 178 | parent = *p; |
179 | attr = rb_entry(parent, struct garp_attr, node); | 179 | attr = rb_entry(parent, struct garp_attr, node); |
180 | d = garp_attr_cmp(attr, data, len, type); | 180 | d = garp_attr_cmp(attr, data, len, type); |
181 | if (d < 0) | 181 | if (d > 0) |
182 | p = &parent->rb_left; | 182 | p = &parent->rb_left; |
183 | else if (d > 0) | 183 | else if (d < 0) |
184 | p = &parent->rb_right; | 184 | p = &parent->rb_right; |
185 | else { | 185 | else { |
186 | /* The attribute already exists; re-use it. */ | 186 | /* The attribute already exists; re-use it. */ |