aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2005-03-31 18:34:31 +0200
committerThomas Graf <tgraf@suug.ch>2005-03-31 18:34:31 +0200
commit81df61b91fd240465a4b6ba6b77d3642decfa91b (patch)
tree3575686a188320324a53a27da801d0add5dad07e
parent6d36ed6877f400d2dc44a995587d0512fb88e267 (diff)
downloadhistory-81df61b91fd240465a4b6ba6b77d3642decfa91b.tar.gz
Cset exclude: tgraf@suug.ch|ChangeSet|20050316221421|24742
-rw-r--r--include/linux/inetdevice.h20
-rw-r--r--include/linux/rtnetlink.h13
-rw-r--r--net/ipv4/devinet.c6
3 files changed, 2 insertions, 37 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index e04b71cd9e731c..6fafb27877a7d5 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -7,7 +7,6 @@
#include <linux/netdevice.h>
#include <linux/rcupdate.h>
#include <linux/timer.h>
-#include <linux/rtnetlink.h>
struct ipv4_devconf
{
@@ -132,25 +131,6 @@ static __inline__ int bad_mask(u32 mask, u32 addr)
return 0;
}
-static inline int inet_ifa_match_local_prefixlen(struct ifaddrmsg *ifm,
- struct in_ifaddr *ifa)
-{
- int real_prefixlen = IFA_REAL_DEL_PREFIX(ifm->ifa_prefixlen);
-
- /*
- * Since the prefix length hasn't been taken into account in
- * previous kernel versions, parts of the userspace rely on the fact
- * that the deletion of an address without specifying a prefix works.
- * We cannot break this and thus a prefix length of 32 still represents
- * a wildcard if no exact match is requested.
- */
- if (real_prefixlen != 32 || ifm->ifa_prefixlen & IFA_PREFIX_EXACT_DEL)
- if (real_prefixlen != ifa->ifa_prefixlen)
- return 0;
-
- return 1;
-}
-
#define for_primary_ifa(in_dev) { struct in_ifaddr *ifa; \
for (ifa = (in_dev)->ifa_list; ifa && !(ifa->ifa_flags&IFA_F_SECONDARY); ifa = ifa->ifa_next)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1b4e5122d697fc..32e52769a00b6e 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -398,19 +398,6 @@ enum
#define IFA_MAX (__IFA_MAX - 1)
-/*
- * Quirk for IPv4 address deletion to allow exact deletion of equal
- * addresses varying only in prefix length. A explicit exact comparison
- * of the prefix length will only be done if IFA_PREFIX_EXACT_DEL is
- * ORed to ifa_prefixlen.
- *
- * Note: This special treatment is only understood while deleting
- * addresses and will lead to unexpected behaviour if used
- * otherwise.
- */
-#define IFA_PREFIX_EXACT_DEL 0x40
-#define IFA_REAL_DEL_PREFIX(l) ((l) & 0x3f)
-
/* ifa_flags */
#define IFA_F_SECONDARY 0x01
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 25b94e0be09ee4..eea7ef0107767d 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -389,7 +389,6 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
struct in_device *in_dev;
struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
struct in_ifaddr *ifa, **ifap;
- int real_prefixlen = IFA_REAL_DEL_PREFIX(ifm->ifa_prefixlen);
ASSERT_RTNL();
@@ -400,13 +399,12 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
ifap = &ifa->ifa_next) {
if ((rta[IFA_LOCAL - 1] &&
- (!inet_ifa_match_local_prefixlen(ifm, ifa) ||
memcmp(RTA_DATA(rta[IFA_LOCAL - 1]),
- &ifa->ifa_local, 4))) ||
+ &ifa->ifa_local, 4)) ||
(rta[IFA_LABEL - 1] &&
rtattr_strcmp(rta[IFA_LABEL - 1], ifa->ifa_label)) ||
(rta[IFA_ADDRESS - 1] &&
- (real_prefixlen != ifa->ifa_prefixlen ||
+ (ifm->ifa_prefixlen != ifa->ifa_prefixlen ||
!inet_ifa_match(*(u32*)RTA_DATA(rta[IFA_ADDRESS - 1]),
ifa))))
continue;