Skip to contentSkip to conversation

: Use rtattr_strcmp where appropriate

PATCH In review Patrick McHardy 1 participant 1 message Jan 10, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 7/22 : Use rtattr_strcmp where appropriate

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/01/09 22:54:01+01:00 [email protected]
# [RTNETLINK]: Use rtattr_strcmp where appropriate
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/sched/act_api.c
#   2005/01/09 22:53:52+01:00 [email protected] +1 -1
#   [RTNETLINK]: Use rtattr_strcmp where appropriate
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
# net/ipv4/fib_rules.c
#   2005/01/09 22:53:52+01:00 [email protected] +1 -1
#   [RTNETLINK]: Use rtattr_strcmp where appropriate
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
# net/ipv4/devinet.c
#   2005/01/09 22:53:52+01:00 [email protected] +1 -1
#   [RTNETLINK]: Use rtattr_strcmp where appropriate
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
# net/decnet/dn_rules.c
#   2005/01/09 22:53:52+01:00 [email protected] +1 -1
#   [RTNETLINK]: Use rtattr_strcmp where appropriate
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
# net/decnet/dn_dev.c
#   2005/01/09 22:53:52+01:00 [email protected] +1 -1
#   [RTNETLINK]: Use rtattr_strcmp where appropriate
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
diff -Nru a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
--- a/net/decnet/dn_dev.c	2005-01-10 06:22:11 +01:00
+++ b/net/decnet/dn_dev.c	2005-01-10 06:22:11 +01:00
@@ -662,7 +662,7 @@
 	for(ifap = &dn_db->ifa_list; (ifa=*ifap) != NULL; ifap = &ifa->ifa_next) {
 		void *tmp = rta[IFA_LOCAL-1];
 		if ((tmp && memcmp(RTA_DATA(tmp), &ifa->ifa_local, 2)) ||
-				(rta[IFA_LABEL-1] && strcmp(RTA_DATA(rta[IFA_LABEL-1]), ifa->ifa_label)))
+		    (rta[IFA_LABEL-1] && rtattr_strcmp(rta[IFA_LABEL-1], ifa->ifa_label)))
 			continue;

dn_dev_del_ifa(dn_db, ifap, 1);

net/decnet/dn_rules.c +1 -1
diff -Nru a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
@@ -88,7 +88,7 @@
 #endif
 			(!rtm->rtm_type || rtm->rtm_type == r->r_action) &&
 			(!rta[RTA_PRIORITY-1] || memcmp(RTA_DATA(rta[RTA_PRIORITY-1]), &r->r_preference, 4) == 0) &&
-			(!rta[RTA_IIF-1] || strcmp(RTA_DATA(rta[RTA_IIF-1]), r->r_ifname) == 0) &&
+			(!rta[RTA_IIF-1] || rtattr_strcmp(rta[RTA_IIF-1], r->r_ifname) == 0) &&
 			(!rtm->rtm_table || (r && rtm->rtm_table == r->r_table))) {
 
 			err = -EPERM;
net/ipv4/devinet.c +1 -1
diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c
@@ -399,7 +399,7 @@
 		     memcmp(RTA_DATA(rta[IFA_LOCAL - 1]),
 			    &ifa->ifa_local, 4)) ||
 		    (rta[IFA_LABEL - 1] &&
-		     strcmp(RTA_DATA(rta[IFA_LABEL - 1]), ifa->ifa_label)) ||
+		     rtattr_strcmp(rta[IFA_LABEL - 1], ifa->ifa_label)) ||
 		    (rta[IFA_ADDRESS - 1] &&
 		     (ifm->ifa_prefixlen != ifa->ifa_prefixlen ||
 		      !inet_ifa_match(*(u32*)RTA_DATA(rta[IFA_ADDRESS - 1]),
net/ipv4/fib_rules.c +1 -1
diff -Nru a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
@@ -119,7 +119,7 @@
 #endif
 		    (!rtm->rtm_type || rtm->rtm_type == r->r_action) &&
 		    (!rta[RTA_PRIORITY-1] || memcmp(RTA_DATA(rta[RTA_PRIORITY-1]), &r->r_preference, 4) == 0) &&
-		    (!rta[RTA_IIF-1] || strcmp(RTA_DATA(rta[RTA_IIF-1]), r->r_ifname) == 0) &&
+		    (!rta[RTA_IIF-1] || rtattr_strcmp(rta[RTA_IIF-1], r->r_ifname) == 0) &&
 		    (!rtm->rtm_table || (r && rtm->rtm_table == r->r_table))) {
 			err = -EPERM;
 			if (r == &local_rule)
net/sched/act_api.c +1 -1
diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c
@@ -112,7 +112,7 @@
 	if (kind) {
 		read_lock(&act_mod_lock);
 		for (a = act_base; a; a = a->next) {
-			if (strcmp((char*)RTA_DATA(kind), a->kind) == 0) {
+			if (rtattr_strcmp(kind, a->kind) == 0) {
 				if (!try_module_get(a->owner)) {
 					read_unlock(&act_mod_lock);
 					return NULL;