|
@@ -238,12 +238,8 @@ bitmap_port_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
|
|
|
|
|
|
first_port = ip_set_get_h16(tb[IPSET_ATTR_PORT]);
|
|
|
last_port = ip_set_get_h16(tb[IPSET_ATTR_PORT_TO]);
|
|
|
- if (first_port > last_port) {
|
|
|
- u16 tmp = first_port;
|
|
|
-
|
|
|
- first_port = last_port;
|
|
|
- last_port = tmp;
|
|
|
- }
|
|
|
+ if (first_port > last_port)
|
|
|
+ swap(first_port, last_port);
|
|
|
|
|
|
elements = last_port - first_port + 1;
|
|
|
set->dsize = ip_set_elem_len(set, tb, 0, 0);
|