[NET]: Change 1500 to ETH_DATA_LEN in some files
authorKris Katterjohn <kjak@users.sourceforge.net>
Fri, 6 Jan 2006 00:35:42 +0000 (16:35 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 6 Jan 2006 00:48:56 +0000 (16:48 -0800)
These patches add the header linux/if_ether.h and change 1500 to
ETH_DATA_LEN in some files.

Signed-off-by: Kris Katterjohn <kjak@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_if.c
net/ethernet/eth.c
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv6/sit.c

index 1132119..ba44288 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
+#include <linux/if_ether.h>
 #include <net/sock.h>
 
 #include "br_private.h"
@@ -323,7 +324,7 @@ int br_del_bridge(const char *name)
        return ret;
 }
 
-/* Mtu of the bridge pseudo-device 1500 or the minimum of the ports */
+/* MTU of the bridge pseudo-device: ETH_DATA_LEN or the minimum of the ports */
 int br_min_mtu(const struct net_bridge *br)
 {
        const struct net_bridge_port *p;
@@ -332,7 +333,7 @@ int br_min_mtu(const struct net_bridge *br)
        ASSERT_RTNL();
 
        if (list_empty(&br->port_list))
-               mtu = 1500;
+               mtu = ETH_DATA_LEN;
        else {
                list_for_each_entry(p, &br->port_list, list) {
                        if (!mtu  || p->dev->mtu < mtu)
index e245773..9f4dbeb 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/errno.h>
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/if_ether.h>
 #include <net/dst.h>
 #include <net/arp.h>
 #include <net/sock.h>
@@ -251,7 +252,7 @@ static int eth_mac_addr(struct net_device *dev, void *p)
 
 static int eth_change_mtu(struct net_device *dev, int new_mtu)
 {
-       if ((new_mtu < 68) || (new_mtu > 1500))
+       if (new_mtu < 68 || new_mtu > ETH_DATA_LEN)
                return -EINVAL;
        dev->mtu = new_mtu;
        return 0;
@@ -272,7 +273,7 @@ void ether_setup(struct net_device *dev)
 
        dev->type               = ARPHRD_ETHER;
        dev->hard_header_len    = ETH_HLEN;
-       dev->mtu                = 1500; /* eth_mtu */
+       dev->mtu                = ETH_DATA_LEN;
        dev->addr_len           = ETH_ALEN;
        dev->tx_queue_len       = 1000; /* Ethernet wants good queues */        
        dev->flags              = IFF_BROADCAST|IFF_MULTICAST;
index 46f9d9c..912c42f 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/inetdevice.h>
 #include <linux/igmp.h>
 #include <linux/netfilter_ipv4.h>
+#include <linux/if_ether.h>
 
 #include <net/sock.h>
 #include <net/ip.h>
@@ -1140,7 +1141,7 @@ static void ipgre_tunnel_setup(struct net_device *dev)
 
        dev->type               = ARPHRD_IPGRE;
        dev->hard_header_len    = LL_MAX_HEADER + sizeof(struct iphdr) + 4;
-       dev->mtu                = 1500 - sizeof(struct iphdr) - 4;
+       dev->mtu                = ETH_DATA_LEN - sizeof(struct iphdr) - 4;
        dev->flags              = IFF_NOARP;
        dev->iflink             = 0;
        dev->addr_len           = 4;
@@ -1152,7 +1153,7 @@ static int ipgre_tunnel_init(struct net_device *dev)
        struct ip_tunnel *tunnel;
        struct iphdr *iph;
        int hlen = LL_MAX_HEADER;
-       int mtu = 1500;
+       int mtu = ETH_DATA_LEN;
        int addend = sizeof(struct iphdr) + 4;
 
        tunnel = (struct ip_tunnel*)dev->priv;
index c05c1df..35571cf 100644 (file)
 #include <linux/mroute.h>
 #include <linux/init.h>
 #include <linux/netfilter_ipv4.h>
+#include <linux/if_ether.h>
 
 #include <net/sock.h>
 #include <net/ip.h>
@@ -786,7 +787,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
 
        dev->type               = ARPHRD_TUNNEL;
        dev->hard_header_len    = LL_MAX_HEADER + sizeof(struct iphdr);
-       dev->mtu                = 1500 - sizeof(struct iphdr);
+       dev->mtu                = ETH_DATA_LEN - sizeof(struct iphdr);
        dev->flags              = IFF_NOARP;
        dev->iflink             = 0;
        dev->addr_len           = 4;
index caa3b7d..9a5c0ce 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/seq_file.h>
 #include <linux/mroute.h>
 #include <linux/init.h>
+#include <linux/if_ether.h>
 #include <net/ip.h>
 #include <net/protocol.h>
 #include <linux/skbuff.h>
@@ -193,7 +194,7 @@ static struct net_device_stats *reg_vif_get_stats(struct net_device *dev)
 static void reg_vif_setup(struct net_device *dev)
 {
        dev->type               = ARPHRD_PIMREG;
-       dev->mtu                = 1500 - sizeof(struct iphdr) - 8;
+       dev->mtu                = ETH_DATA_LEN - sizeof(struct iphdr) - 8;
        dev->flags              = IFF_NOARP;
        dev->hard_start_xmit    = reg_vif_xmit;
        dev->get_stats          = reg_vif_get_stats;
index c3123c9..577d497 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/uaccess.h>
 #include <linux/init.h>
 #include <linux/netfilter_ipv4.h>
+#include <linux/if_ether.h>
 
 #include <net/sock.h>
 #include <net/snmp.h>
@@ -720,7 +721,7 @@ static void ipip6_tunnel_setup(struct net_device *dev)
 
        dev->type               = ARPHRD_SIT;
        dev->hard_header_len    = LL_MAX_HEADER + sizeof(struct iphdr);
-       dev->mtu                = 1500 - sizeof(struct iphdr);
+       dev->mtu                = ETH_DATA_LEN - sizeof(struct iphdr);
        dev->flags              = IFF_NOARP;
        dev->iflink             = 0;
        dev->addr_len           = 4;