summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-05-01 18:00:43 +0200
committerBen Hutchings <ben@decadent.org.uk>2016-06-15 21:28:09 +0100
commit53fd7f912c0877647d6a1e1877f5ea8535ee0b4a (patch)
tree083111a3dacdb1e93c9732c0429bddfad399f5f5
parentb5f9a2bbb2cc94ebdf9ecaa8bf87bcded5415d91 (diff)
downloadlinux-stable-53fd7f912c0877647d6a1e1877f5ea8535ee0b4a.tar.gz
linux-stable-53fd7f912c0877647d6a1e1877f5ea8535ee0b4a.tar.bz2
linux-stable-53fd7f912c0877647d6a1e1877f5ea8535ee0b4a.zip
Revert "net: validate variable length ll headers"
This reverts commit b5518429e70cd783b8ca52335456172c1a0589f6, which was commit 2793a23aacbd754dbbb5cb75093deb7e4103bace upstream. It is pointless unless af_packet calls the new function. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--include/linux/netdevice.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 700c94821db1..4b04097c748c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -293,7 +293,6 @@ struct header_ops {
void (*cache_update)(struct hh_cache *hh,
const struct net_device *dev,
const unsigned char *haddr);
- bool (*validate)(const char *ll_header, unsigned int len);
};
/* These flag bits are private to the generic network queueing
@@ -1120,7 +1119,7 @@ struct net_device {
unsigned int mtu; /* interface MTU value */
unsigned short type; /* interface hardware type */
- unsigned short hard_header_len; /* maximum hardware hdr length */
+ unsigned short hard_header_len; /* hardware hdr length */
/* extra head- and tailroom the hardware may need, but not in all cases
* can this be guaranteed, especially tailroom. Some cases also use
@@ -1729,24 +1728,6 @@ static inline int dev_rebuild_header(struct sk_buff *skb)
return dev->header_ops->rebuild(skb);
}
-/* ll_header must have at least hard_header_len allocated */
-static inline bool dev_validate_header(const struct net_device *dev,
- char *ll_header, int len)
-{
- if (likely(len >= dev->hard_header_len))
- return true;
-
- if (capable(CAP_SYS_RAWIO)) {
- memset(ll_header + len, 0, dev->hard_header_len - len);
- return true;
- }
-
- if (dev->header_ops && dev->header_ops->validate)
- return dev->header_ops->validate(ll_header, len);
-
- return false;
-}
-
typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf);
static inline int unregister_gifconf(unsigned int family)